1 | <?php |
||
12 | class cfg_handler extends cfg_fields |
||
13 | { |
||
14 | /** @var \phpbb\request\request_interface */ |
||
15 | protected $request; |
||
16 | |||
17 | /** @var \phpbb\template\template */ |
||
18 | protected $template; |
||
19 | |||
20 | /** @var \phpbb\language\language */ |
||
21 | protected $translator; |
||
22 | |||
23 | /** @var \blitze\sitemaker\services\groups */ |
||
24 | protected $groups; |
||
25 | |||
26 | /** @var string phpBB root path */ |
||
27 | protected $phpbb_root_path; |
||
28 | |||
29 | /** @var string phpEx */ |
||
30 | protected $php_ext; |
||
31 | |||
32 | /** |
||
33 | * Constructor |
||
34 | * |
||
35 | * @param \phpbb\request\request_interface $request Request object |
||
36 | * @param \phpbb\template\template $template Template object |
||
37 | * @param \phpbb\language\language $translator Language object |
||
38 | * @param \blitze\sitemaker\services\groups $groups Groups object |
||
39 | * @param string $phpbb_root_path phpBB root path |
||
40 | * @param string $php_ext phpEx |
||
41 | */ |
||
42 | 52 | public function __construct(\phpbb\request\request_interface $request, \phpbb\template\template $template, \phpbb\language\language $translator, \blitze\sitemaker\services\groups $groups, $phpbb_root_path, $php_ext) |
|
43 | { |
||
44 | 52 | parent::__construct($translator); |
|
45 | |||
46 | 52 | $this->request = $request; |
|
47 | 52 | $this->template = $template; |
|
48 | 52 | $this->translator = $translator; |
|
49 | 52 | $this->groups = $groups; |
|
50 | 52 | $this->phpbb_root_path = $phpbb_root_path; |
|
51 | 52 | $this->php_ext = $php_ext; |
|
52 | 52 | } |
|
53 | |||
54 | /** |
||
55 | * @param array $block_data |
||
56 | * @param array $default_settings |
||
57 | * @return string |
||
58 | */ |
||
59 | 8 | public function get_edit_form(array $block_data, array $default_settings) |
|
76 | |||
77 | /** |
||
78 | * @param array $default_settings |
||
79 | * @return array|void |
||
80 | */ |
||
81 | 6 | public function get_submitted_settings(array $default_settings) |
|
104 | |||
105 | /** |
||
106 | * Get the html form |
||
107 | * |
||
108 | * @param array $block_data |
||
109 | * @return string |
||
110 | */ |
||
111 | 8 | private function get_form(array $block_data) |
|
130 | |||
131 | /** |
||
132 | * Generate block configuration fields |
||
133 | * |
||
134 | * @param array $db_settings |
||
135 | * @param array $default_settings |
||
136 | */ |
||
137 | 8 | private function generate_config_fields(array &$db_settings, array $default_settings) |
|
159 | |||
160 | /** |
||
161 | * Get the field html |
||
162 | * |
||
163 | * @param string $field |
||
164 | * @param array $db_settings |
||
165 | * @param array $vars |
||
166 | * @return string |
||
167 | */ |
||
168 | 7 | private function get_field_template($field, array &$db_settings, array &$vars) |
|
184 | |||
185 | /** |
||
186 | * Set field legend |
||
187 | * |
||
188 | * @param string $field |
||
189 | * @param string|array $vars |
||
190 | * @return boolean |
||
191 | */ |
||
192 | 7 | private function set_legend($field, $vars) |
|
206 | |||
207 | /** |
||
208 | * Get field details |
||
209 | * |
||
210 | * @param array $vars |
||
211 | * @return mixed|string |
||
212 | */ |
||
213 | 7 | private function explain_field(array $vars) |
|
223 | |||
224 | /** |
||
225 | * Add text after field |
||
226 | * |
||
227 | * @param array $vars |
||
228 | * @return mixed|string |
||
229 | */ |
||
230 | 7 | private function append_field(array $vars) |
|
240 | |||
241 | /** |
||
242 | * Set field parameters |
||
243 | * |
||
244 | * @param string $field |
||
245 | * @param array $vars |
||
246 | * @param array $settings |
||
247 | */ |
||
248 | 7 | private function set_params($field, array &$vars, array $settings) |
|
256 | |||
257 | /** |
||
258 | * Get field value |
||
259 | * |
||
260 | * @param string $field |
||
261 | * @param mixed $default |
||
262 | * @param array $db_settings |
||
263 | * @return mixed |
||
264 | */ |
||
265 | 7 | private function get_field_value($field, $default, array $db_settings) |
|
269 | |||
270 | /** |
||
271 | * @param array $vars |
||
272 | * @param array $type |
||
273 | * @param string $field |
||
274 | */ |
||
275 | 1 | private function prep_select_field_for_display(array &$vars, array &$type, $field) |
|
281 | |||
282 | /** |
||
283 | * @param array $vars |
||
284 | * @param array $type |
||
285 | * @param string $field |
||
286 | */ |
||
287 | 2 | private function prep_checkbox_field_for_display(array &$vars, array &$type, $field) |
|
293 | |||
294 | /** |
||
295 | * @param array $vars |
||
296 | * @param array $type |
||
297 | * @param string $field |
||
298 | */ |
||
299 | 2 | private function prep_radio_field_for_display(array &$vars, array &$type, $field) |
|
308 | |||
309 | /** |
||
310 | * @param array $vars |
||
311 | * @param array $type |
||
312 | * @param string $field |
||
313 | */ |
||
314 | 1 | private function prep_multi_select_field_for_display(array &$vars, array &$type, $field) |
|
320 | |||
321 | /** |
||
322 | * @param array $vars |
||
323 | * @param array $type |
||
324 | */ |
||
325 | 1 | private function prep_hidden_field_for_display(array &$vars, array &$type) |
|
332 | |||
333 | /** |
||
334 | * @param array $vars |
||
335 | * @param array $type |
||
336 | */ |
||
337 | 1 | private function prep_custom_field_for_display(array &$vars, array &$type) |
|
342 | |||
343 | /** |
||
344 | * @param array $cfg_array |
||
345 | * @param array $df_settings |
||
346 | */ |
||
347 | 5 | private function get_multi_select(array &$cfg_array, array $df_settings) |
|
357 | } |
||
358 |