]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/protected/Portlets/BActiveButton.php
1c4b6ade7a9e40edf8c43240c041c7b56c129426
[bacula/bacula] / gui / baculum / protected / Portlets / BActiveButton.php
1 <?php
2 /**
3  * Bacula® - The Network Backup Solution
4  * Baculum - Bacula web interface
5  *
6  * Copyright (C) 2013-2014 Marcin Haba
7  *
8  * The main author of Baculum is Marcin Haba.
9  * The main author of Bacula is Kern Sibbald, with contributions from many
10  * others, a complete list can be found in the file AUTHORS.
11  *
12  * You may use this file and others of this release according to the
13  * license defined in the LICENSE file, which includes the Affero General
14  * Public License, v3.0 ("AGPLv3") and some additional permissions and
15  * terms pursuant to its AGPLv3 Section 7.
16  *
17  * Bacula® is a registered trademark of Kern Sibbald.
18  */
19  
20 Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
21
22 class BActiveButton extends TButton implements ICallbackEventHandler, IActiveControl
23 {
24         public function __construct()
25         {
26                 parent::__construct();
27                 $this->setAdapter(new TActiveControlAdapter($this));
28         }
29
30         public function getActiveControl()
31         {
32                 return $this->getAdapter()->getBaseActiveControl();
33         }
34
35         public function getClientSide()
36         {
37                 return $this->getAdapter()->getBaseActiveControl()->getClientSide();
38         }
39
40         public function raiseCallbackEvent($param)
41         {
42                 $this->raisePostBackEvent($param);
43                 $this->onCallback($param);
44         }
45
46         public function onCallback($param)
47         {
48                 $this->raiseEvent('OnCallback', $this, $param);
49         }
50
51         public function setText($value)
52         {
53                 parent::setText($value);
54                 if($this->getActiveControl()->canUpdateClientSide())
55                         $this->getPage()->getCallbackClient()->setAttribute($this, 'value', $value);
56         }
57
58         protected function renderClientControlScript($writer)
59         {
60                 $this->CssClass = "bbutton";
61         }
62
63         protected function addAttributesToRender($writer)
64         {
65                 parent::addAttributesToRender($writer);
66                 $writer->addAttribute('id',$this->getClientID());
67                 $this->getActiveControl()->registerCallbackClientScript(
68                         $this->getClientClassName(), $this->getPostBackOptions());
69         }
70
71         protected function getClientClassName()
72         {
73                 return 'Prado.WebUI.TActiveButton';
74         }
75
76         public function setActionClass($param) {
77         }
78
79
80 }
81
82 ?>