Code

Added RSS reader
[gosa.git] / gosa-core / plugins / generic / dashBoard / dbInformation / class_dbInformation.inc
1 <?php
3 class dbInformation extends plugin
4 {
5     function __construct($config)
6     {
7         parent::__construct($config, NULL);
9         // Construct the plugin list.
10         $this->feedList = new sortableListing();
11         $this->feedList->setDeleteable(false);
12         $this->feedList->setEditable(false);
13 #        $this->feedList->setColspecs(array('30px','120px','*','100px'));
14 #        $this->feedList->setHeader(array('?',_("Name"),_("Descriptio"),_("Status")));
15         $this->feedList->setWidth("100%");
16 #        $this->feedList->setDefaultSortColumn(1);
17         $this->feedList->setHeight("200px");
18         $this->feedList->setAcl("rwcdm");
19     }
21     function execute()
22     {
23         $smarty = get_smarty();
24         $feeds = rssReader::feadToArray('http://www.computerbild.de/rssfeed_2261.html?node=10');
26         $data = $lData = array();
27         foreach($feeds as $key => $feed){
28             $data[$key] = $feed;
29             $lData[$key] = array('data'=> array(date('H:i:s', $feed['timestamp']),$feed['title']));
30         }
31         $this->feedList->setListData($data, $lData);
32         $this->feedList->update();
33         $smarty->assign('feedList', $this->feedList->render());
34         return($smarty->fetch(get_template_path('dbInformation/contents.tpl', TRUE)));
35     }
37     function save_object()
38     {
39         parent::save_object();
40     }
42     function save()
43     {
44         parent::save();
45     }
47     function check()
48     {
49         return(parent::check());
50     }
52     function remove_from_parent()
53     {
54         parent::remove_from_parent();
55     }
56 }
58 ?>