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 string phpBB root path */ |
||
26 | protected $phpbb_root_path; |
||
27 | |||
28 | /** @var string phpEx */ |
||
29 | protected $php_ext; |
||
30 | |||
31 | /** |
||
32 | * Constructor |
||
33 | * |
||
34 | * @param \phpbb\request\request_interface $request Request object |
||
35 | * @param \phpbb\template\template $template Template object |
||
36 | * @param \phpbb\user $user User object |
||
37 | * @param \blitze\sitemaker\services\groups $groups Groups object |
||
38 | * @param string $phpbb_root_path phpBB root path |
||
39 | * @param string $php_ext phpEx |
||
40 | */ |
||
41 | 44 | 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) |
|
52 | |||
53 | /** |
||
54 | * @param array $block_data |
||
55 | * @param array $default_settings |
||
56 | * @return template|string |
||
57 | */ |
||
58 | 7 | public function get_edit_form(array $block_data, array $default_settings) |
|
89 | |||
90 | /** |
||
91 | * @param array $default_settings |
||
92 | * @return array|void |
||
93 | */ |
||
94 | 6 | public function get_submitted_settings(array $default_settings) |
|
115 | |||
116 | /** |
||
117 | * Generate block configuration fields |
||
118 | * |
||
119 | * @param array $db_settings |
||
120 | * @param array $default_settings |
||
121 | */ |
||
122 | 7 | private function _generate_config_fields(array &$db_settings, array $default_settings) |
|
144 | |||
145 | /** |
||
146 | * @param $field |
||
147 | * @param array $db_settings |
||
148 | * @param array $vars |
||
149 | * @return string |
||
150 | */ |
||
151 | 6 | private function _get_field_template($field, array &$db_settings, array &$vars) |
|
167 | |||
168 | /** |
||
169 | * @param string $field |
||
170 | * @param string|array $vars |
||
171 | * @return boolean |
||
172 | */ |
||
173 | 6 | private function _sets_legend($field, $vars) |
|
187 | |||
188 | /** |
||
189 | * @param array $vars |
||
190 | * @return mixed|string |
||
191 | */ |
||
192 | 6 | private function _explain_field(array $vars) |
|
202 | |||
203 | /** |
||
204 | * @param array $vars |
||
205 | * @return mixed|string |
||
206 | */ |
||
207 | 6 | private function _append_field(array $vars) |
|
217 | |||
218 | /** |
||
219 | * @param $field |
||
220 | * @param $vars |
||
221 | * @param $settings |
||
222 | */ |
||
223 | 5 | private function _set_params($field, &$vars, $settings) |
|
231 | |||
232 | /** |
||
233 | * @param $field |
||
234 | * @param $default |
||
235 | * @param $db_settings |
||
236 | * @return mixed |
||
237 | */ |
||
238 | 6 | private function _get_field_value($field, $default, $db_settings) |
|
242 | |||
243 | /** |
||
244 | * @param $vars |
||
245 | */ |
||
246 | 1 | private function _prep_select_field_for_display(&$vars) |
|
252 | |||
253 | /** |
||
254 | * @param $vars |
||
255 | * @param $type |
||
256 | * @param $field |
||
257 | */ |
||
258 | 2 | private function _prep_checkbox_field_for_display(&$vars, &$type, $field) |
|
266 | |||
267 | /** |
||
268 | * @param $vars |
||
269 | * @param $type |
||
270 | * @param $field |
||
271 | */ |
||
272 | 1 | private function _prep_multi_select_field_for_display(&$vars, &$type, $field) |
|
278 | |||
279 | /** |
||
280 | * @param $vars |
||
281 | * @param $type |
||
282 | */ |
||
283 | 1 | private function _prep_hidden_field_for_display(&$vars, &$type) |
|
290 | |||
291 | /** |
||
292 | * @param $vars |
||
293 | * @param $type |
||
294 | */ |
||
295 | 1 | private function _prep_custom_field_for_display(&$vars, &$type) |
|
300 | |||
301 | /** |
||
302 | * this looks bad but its the only way without modifying phpbb code |
||
303 | * this is for select items that do not need to be translated |
||
304 | * @param array $options |
||
305 | */ |
||
306 | 4 | private function _add_lang_vars(array $options) |
|
316 | |||
317 | /** |
||
318 | * @param array $cfg_array |
||
319 | * @param array $df_settings |
||
320 | */ |
||
321 | 5 | private function _get_multi_select(array &$cfg_array, array $df_settings) |
|
331 | } |
||
332 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: