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.
23 Prado::using('Application.Common.Class.CommonModule');
24 Prado::using('Application.Common.Class.Params');
26 class Params extends CommonModule {
28 public static $months = array(
43 public static $weeks = array(
50 public static $wdays = array(
60 public function getMonthsConfig(array $months_cfg) {
62 $month_count = count($months_cfg);
63 $months = array_keys(Params::$months);
64 if ($month_count < 12) {
65 if ($month_count > 1) {
66 $month_start = $months_cfg[0];
67 $month_end = $months_cfg[$month_count-1];
68 $month .= $months[$month_start] . '-' . $months[$month_end];
70 $month .= $months[$months_cfg[0]];
76 public function getWeeksConfig(array $weeks_cfg) {
78 $week_count = count($weeks_cfg);
79 $weeks = array_keys(Params::$weeks);
80 if ($week_count < 5) {
81 if ($week_count > 1) {
82 $week_start = $weeks_cfg[0];
83 $week_end = $weeks_cfg[$week_count-1];
84 $week .= $weeks[$week_start] . '-' . $weeks[$week_end];
86 $week .= $weeks[$weeks_cfg[0]];
92 public function getWdaysConfig(array $wdays_cfg) {
94 $wday_count = count($wdays_cfg);
95 $wdays = array_keys(Params::$wdays);
96 if ($wday_count < 7) {
97 if ($wday_count > 1) {
98 $wday_start = $wdays_cfg[0];
99 $wday_end = $wdays_cfg[$wday_count-1];
100 $wday .= $wdays[$wday_start] . '-' . $wdays[$wday_end];
102 $wday .= $wdays[$wdays_cfg[0]];
109 * Get Bacula config boolean value.
111 * @param boolean $value value
112 * @return string bacula config boolean value
114 public static function getBoolValue($value) {
115 return ($value ? 'yes' : 'no');