<?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.TActiveRepeater');
+Prado::using('Application.Portlets.ISlideWindow');
Prado::using('Application.Portlets.Portlets');
-class PoolList extends Portlets {
+class PoolList extends Portlets implements ISlideWindow {
- public $ShowID, $windowTitle;
+ public $ID;
+ public $buttonID;
+ public $windowTitle;
- public function onLoad($param) {
- parent::onLoad($param);
- $this->prepareData();
+ public function setID($id) {
+ $this->ID = $id;
+ }
+
+ public function getID($hideAutoID = true) {
+ return $this->ID;
+ }
+
+ public function setButtonID($id) {
+ $this->buttonID = $id;
+ }
+
+ public function getButtonID() {
+ return $this->buttonID;
}
public function setWindowTitle($param) {
$this->windowTitle = $param;
}
+ public function getWindowTitle() {
+ return $this->windowTitle;
+ }
+ public function onLoad($param) {
+ parent::onLoad($param);
+ $this->prepareData();
+ }
+
public function prepareData($forceReload = false) {
$allowedButtons = array('PoolBtn', 'ReloadPools');
if($this->Page->IsPostBack || $this->Page->IsCallBack || $forceReload) {
$params = $this->getUrlParams('pools', $this->getPage()->PoolWindow->ID);
$pools = $this->Application->getModule('api')->get($params);
$isDetailView = $_SESSION['view' . $this->getPage()->PoolWindow->ID] == 'details';
- $this->RepeaterShow->Visible = !$isDetailView;
- $this->Repeater->DataSource = $isDetailView === false ? $pools->output : array();
- $this->Repeater->dataBind();
- $this->DataGridShow->Visible = $isDetailView;
- $this->DataGrid->DataSource = $isDetailView === true ? $this->Application->getModule('misc')->objectToArray($pools->output) : array();
- $this->DataGrid->dataBind();
+ if($isDetailView === true) {
+ $this->RepeaterShow->Visible = false;
+ $this->DataGridShow->Visible = true;
+ $this->DataGrid->DataSource = $this->Application->getModule('misc')->objectToArray($pools->output);
+ $this->DataGrid->dataBind();
+ } else {
+ $this->RepeaterShow->Visible = true;
+ $this->DataGridShow->Visible = false;
+ $this->Repeater->DataSource = $pools->output;
+ $this->Repeater->dataBind();
+ }
}
}
}
}
}
}
-?>
\ No newline at end of file
+?>