3 * Bacula® - The Network Backup Solution
4 * Baculum - Bacula web interface
6 * Copyright (C) 2013-2015 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.TActiveRepeater');
21 Prado::using('Application.Portlets.ISlideWindow');
22 Prado::using('Application.Portlets.Portlets');
24 class PoolList extends Portlets implements ISlideWindow {
30 public function setID($id) {
34 public function getID($hideAutoID = true) {
38 public function setButtonID($id) {
39 $this->buttonID = $id;
42 public function getButtonID() {
43 return $this->buttonID;
46 public function setWindowTitle($param) {
47 $this->windowTitle = $param;
50 public function getWindowTitle() {
51 return $this->windowTitle;
53 public function onLoad($param) {
54 parent::onLoad($param);
58 public function prepareData($forceReload = false) {
59 $allowedButtons = array('PoolBtn', 'ReloadPools');
60 if($this->Page->IsPostBack || $this->Page->IsCallBack || $forceReload) {
61 if(in_array($this->getPage()->CallBackEventTarget->ID, $allowedButtons) || $forceReload) {
62 $params = $this->getUrlParams('pools', $this->getPage()->PoolWindow->ID);
63 $pools = $this->Application->getModule('api')->get($params);
64 $isDetailView = $_SESSION['view' . $this->getPage()->PoolWindow->ID] == 'details';
65 if($isDetailView === true) {
66 $this->RepeaterShow->Visible = false;
67 $this->DataGridShow->Visible = true;
68 $this->DataGrid->DataSource = $this->Application->getModule('misc')->objectToArray($pools->output);
69 $this->DataGrid->dataBind();
71 $this->RepeaterShow->Visible = true;
72 $this->DataGridShow->Visible = false;
73 $this->Repeater->DataSource = $pools->output;
74 $this->Repeater->dataBind();
80 public function sortDataGrid($sender, $param) {
81 $params = $this->getUrlParams('pools', $this->getPage()->PoolWindow->ID);
82 $data = $this->Application->getModule('api')->get($params)->output;
83 $data = $this->Application->getModule('misc')->objectToArray($data);
84 $this->DataGrid->DataSource = $this->sortData($data, $param->SortExpression, $sender->UniqueID);
85 $this->DataGrid->dataBind();
88 public function setShowID($ShowID) {
89 $this->ShowID = $this->getMaster()->ShowID = $ShowID;
92 public function getShowID() {
96 public function configure($sender, $param) {
97 if($this->Page->IsCallBack) {
98 $this->getPage()->PoolConfiguration->configure($param->CallbackParameter);