Code

Added RSS reader
[gosa.git] / gosa-core / plugins / generic / dashBoard / dbInformation / class_dbInformation.inc
index f04d4e65ae800d5f588042ffbd56187036418193..d9e9fc97815f58c73e8b174147a190f185d8136a 100644 (file)
@@ -5,11 +5,32 @@ class dbInformation extends plugin
     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)));
     }