require_once('./protected/Pages/Requirements.php');
new Requirements(__DIR__);
require_once('./framework/prado.php');
+
$application=new TApplication;
+Prado::using('Application.Portlets.BButton');
+Prado::using('Application.Portlets.BActiveButton');
$application->run();
?>
* Bacula® 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 onCallback($param)
+ {
+ $this->raiseEvent('OnCallback', $this, $param);
}
- public function save($sender, $param) {
- $this->actionClass->save($sender, $param);
+ public function setText($value)
+ {
+ parent::setText($value);
+ if($this->getActiveControl()->canUpdateClientSide())
+ $this->getPage()->getCallbackClient()->setAttribute($this, 'value', $value);
}
- public function setCommandName($param) {
- $this->commandName = $param;
+ protected function renderClientControlScript($writer)
+ {
+ $this->CssClass = "bbutton";
}
- public function setText($param) {
- $this->text = $param;
+ protected function addAttributesToRender($writer)
+ {
+ parent::addAttributesToRender($writer);
+ $writer->addAttribute('id',$this->getClientID());
+ $this->getActiveControl()->registerCallbackClientScript(
+ $this->getClientClassName(), $this->getPostBackOptions());
}
- public function setCausesValidation($param) {
- $this->causesValidation = $param;
+ protected function getClientClassName()
+ {
+ return 'Prado.WebUI.TActiveButton';
}
- public function setValidationGroup($param) {
- $this->validationGroup = $param;
+ public function setActionClass($param) {
}
+
+
}
-?>
\ No newline at end of file
+?>
+++ /dev/null
-<span class="bbutton">
- <com:TActiveButton CssClass="button-left" OnCallback="save" Text=" " ValidationGroup="<%=$this->validationGroup%>" CausesValidation="<%=$this->causesValidation%>" ClientSide.OnComplete="ConfigurationWindow<%=@$this->actionClass->getMaster()->ClientID%>.progress(false);<%=@$this->actionClass->getMaster()->ClientID%>reloadWindow();" /><com:TActiveButton ID="ApplyChanges" CssClass="button-center" OnCallback="save" Text="<%=$this->text%>" ValidationGroup="<%=$this->validationGroup%>" CausesValidation="<%=$this->causesValidation%>" ClientSide.OnComplete="ConfigurationWindow<%=@$this->actionClass->getMaster()->ClientID%>.progress(false);<%=@$this->actionClass->getMaster()->ClientID%>reloadWindow();" /><com:TActiveButton CssClass="button-right" OnCallback="save" Text=" " ValidationGroup="<%=$this->validationGroup%>" CausesValidation="<%=$this->causesValidation%>" ClientSide.OnComplete="ConfigurationWindow<%=@$this->actionClass->getMaster()->ClientID%>.progress(false);<%=@$this->actionClass->getMaster()->ClientID%>reloadWindow();" />
-</span>
\ No newline at end of file
Prado::using('Application.Portlets.Portlets');
-class BButton extends Portlets{
+class BButton extends TButton {
- public $commandName, $text;
- public $causesValidation = true;
- public $Visible = true;
-
- public function onInit($param) {
- parent::onInit($param);
- }
-
- public function setCommandName($param) {
- $this->commandName = $param;
- }
-
- public function setText($param) {
- $this->text = $param;
- }
-
- public function setCausesValidation($param) {
- $this->causesValidation = $param;
- }
-
- public function setVisible($param) {
- $this->Visible = $param;
- }
-
- public function getVisible($checkParents = true) {
- return $this->Visible;
+ protected function renderClientControlScript($writer)
+ {
+ $this->CssClass = "bbutton";
}
}
+++ /dev/null
-<span class="bbutton" <%=$this->Visible === false ? 'style="display: none"' : ''%>>
-<com:TButton CssClass="button-left" Text=" " CommandName="<%=$this->commandName%>" CausesValidation="<%=$this->causesValidation%>" Visible="<%=$this->Visible%>" /><com:TButton CssClass="button-center" Text="<%=$this->text%>" CommandName="<%=$this->commandName%>" CausesValidation="<%=$this->causesValidation%>" Visible="<%=$this->Visible%>" /><com:TButton CssClass="button-right" Text=" " CommandName="<%=$this->commandName%>" CausesValidation="<%=$this->causesValidation%>" Visible="<%=$this->Visible%>" />
-</span>
\ No newline at end of file
}
input[type=checkbox] {
- margin: 6px;
+ height: 16px;
+ width: 16px;
}
input.textbox, select.textbox {
color: #96c600 !important;
}
-.bbutton input.button-left, .bbutton input.button-center, .bbutton input.button-right {
+input.bbutton {
font-size: 12px;
- height: 25px;
color: black;
+ height: 25px;
cursor: pointer;
padding: 0;
- margin: 0;
+ margin: 0 8px;
border: 0;
-}
-
-.bbutton input.button-left, .bbutton input.button-right {
- width: 2px;
-}
-
-.bbutton input.button-left {
- background: transparent url('button-left.png') no-repeat left 0;
-}
-
-.bbutton input.button-center {
- padding: 0 7px;
+ padding: 0 9px;
min-width: 65px;
+ border: 0;
+ border-radius: 3px;
background: transparent url('button-center.png') repeat-x left 0;
}
-.bbutton input.button-right {
- background: transparent url('button-right.png') no-repeat left 0;
-}
-
-.bbutton:hover input.button-left {
- background: transparent url('button-left.png') no-repeat left -25px;
-}
-
-.bbutton:hover input.button-center {
+input.bbutton:hover {
+ border: 1px solid red;
+ padding: 0 8px;
background: transparent url('button-center.png') repeat-x left -25px;
}
-.bbutton:hover input.button-right {
- background: transparent url('button-right.png') no-repeat left -25px;
-}
-
div.slide-window-container {
width: 400px;
height: 200px;
tr.slide-window-element td, tr.slide-window-element-alternating td {
font-style: italic;
+ word-break: break-all;
}
tr.slide-window-element:hover, tr.slide-window-element-alternating:hover {
float: none;
right: 14px;
}
-div.slide-window-toolbar {
+div.slide-window-toolbar, div.slide-window-actions {
height: 90px;
width: 240px;
z-index: 25;
div.slide-window-toolbar table input[type="text"] {
width: 123px;
}
+div.slide-window-actions {
+ width: 220px;
+ height: 110px;
+}
+
+div.slide-window-actions table {
+ width: 100%;
+ font-size: 12px;
+ padding: 10px;
+}
div.configuration-window-content {
padding: 10px 12px;;
}
img {
- vertical-align: middle;
- border: none;
+ vertical-align: middle;
+ border: none;
}
div.small {