Code

b0e8e7f4630d887a5537fd451b8e7bae0c948f5e
[gosa.git] / gosa-core / plugins / generic / dashBoard / class_dashBoard.inc
1 <?php
3 class dashBoard extends plugin
4 {
5     var $plHeadline = 'Dash board';
6     var $plDescription = 'Dash board';
7     var $plShortIcon = 'dashBoard.png';
8     var $plIcon = 'plugin.png';
10     private $dbPluginStatus = NULL;
11     private $dbChannelStatus = NULL;
12     private $dbNotifications = NULL;
13     private $dbInformation = NULL;
15     function __construct($config)
16     {
17         plugin::plugin($config, NULL);
19         // Instantiate child classes
20         $this->dbPluginStatus = new dbPluginStatus($config);
21         $this->dbChannelStatus = new dbChannelStatus($config);
22         $this->dbNotifications = new dbNotifications($config);
23         $this->dbInformation = new dbInformation($config);
26         // Detect registration status 
27         $this->RegistrationDialog = new RegistrationDialog($config);
28     }
30     function execute()
31     {
32         if(!$this->config->registration->isRegistered()){
33             return($this->RegistrationDialog->execute());
34         }
36         $smarty = get_smarty();
37         $smarty->assign('dbPluginStatus', $this->dbPluginStatus->execute());
38         $smarty->assign('dbChannelStatus', $this->dbChannelStatus->execute());
39         $smarty->assign('dbNotifications', $this->dbNotifications->execute());
40         $smarty->assign('dbInformation', $this->dbInformation->execute());
41         return($smarty->fetch(get_template_path('dashBoard.tpl', TRUE)));
42     }
44     function check()
45     {
46         $messages = plugin::check();
47         $messages = array_merge($this->dbPluginStatus->check());    
48         $messages = array_merge($this->dbChannelStatus->check());    
49         $messages = array_merge($this->dbNotifications->check());    
50         $messages = array_merge($this->dbInformation->check());    
51         return($messages);
52     }
54     function save_object()
55     {
56         plugin::save_object();
57         
58         if(!$this->config->registration->isRegistered()) $this->RegistrationDialog->save_object();
60         $this->dbPluginStatus->save_object();
61         $this->dbChannelStatus->save_object();
62         $this->dbNotifications->save_object();
63         $this->dbInformation->save_object();
64     }
66     function save()
67     {
68         plugin::save();
69         $this->dbPluginStatus->save();
70         $this->dbChannelStatus->save();
71         $this->dbNotifications->save();
72         $this->dbInformation->save();
73     }
75     function remove_from_parent()
76     {
77         plugin::remove_from_parent();
78         $this->dbPluginStatus->remove_from_parent();
79         $this->dbChannelStatus->remove_from_parent();
80         $this->dbNotifications->remove_from_parent();
81         $this->dbInformation->remove_from_parent();
82     }
83 }
85 ?>