3 * Bacula(R) - The Network Backup Solution
4 * Baculum - Bacula web interface
6 * Copyright (C) 2013-2017 Kern Sibbald
8 * The main author of Baculum is Marcin Haba.
9 * The original author of Bacula is Kern Sibbald, with contributions
10 * from many 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 * This notice must be preserved when any source code is
18 * conveyed and/or propagated.
20 * Bacula(R) is a registered trademark of Kern Sibbald.
24 Prado::using('System.Web.Ui.ActiveControls.TActiveRepeater');
25 Prado::using('Application.Web.Portlets.DirectiveListTemplate');
26 Prado::using('Application.Web.Portlets.DirectiveBoolean');
28 class MessageTypes extends DirectiveListTemplate {
30 public function loadConfig() {
31 $this->RepeaterMessageTypes->dataSource = $this->getData();
32 $this->RepeaterMessageTypes->dataBind();
35 public function getDirectiveValues() {
36 $type_controls = $this->RepeaterMessageTypes->findControlsByType('DirectiveBoolean');
39 for ($i = 0; $i < count($type_controls); $i++) {
40 $directive_name = $type_controls[$i]->getDirectiveName();
41 $directive_value = $type_controls[$i]->getDirectiveValue();
42 if (is_null($directive_value) || $directive_value === false) {
45 if ($directive_name === 'All' && $directive_value === true) {
48 $neg = $directive_name != 'All' && $directive_value === true && $is_all === true ? '!' : '';
49 array_push($types, "{$neg}{$directive_name}");
54 public function createTypeListElement($sender, $param) {
55 $control = $this->getChildControl($param->Item, 'DirectiveBoolean');
56 if (is_object($control)) {
57 $control->setHost($param->Item->DataItem['host']);
58 $control->setComponentType($param->Item->DataItem['component_type']);
59 $control->setComponentName($param->Item->DataItem['component_name']);
60 $control->setResourceType($param->Item->DataItem['resource_type']);
61 $control->setResourceName($param->Item->DataItem['resource_name']);
62 $control->setDirectiveName($param->Item->DataItem['directive_name']);
63 $control->setDirectiveValue($param->Item->DataItem['directive_value']);
64 $control->setDefaultValue($param->Item->DataItem['default_value']);
65 $control->setRequired($param->Item->DataItem['required']);
66 $control->setLabel($param->Item->DataItem['label']);
67 $control->setData($param->Item->DataItem['directive_value']);
68 $control->setInConfig($param->Item->DataItem['in_config']);
69 $control->setShow($param->Item->DataItem['show']);
70 $control->setParentName($param->Item->DataItem['parent_name']);