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 | 48 | 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) |
|
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 | * @param $field |
||
162 | * @param array $db_settings |
||
163 | * @param array $vars |
||
164 | * @return string |
||
165 | */ |
||
166 | 7 | private function _get_field_template($field, array &$db_settings, array &$vars) |
|
182 | |||
183 | /** |
||
184 | * @param string $field |
||
185 | * @param string|array $vars |
||
186 | * @return boolean |
||
187 | */ |
||
188 | 7 | private function _sets_legend($field, $vars) |
|
202 | |||
203 | /** |
||
204 | * @param array $vars |
||
205 | * @return mixed|string |
||
206 | */ |
||
207 | 7 | private function _explain_field(array $vars) |
|
217 | |||
218 | /** |
||
219 | * @param array $vars |
||
220 | * @return mixed|string |
||
221 | */ |
||
222 | 7 | private function _append_field(array $vars) |
|
232 | |||
233 | /** |
||
234 | * @param string $field |
||
235 | * @param array $vars |
||
236 | * @param array $settings |
||
237 | */ |
||
238 | 7 | private function _set_params($field, array &$vars, array $settings) |
|
239 | { |
||
240 | 7 | if (isset($vars['options'])) |
|
241 | 7 | { |
|
242 | 4 | $vars['params'][] = $vars['options']; |
|
243 | 4 | $vars['params'][] = $settings[$field]; |
|
244 | 4 | } |
|
245 | 7 | } |
|
246 | |||
247 | /** |
||
248 | * @param string $field |
||
249 | * @param mixed $default |
||
250 | * @param array $db_settings |
||
251 | * @return mixed |
||
252 | */ |
||
253 | 7 | private function _get_field_value($field, $default, array $db_settings) |
|
257 | |||
258 | /** |
||
259 | * @param array $vars |
||
260 | */ |
||
261 | 1 | private function _prep_select_field_for_display(array &$vars) |
|
267 | |||
268 | /** |
||
269 | * @param array $vars |
||
270 | * @param array $type |
||
271 | * @param string $field |
||
272 | */ |
||
273 | 2 | private function _prep_checkbox_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_radio_field_for_display(array &$vars, array &$type, $field) |
|
298 | |||
299 | /** |
||
300 | * @param array $vars |
||
301 | * @param array $type |
||
302 | * @param string $field |
||
303 | */ |
||
304 | 1 | private function _prep_multi_select_field_for_display(array &$vars, array &$type, $field) |
|
310 | |||
311 | /** |
||
312 | * @param array $vars |
||
313 | * @param array $type |
||
314 | */ |
||
315 | 1 | private function _prep_hidden_field_for_display(array &$vars, array &$type) |
|
322 | |||
323 | /** |
||
324 | * @param array $vars |
||
325 | * @param array $type |
||
326 | */ |
||
327 | 1 | private function _prep_custom_field_for_display(array &$vars, array &$type) |
|
332 | |||
333 | /** |
||
334 | * this looks bad but its the only way without modifying phpbb code |
||
335 | * this is for select items that do not need to be translated |
||
336 | * @param array $options |
||
337 | */ |
||
338 | 4 | private function _add_lang_vars(array $options) |
|
348 | |||
349 | /** |
||
350 | * @param array $cfg_array |
||
351 | * @param array $df_settings |
||
352 | */ |
||
353 | 5 | private function _get_multi_select(array &$cfg_array, array $df_settings) |
|
363 | } |
||
364 |