1 | <?php |
||
14 | class cfg_handler extends cfg_fields |
||
15 | { |
||
16 | /** @var \phpbb\request\request_interface */ |
||
17 | protected $request; |
||
18 | |||
19 | /** @var \phpbb\template\template */ |
||
20 | protected $template; |
||
21 | |||
22 | /** @var \phpbb\user */ |
||
23 | protected $user; |
||
24 | |||
25 | /** @var \blitze\sitemaker\services\groups */ |
||
26 | protected $groups; |
||
27 | |||
28 | /** @var string phpBB root path */ |
||
29 | protected $phpbb_root_path; |
||
30 | |||
31 | /** @var string phpEx */ |
||
32 | protected $php_ext; |
||
33 | |||
34 | /** |
||
35 | * Constructor |
||
36 | * |
||
37 | * @param \phpbb\request\request_interface $request Request object |
||
38 | * @param \phpbb\template\template $template Template object |
||
39 | * @param \phpbb\user $user User object |
||
40 | * @param \blitze\sitemaker\services\groups $groups Groups object |
||
41 | * @param string $phpbb_root_path phpBB root path |
||
42 | * @param string $php_ext phpEx |
||
43 | */ |
||
44 | 49 | public function __construct(\phpbb\request\request_interface $request, \phpbb\template\template $template, \phpbb\user $user, \blitze\sitemaker\services\groups $groups, $phpbb_root_path, $php_ext) |
|
55 | |||
56 | /** |
||
57 | * @param array $block_data |
||
58 | * @param array $default_settings |
||
59 | * @return template|string |
||
60 | */ |
||
61 | 8 | public function get_edit_form(array $block_data, array $default_settings) |
|
78 | |||
79 | /** |
||
80 | * @param array $default_settings |
||
81 | * @return array|void |
||
82 | */ |
||
83 | 6 | public function get_submitted_settings(array $default_settings) |
|
106 | |||
107 | /** |
||
108 | * Get the html form |
||
109 | * |
||
110 | * @param array $block_data |
||
111 | * @return string |
||
112 | */ |
||
113 | 8 | private function _get_form(array $block_data) |
|
132 | |||
133 | /** |
||
134 | * Generate block configuration fields |
||
135 | * |
||
136 | * @param array $db_settings |
||
137 | * @param array $default_settings |
||
138 | */ |
||
139 | 8 | private function _generate_config_fields(array &$db_settings, array $default_settings) |
|
161 | |||
162 | /** |
||
163 | * @param $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 | * @param string $field |
||
187 | * @param string|array $vars |
||
188 | * @return boolean |
||
189 | */ |
||
190 | 7 | private function _sets_legend($field, $vars) |
|
204 | |||
205 | /** |
||
206 | * @param array $vars |
||
207 | * @return mixed|string |
||
208 | */ |
||
209 | 7 | private function _explain_field(array $vars) |
|
219 | |||
220 | /** |
||
221 | * @param array $vars |
||
222 | * @return mixed|string |
||
223 | */ |
||
224 | 7 | private function _append_field(array $vars) |
|
234 | |||
235 | /** |
||
236 | * @param string $field |
||
237 | * @param array $vars |
||
238 | * @param array $settings |
||
239 | */ |
||
240 | 7 | private function _set_params($field, array &$vars, array $settings) |
|
248 | |||
249 | /** |
||
250 | * @param string $field |
||
251 | * @param mixed $default |
||
252 | * @param array $db_settings |
||
253 | * @return mixed |
||
254 | */ |
||
255 | 7 | private function _get_field_value($field, $default, array $db_settings) |
|
259 | |||
260 | /** |
||
261 | * @param array $vars |
||
262 | */ |
||
263 | 1 | private function _prep_select_field_for_display(array &$vars) |
|
269 | |||
270 | /** |
||
271 | * @param array $vars |
||
272 | * @param array $type |
||
273 | * @param string $field |
||
274 | */ |
||
275 | 2 | private function _prep_checkbox_field_for_display(array &$vars, array &$type, $field) |
|
283 | |||
284 | /** |
||
285 | * @param array $vars |
||
286 | * @param array $type |
||
287 | * @param string $field |
||
288 | */ |
||
289 | 2 | private function _prep_radio_field_for_display(array &$vars, array &$type, $field) |
|
300 | |||
301 | /** |
||
302 | * @param array $vars |
||
303 | * @param array $type |
||
304 | * @param string $field |
||
305 | */ |
||
306 | 1 | private function _prep_multi_select_field_for_display(array &$vars, array &$type, $field) |
|
312 | |||
313 | /** |
||
314 | * @param array $vars |
||
315 | * @param array $type |
||
316 | */ |
||
317 | 1 | private function _prep_hidden_field_for_display(array &$vars, array &$type) |
|
324 | |||
325 | /** |
||
326 | * @param array $vars |
||
327 | * @param array $type |
||
328 | */ |
||
329 | 1 | private function _prep_custom_field_for_display(array &$vars, array &$type) |
|
334 | |||
335 | /** |
||
336 | * this looks bad but its the only way without modifying phpbb code |
||
337 | * this is for select items that do not need to be translated |
||
338 | * @param array $options |
||
339 | */ |
||
340 | 4 | private function _add_lang_vars(array $options) |
|
350 | |||
351 | /** |
||
352 | * @param array $cfg_array |
||
353 | * @param array $df_settings |
||
354 | */ |
||
355 | 5 | private function _get_multi_select(array &$cfg_array, array $df_settings) |
|
365 | } |
||
366 |