]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/baculum/protected/Portlets/BActiveButton.php
baculum: Assign Baculum copyright to Kern Sibbald
[bacula/bacula] / gui / baculum / protected / Portlets / BActiveButton.php
index 13bb4970b56675dfbba229793abfceb0d2e45ae2..d6be4c38bf173345e544eccab83815509998d0b9 100644 (file)
@@ -1,57 +1,85 @@
 <?php
-/**
- * Bacula® - The Network Backup Solution
- * Baculum - Bacula web interface
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum   - Bacula web interface
  *
- * Copyright (C) 2013-2014 Marcin Haba
+ * Copyright (C) 2013-2016 Kern Sibbald
  *
  * The main author of Baculum is Marcin Haba.
- * The main author of Bacula is Kern Sibbald, with contributions from many
- * others, a complete list can be found in the file AUTHORS.
+ * The original author of Bacula is Kern Sibbald, with contributions
+ * from many others, a complete list can be found in the file AUTHORS.
  *
  * You may use this file and others of this release according to the
  * license defined in the LICENSE file, which includes the Affero General
  * Public License, v3.0 ("AGPLv3") and some additional permissions and
  * terms pursuant to its AGPLv3 Section 7.
  *
- * Bacula® is a registered trademark of Kern Sibbald.
+ * This notice must be preserved when any source code is
+ * conveyed and/or propagated.
+ *
+ * Bacula(R) is a registered trademark of Kern Sibbald.
  */
  
-Prado::using('System.Web.UI.ActiveControls.TActiveButton');
-Prado::using('Application.Portlets.Portlets');
+Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
 
-class BActiveButton extends Portlets{
+class BActiveButton extends TButton implements ICallbackEventHandler, IActiveControl
+{
+       public function __construct()
+       {
+               parent::__construct();
+               $this->setAdapter(new TActiveControlAdapter($this));
+       }
 
-       public $actionClass, $text, $validationGroup;
-       public $causesValidation = true;
+       public function getActiveControl()
+       {
+               return $this->getAdapter()->getBaseActiveControl();
+       }
 
-       public function onInit($param) {
-               parent::onInit($param);
+       public function getClientSide()
+       {
+               return $this->getAdapter()->getBaseActiveControl()->getClientSide();
        }
 
-       public function setActionClass($param) {
-               $this->actionClass = $param;
+       public function raiseCallbackEvent($param)
+       {
+               $this->raisePostBackEvent($param);
+               $this->onCallback($param);
        }
 
-       public function save($sender, $param) {
-               $this->actionClass->save($sender, $param);
+       public function onCallback($param)
+       {
+               $this->raiseEvent('OnCallback', $this, $param);
        }
 
-       public function setCommandName($param) {
-               $this->commandName = $param;
+       public function setText($value)
+       {
+               parent::setText($value);
+               if($this->getActiveControl()->canUpdateClientSide())
+                       $this->getPage()->getCallbackClient()->setAttribute($this, 'value', $value);
        }
 
-       public function setText($param) {
-               $this->text = $param;
+       protected function renderClientControlScript($writer)
+       {
+               $this->CssClass = "bbutton";
        }
 
-       public function setCausesValidation($param) {
-               $this->causesValidation = $param;
+       protected function addAttributesToRender($writer)
+       {
+               parent::addAttributesToRender($writer);
+               $writer->addAttribute('id',$this->getClientID());
+               $this->getActiveControl()->registerCallbackClientScript(
+                       $this->getClientClassName(), $this->getPostBackOptions());
        }
 
-       public function setValidationGroup($param) {
-               $this->validationGroup = $param;
+       protected function getClientClassName()
+       {
+               return 'Prado.WebUI.TActiveButton';
        }
+
+       public function setActionClass($param) {
+       }
+
+
 }
 
-?>
\ No newline at end of file
+?>