From 25edab1176af1a56241a4bb0eda8ea3518db0271 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 30 Jun 2010 14:36:18 +0000 Subject: [PATCH] Updated dash board stuff git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18887 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../{dbInformation => }/class_rssReader.inc | 0 .../dashBoard/dbAdvices/class_dbAdvices.inc | 42 ++++++++++++------- .../generic/dashBoard/dbAdvices/contents.tpl | 2 +- .../dbInformation/class_dbInformation.inc | 15 ------- 4 files changed, 28 insertions(+), 31 deletions(-) rename gosa-core/plugins/generic/dashBoard/{dbInformation => }/class_rssReader.inc (100%) diff --git a/gosa-core/plugins/generic/dashBoard/dbInformation/class_rssReader.inc b/gosa-core/plugins/generic/dashBoard/class_rssReader.inc similarity index 100% rename from gosa-core/plugins/generic/dashBoard/dbInformation/class_rssReader.inc rename to gosa-core/plugins/generic/dashBoard/class_rssReader.inc diff --git a/gosa-core/plugins/generic/dashBoard/dbAdvices/class_dbAdvices.inc b/gosa-core/plugins/generic/dashBoard/dbAdvices/class_dbAdvices.inc index d79af4cf0..461363fe8 100644 --- a/gosa-core/plugins/generic/dashBoard/dbAdvices/class_dbAdvices.inc +++ b/gosa-core/plugins/generic/dashBoard/dbAdvices/class_dbAdvices.inc @@ -5,32 +5,44 @@ class dbAdvices extends plugin function __construct($config) { parent::__construct($config, NULL); + + // Construct the plugin list. + $this->adviceList = new sortableListing(); + $this->adviceList->setDeleteable(false); + $this->adviceList->setEditable(false); + $this->adviceList->setWidth("100%"); + $this->adviceList->setHeight("200px"); + $this->adviceList->setAcl("rwcdm"); } function execute() { + // Get logs as RSS feed. + $source = file_get_contents('http://10.3.65.162/gosa/gosa-all/gosa/html/index.html'); + + // Read Feeds and sort the results + $feeds = rssReader::parseFeedFromSource(array($source)); + $feeds = rssReader::sortFeedResultBy($feeds, 'timestamp'); + + // Append the results to the list. + $data = $lData = array(); + foreach($feeds as $key => $feed){ + $data[$key] = $feed; + $lData[$key] = array('data'=> array(htmlentities($feed['title'],ENT_QUOTES,'UTF-8'))); + } + $this->adviceList->setListData($data, $lData); + $this->adviceList->update(); + + // Generate the HTML content $smarty = get_smarty(); + $smarty->assign('adviceList', $this->adviceList->render()); return($smarty->fetch(get_template_path('dbAdvices/contents.tpl', TRUE))); } function save_object() { parent::save_object(); - } - - function save() - { - parent::save(); - } - - function check() - { - return(parent::check()); - } - - function remove_from_parent() - { - parent::remove_from_parent(); + $this->adviceList->save_object(); } } diff --git a/gosa-core/plugins/generic/dashBoard/dbAdvices/contents.tpl b/gosa-core/plugins/generic/dashBoard/dbAdvices/contents.tpl index 345e6aef7..72926473d 100644 --- a/gosa-core/plugins/generic/dashBoard/dbAdvices/contents.tpl +++ b/gosa-core/plugins/generic/dashBoard/dbAdvices/contents.tpl @@ -1 +1 @@ -Test +{$adviceList} diff --git a/gosa-core/plugins/generic/dashBoard/dbInformation/class_dbInformation.inc b/gosa-core/plugins/generic/dashBoard/dbInformation/class_dbInformation.inc index 36c02ddf4..48b60b6f4 100644 --- a/gosa-core/plugins/generic/dashBoard/dbInformation/class_dbInformation.inc +++ b/gosa-core/plugins/generic/dashBoard/dbInformation/class_dbInformation.inc @@ -54,21 +54,6 @@ class dbInformation extends plugin parent::save_object(); $this->feedList->save_object(); } - - function save() - { - parent::save(); - } - - function check() - { - return(parent::check()); - } - - function remove_from_parent() - { - parent::remove_from_parent(); - } } ?> -- 2.30.2