-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettings.php
227 lines (203 loc) · 5.35 KB
/
Settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<?php
namespace TheBooking;
defined('ABSPATH') || exit;
final class Settings extends \VSHM_Framework\Settings
{
/**
* @var string
*/
protected static $tag = 'tbk_settings';
/**
* @param null|bool $bool
*
* @return bool
*/
public function load_calendar_at_closest_slot($bool = NULL)
{
return $this->_option_bool($this->options['load_calendar_at_closest_slot'], $bool);
}
/**
* @param null|int $days
*
* @return int
*/
public function frontend_days_in_week($days = NULL)
{
return $this->_option_int($this->options['frontend_days_in_week'], $days);
}
/**
* @param string $hex
*
* @return string
*/
public function frontend_primary_color($hex = NULL)
{
return $this->_option_string($this->options['frontend_primary_color'], $hex);
}
/**
* @param string $hex
*
* @return string
*/
public function frontend_secondary_color($hex = NULL)
{
return $this->_option_string($this->options['frontend_secondary_color'], $hex);
}
/**
* @param string $hex
*
* @return string
*/
public function frontend_background_color($hex = NULL)
{
return $this->_option_string($this->options['frontend_background_color'], $hex);
}
/**
* @param string $hex
*
* @return string
*/
public function frontend_available_color($hex = NULL)
{
return $this->_option_string($this->options['frontend_available_color'], $hex);
}
/**
* @param string $hex
*
* @return string
*/
public function frontend_booked_color($hex = NULL)
{
return $this->_option_string($this->options['frontend_booked_color'], $hex);
}
/**
* @param null|bool $bool
*
* @return bool
*/
public function load_gmaps_library($bool = NULL)
{
return $this->_option_bool($this->options['load_gmaps_library'], $bool);
}
/**
* @param null|string $key
*
* @return string
*/
public function gmaps_api_key($key = NULL)
{
return $this->_option_string($this->options['gmaps_api_key'], $key);
}
/**
* @param null|string $url
*
* @return string
*/
public function login_url($url = NULL)
{
$url = $this->_option_string($this->options['login_url'], $url);
if (!$url) {
return wp_login_url();
}
return $url;
}
/**
* @param null|string $url
*
* @return string
*/
public function registration_url($url = NULL)
{
$url = $this->_option_string($this->options['registration_url'], $url);
if (!$url) {
return wp_registration_url();
}
return $url;
}
/**
* @param null|int $page_id
*
* @return int
*/
public function order_status_page($page_id = NULL)
{
return $this->_option_int($this->options['order_status_page'], $page_id);
}
/**
* @param null|bool $bool
*
* @return bool
*/
public function retain_plugin_data($bool = NULL)
{
return $this->_option_bool($this->options['retain_plugin_data'], $bool);
}
/**
* @param null|int $page_id
*
* @return int
*/
public function reservation_records_lifecycle($page_id = NULL)
{
return $this->_option_int($this->options['reservation_records_lifecycle'], $page_id);
}
/**
* @param null|bool $bool
*
* @return bool
*/
public function cart_is_active($bool = NULL)
{
return $this->_option_bool($this->options['cart_is_active'], $bool);
}
/**
* @param null|bool $bool
*
* @return bool
*/
public function show_cart_in_menu($bool = NULL)
{
return $this->_option_bool($this->options['show_cart_in_menu'], $bool);
}
/**
* @param null|bool $bool
*
* @return bool
*/
public function show_cart_in_widget($bool = NULL)
{
return $this->_option_bool($this->options['show_cart_in_widget'], $bool);
}
/**
* @param null|int $seconds
*
* @return int
*/
public function cart_expiration_time($seconds = NULL)
{
return $this->_option_int($this->options['cart_expiration_time'], $seconds);
}
public static function _defaults()
{
return [
'load_calendar_at_closest_slot' => FALSE,
'frontend_days_in_week' => 7,
'load_gmaps_library' => TRUE,
'frontend_primary_color' => '#0693E3',
'frontend_secondary_color' => '#FCB900',
'frontend_background_color' => '#FAFAFA',
'frontend_available_color' => '#4CAF50',
'frontend_booked_color' => '#E85952',
'gmaps_api_key' => NULL,
'login_url' => '',
'registration_url' => '',
'order_status_page' => 0,
'retain_plugin_data' => FALSE,
'reservation_records_lifecycle' => 0,
'cart_is_active' => FALSE,
'show_cart_in_menu' => TRUE,
'show_cart_in_widget' => TRUE,
'cart_expiration_time' => MINUTE_IN_SECONDS * 15
];
}
}