a983faf369182ef6f200fc8d1032bbccc2bc6d22
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->GOsaRegistration = new GOsaRegistration($config);
28 $this->registered = GOsaRegistration::isRegistered($config);
29 }
31 function execute()
32 {
34 if(!$this->registered){
35 return($this->GOsaRegistration->execute());
36 }
38 $smarty = get_smarty();
39 $smarty->assign('dbPluginStatus', $this->dbPluginStatus->execute());
40 $smarty->assign('dbChannelStatus', $this->dbChannelStatus->execute());
41 $smarty->assign('dbNotifications', $this->dbNotifications->execute());
42 $smarty->assign('dbInformation', $this->dbInformation->execute());
43 return($smarty->fetch(get_template_path('dashBoard.tpl', TRUE)));
44 }
46 function check()
47 {
48 $messages = plugin::check();
49 $messages = array_merge($this->dbPluginStatus->check());
50 $messages = array_merge($this->dbChannelStatus->check());
51 $messages = array_merge($this->dbNotifications->check());
52 $messages = array_merge($this->dbInformation->check());
53 return($messages);
54 }
56 function save_object()
57 {
58 plugin::save_object();
60 if(!$this->registered) $this->GOsaRegistration->save_object();
62 $this->dbPluginStatus->save_object();
63 $this->dbChannelStatus->save_object();
64 $this->dbNotifications->save_object();
65 $this->dbInformation->save_object();
66 }
68 function save()
69 {
70 plugin::save();
71 $this->dbPluginStatus->save();
72 $this->dbChannelStatus->save();
73 $this->dbNotifications->save();
74 $this->dbInformation->save();
75 }
77 function remove_from_parent()
78 {
79 plugin::remove_from_parent();
80 $this->dbPluginStatus->remove_from_parent();
81 $this->dbChannelStatus->remove_from_parent();
82 $this->dbNotifications->remove_from_parent();
83 $this->dbInformation->remove_from_parent();
84 }
85 }
87 ?>