]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/protected/Portlets/BActiveButton.php
Add more debug to recycle-test
[bacula/bacula] / gui / baculum / protected / Portlets / BActiveButton.php
1 <?php
2 /*
3  * Bacula(R) - The Network Backup Solution
4  * Baculum   - Bacula web interface
5  *
6  * Copyright (C) 2013-2015 Marcin Haba
7  *
8  * The main author of Baculum is Marcin Haba.
9  * The original author of Bacula is Kern Sibbald, with contributions
10  * from many 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  * This notice must be preserved when any source code is
18  * conveyed and/or propagated.
19  *
20  * Bacula(R) is a registered trademark of Kern Sibbald.
21  */
22  
23 Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
24
25 class BActiveButton extends TButton implements ICallbackEventHandler, IActiveControl
26 {
27         public function __construct()
28         {
29                 parent::__construct();
30                 $this->setAdapter(new TActiveControlAdapter($this));
31         }
32
33         public function getActiveControl()
34         {
35                 return $this->getAdapter()->getBaseActiveControl();
36         }
37
38         public function getClientSide()
39         {
40                 return $this->getAdapter()->getBaseActiveControl()->getClientSide();
41         }
42
43         public function raiseCallbackEvent($param)
44         {
45                 $this->raisePostBackEvent($param);
46                 $this->onCallback($param);
47         }
48
49         public function onCallback($param)
50         {
51                 $this->raiseEvent('OnCallback', $this, $param);
52         }
53
54         public function setText($value)
55         {
56                 parent::setText($value);
57                 if($this->getActiveControl()->canUpdateClientSide())
58                         $this->getPage()->getCallbackClient()->setAttribute($this, 'value', $value);
59         }
60
61         protected function renderClientControlScript($writer)
62         {
63                 $this->CssClass = "bbutton";
64         }
65
66         protected function addAttributesToRender($writer)
67         {
68                 parent::addAttributesToRender($writer);
69                 $writer->addAttribute('id',$this->getClientID());
70                 $this->getActiveControl()->registerCallbackClientScript(
71                         $this->getClientClassName(), $this->getPostBackOptions());
72         }
73
74         protected function getClientClassName()
75         {
76                 return 'Prado.WebUI.TActiveButton';
77         }
78
79         public function setActionClass($param) {
80         }
81
82
83 }
84
85 ?>