From 2b8b08dedf50fdce5e9ebef6051f21b4c3e40035 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 30 Jun 2010 13:27:30 +0000 Subject: [PATCH] Updated dashbaord -Updated feed provider git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18885 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../dbInformation/class_dbInformation.inc | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/gosa-core/plugins/generic/dashBoard/dbInformation/class_dbInformation.inc b/gosa-core/plugins/generic/dashBoard/dbInformation/class_dbInformation.inc index 707447cbb..e393a3535 100644 --- a/gosa-core/plugins/generic/dashBoard/dbInformation/class_dbInformation.inc +++ b/gosa-core/plugins/generic/dashBoard/dbInformation/class_dbInformation.inc @@ -9,37 +9,54 @@ class dbInformation extends plugin // Construct the plugin list. $this->feedList = new sortableListing(); $this->feedList->setDeleteable(false); - $this->feedList->setEditable(false); - #$this->feedList->setColspecs(array('130px','*')); - #$this->feedList->setHeader(array(_("Date"),_("Description"))); + $this->feedList->setEditable(true); $this->feedList->setWidth("100%"); - #$this->feedList->setDefaultSortColumn(0); $this->feedList->setHeight("200px"); $this->feedList->setAcl("rwcdm"); } function execute() { - $smarty = get_smarty(); + // Act on clicks on the feed list. + $linkOpener = ""; + $action = $this->feedList->getAction(); + if(isset($action['action']) && $action['action'] == 'edit'){ + $data = $this->feedList->getData($action['targets'][0]); + if(isset($data['link']) && !empty($data['link'])){ + $linkOpener = ' + '; + } + } + + // Read Feeds and sort the results $feeds = rssReader::feadToArray(array( + 'http://www.uweschwanz.com/de/rss/', + 'http://www.aviationpower.de/rss_de.php', 'http://www.computerbild.de/rssfeed_2261.html?node=10', 'http://www.charts-portal.de/games/Computerspiele.xml')); $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($feed['title'])); + $lData[$key] = array('data'=> array(htmlentities($feed['title'],ENT_QUOTES,'UTF-8'))); } - $this->feedList->setListData($data, $lData); $this->feedList->update(); + + // Generate the HTML content + $smarty = get_smarty(); $smarty->assign('feedList', $this->feedList->render()); - return($smarty->fetch(get_template_path('dbInformation/contents.tpl', TRUE))); + return($linkOpener.$smarty->fetch(get_template_path('dbInformation/contents.tpl', TRUE))); } function save_object() { parent::save_object(); + $this->feedList->save_object(); } function save() -- 2.30.2