3 * Bacula® - The Network Backup Solution
4 * Baculum - Bacula web interface
6 * Copyright (C) 2013-2014 Marcin Haba
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.
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.
17 * Bacula® is a registered trademark of Kern Sibbald.
20 Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
22 class BActiveButton extends TButton implements ICallbackEventHandler, IActiveControl
24 public function __construct()
26 parent::__construct();
27 $this->setAdapter(new TActiveControlAdapter($this));
30 public function getActiveControl()
32 return $this->getAdapter()->getBaseActiveControl();
35 public function getClientSide()
37 return $this->getAdapter()->getBaseActiveControl()->getClientSide();
40 public function raiseCallbackEvent($param)
42 $this->raisePostBackEvent($param);
43 $this->onCallback($param);
46 public function onCallback($param)
48 $this->raiseEvent('OnCallback', $this, $param);
51 public function setText($value)
53 parent::setText($value);
54 if($this->getActiveControl()->canUpdateClientSide())
55 $this->getPage()->getCallbackClient()->setAttribute($this, 'value', $value);
58 protected function renderClientControlScript($writer)
60 $this->CssClass = "bbutton";
63 protected function addAttributesToRender($writer)
65 parent::addAttributesToRender($writer);
66 $writer->addAttribute('id',$this->getClientID());
67 $this->getActiveControl()->registerCallbackClientScript(
68 $this->getClientClassName(), $this->getPostBackOptions());
71 protected function getClientClassName()
73 return 'Prado.WebUI.TActiveButton';
76 public function setActionClass($param) {