summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0316d22)
raw | patch | inline | side by side (parent: 0316d22)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 30 Jun 2010 10:21:01 +0000 (10:21 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 30 Jun 2010 10:21:01 +0000 (10:21 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18883 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/plugins/generic/dashBoard/dbInformation/class_dbInformation.inc b/gosa-core/plugins/generic/dashBoard/dbInformation/class_dbInformation.inc
index f04d4e65ae800d5f588042ffbd56187036418193..d9e9fc97815f58c73e8b174147a190f185d8136a 100644 (file)
function __construct($config)
{
parent::__construct($config, NULL);
+
+ // Construct the plugin list.
+ $this->feedList = new sortableListing();
+ $this->feedList->setDeleteable(false);
+ $this->feedList->setEditable(false);
+# $this->feedList->setColspecs(array('30px','120px','*','100px'));
+# $this->feedList->setHeader(array('?',_("Name"),_("Descriptio"),_("Status")));
+ $this->feedList->setWidth("100%");
+# $this->feedList->setDefaultSortColumn(1);
+ $this->feedList->setHeight("200px");
+ $this->feedList->setAcl("rwcdm");
}
function execute()
{
$smarty = get_smarty();
+ $feeds = rssReader::feadToArray('http://www.computerbild.de/rssfeed_2261.html?node=10');
+
+ $data = $lData = array();
+ foreach($feeds as $key => $feed){
+ $data[$key] = $feed;
+ $lData[$key] = array('data'=> array(date('H:i:s', $feed['timestamp']),$feed['title']));
+ }
+ $this->feedList->setListData($data, $lData);
+ $this->feedList->update();
+ $smarty->assign('feedList', $this->feedList->render());
return($smarty->fetch(get_template_path('dbInformation/contents.tpl', TRUE)));
}
diff --git a/gosa-core/plugins/generic/dashBoard/dbInformation/class_rssReader.inc b/gosa-core/plugins/generic/dashBoard/dbInformation/class_rssReader.inc
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+class rssReader{
+
+ static function feadToArray($url)
+ {
+
+ $doc = new DOMDocument();
+ $doc->load($url);
+ $entries = array();
+ foreach ($doc->getElementsByTagName('item') as $item) {
+ $entry = array (
+ 'title' => $item->getElementsByTagName('title')->item(0)->nodeValue,
+ 'desc' => $item->getElementsByTagName('description')->item(0)->nodeValue,
+ 'link' => $item->getElementsByTagName('link')->item(0)->nodeValue,
+ 'date' => $item->getElementsByTagName('pubDate')->item(0)->nodeValue,
+ 'timestamp' => strtotime($item->getElementsByTagName('pubDate')->item(0)->nodeValue)
+ );
+ $entries[$entry['timestamp']."-".$entry['date']] = $entry;
+ }
+ return($entries);
+ }
+}
+
+?>
diff --git a/gosa-core/plugins/generic/dashBoard/dbInformation/contents.tpl b/gosa-core/plugins/generic/dashBoard/dbInformation/contents.tpl
index 345e6aef713208c8d50cdea23b85e6ad831f0449..841ab5d099a624a09692a5f62173e114f2431981 100644 (file)
-Test
+{$feedList}