[gosa.git] / gosa-core / plugins / generic / dashBoard / dbChannelStatus / class_dbChannelStatus.inc
1 <?php
3 class dbChannelStatus extends plugin
4 {
5 function __construct($config)
6 {
7 parent::__construct($config, NULL);
9 // Construct the channel list.
10 $this->channelList= new sortableListing();
11 $this->channelList->setDeleteable(false);
12 $this->channelList->setEditable(false);
13 $this->channelList->setColspecs(array('30px','120px','*','100px'));
14 $this->channelList->setHeader(array('?',_("Name"),_("Description"),_("Status")));
15 $this->channelList->setWidth("100%");
16 $this->channelList->setDefaultSortColumn(1);
17 $this->channelList->setHeight("200px");
18 $this->channelList->setAcl("rwcdm");
19 }
21 function execute()
22 {
23 // Transmit daily statistics to GOsa-Server
24 if(isset($_POST['transmitStatistics'])){
26 // First try to retrieve values via RPC
27 if ($this->config->get_cfg_value("core","gosaRpcServer") != ""){
28 $dump = stats::dumpTables();
29 $rpc = $this->config->getRpcHandle(
30 "http://10.3.64.59:4000",
31 "65717fe6-9e3e-11df-b010-5452005f1250",
32 "WyukwauWoid2",
33 TRUE);
34 $rpc->updateInstanceStatus($dump);
35 if(!$rpc->success()){
36 msg_dialog::display(_("Error"),msgPool::rpcError($rpc->get_error()),ERROR_DIALOG);
37 }
38 }
39 }
43 $smarty = get_smarty();
45 $channel = array();
46 $channel[] = array(
47 'icon' => image('images/true.png'),
48 'name' => 'GONICUS support',
49 'desc' => 'GONICUS helps you all time!',
50 'stat' => 'Online'
51 );
52 $channel[] = array(
53 'icon' => image('images/true.png'),
54 'name' => 'Free',
55 'desc' => 'Free channel, basic GOsa plugins!',
56 'stat' => 'Online'
57 );
58 $channel[] = array(
59 'icon' => image('images/small_error.png'),
60 'name' => 'Experimental',
61 'desc' => 'May be down for maintance!',
62 'stat' => 'Offline'
63 );
66 $data = $lData = array();
67 foreach($channel as $key => $ch){
68 $data[$key] = $ch;
69 $lData[$key] = array('data' => array($ch['icon'],$ch['name'], $ch['desc'], $ch['stat']));
70 }
72 $this->channelList->setListData($data,$lData);
73 $this->channelList->update();
74 $smarty->assign('channelList', $this->channelList->render());
75 return($smarty->fetch(get_template_path('dbChannelStatus/contents.tpl', TRUE)));
76 }
78 function save_object()
79 {
80 parent::save_object();
81 }
83 function save()
84 {
85 parent::save();
86 }
88 function check()
89 {
90 return(parent::check());
91 }
93 function remove_from_parent()
94 {
95 parent::remove_from_parent();
96 }
97 }
99 ?>