@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | private function _populate_node_toolbar() |
22 | 22 | { |
23 | - if ( $this->_topic->can_do('midgard:update') |
|
23 | + if ($this->_topic->can_do('midgard:update') |
|
24 | 24 | && $this->_topic->can_do('midcom:component_config')) { |
25 | 25 | $workflow = $this->get_workflow('datamanager'); |
26 | 26 | $this->_node_toolbar->add_item($workflow->get_button('config/', [ |
@@ -20,14 +20,14 @@ |
||
20 | 20 | public function configureOptions(OptionsResolver $resolver) |
21 | 21 | { |
22 | 22 | parent::configureOptions($resolver); |
23 | - $resolver->setNormalizer('widget_config', function (Options $options, $value) { |
|
23 | + $resolver->setNormalizer('widget_config', function(Options $options, $value) { |
|
24 | 24 | $widget_defaults = [ |
25 | 25 | 'map_action_elements' => false, |
26 | 26 | 'show_title' => false |
27 | 27 | ]; |
28 | 28 | return helper::resolve_options($widget_defaults, $value); |
29 | 29 | }); |
30 | - $resolver->setNormalizer('type_config', function (Options $options, $value) { |
|
30 | + $resolver->setNormalizer('type_config', function(Options $options, $value) { |
|
31 | 31 | $type_defaults = [ |
32 | 32 | 'do_not_save_archival' => false, |
33 | 33 | 'derived_images' => [], |
@@ -409,7 +409,8 @@ |
||
409 | 409 | foreach ($this->_articles as $article_counter => $article) { |
410 | 410 | try { |
411 | 411 | $data['datamanager']->set_storage($article); |
412 | - } catch (midcom_error $e) { |
|
412 | + } |
|
413 | + catch (midcom_error $e) { |
|
413 | 414 | $e->log(); |
414 | 415 | continue; |
415 | 416 | } |
@@ -136,8 +136,8 @@ discard block |
||
136 | 136 | $year_data = []; |
137 | 137 | $first_post = $this->_compute_welcome_first_post(); |
138 | 138 | $this->_request_data['first_post'] = $first_post; |
139 | - $this->_request_data['total_count'] =& $total_count; |
|
140 | - $this->_request_data['year_data'] =& $year_data; |
|
139 | + $this->_request_data['total_count'] = & $total_count; |
|
140 | + $this->_request_data['year_data'] = & $year_data; |
|
141 | 141 | if (!$first_post) { |
142 | 142 | return; |
143 | 143 | } |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | switch ($handler_id) { |
274 | 274 | case 'archive-year-category': |
275 | 275 | $data['category'] = trim(strip_tags($args[1])); |
276 | - if ( $data['datamanager']->get_schema('default')->has_field('categories') |
|
276 | + if ($data['datamanager']->get_schema('default')->has_field('categories') |
|
277 | 277 | && !$data['datamanager']->get_schema('default')->get_field('categories')['type_config']['allow_multiple']) { |
278 | 278 | $qb->add_constraint('extra1', '=', (string) $data['category']); |
279 | 279 | } else { |
@@ -365,15 +365,15 @@ discard block |
||
365 | 365 | throw new midcom_error_notfound("The year '{$year}' is not a valid year identifier."); |
366 | 366 | } |
367 | 367 | |
368 | - if ( $month < 1 |
|
368 | + if ($month < 1 |
|
369 | 369 | || $month > 12) { |
370 | 370 | throw new midcom_error_notfound("The year {$month} is not a valid year identifier."); |
371 | 371 | } |
372 | 372 | |
373 | 373 | $now = new DateTime(); |
374 | - $this->_start = new DateTime("{$year}-" . sprintf('%02d', $month) . "-01 00:00:00"); |
|
374 | + $this->_start = new DateTime("{$year}-" . sprintf('%02d', $month) . "-01 00:00:00"); |
|
375 | 375 | if ($this->_start > $now) { |
376 | - throw new midcom_error_notfound("The month '{$year}-" . sprintf('%02d', $month) . "' is in the future, no archive available."); |
|
376 | + throw new midcom_error_notfound("The month '{$year}-" . sprintf('%02d', $month) . "' is in the future, no archive available."); |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | if ($month == 12) { |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | $endmonth = $month + 1; |
385 | 385 | } |
386 | 386 | |
387 | - $this->_end = new DateTime("{$endyear}-" . sprintf('%02d', $endmonth) . "-01 00:00:00"); |
|
387 | + $this->_end = new DateTime("{$endyear}-" . sprintf('%02d', $endmonth) . "-01 00:00:00"); |
|
388 | 388 | } |
389 | 389 | |
390 | 390 | /** |
@@ -17,7 +17,7 @@ |
||
17 | 17 | |
18 | 18 | public function form_widget_simple(FormView $view, array $data) |
19 | 19 | { |
20 | - if ( !empty($data['value']) |
|
20 | + if (!empty($data['value']) |
|
21 | 21 | || is_numeric($data['value'])) { |
22 | 22 | return $data['value']; |
23 | 23 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | case 'save': |
45 | 45 | $this->_reset_password($data['controller']->get_form_values()); |
46 | 46 | $data['processing_msg'] = $this->_l10n->get('password reset, mail sent.'); |
47 | - $data['processing_msg_raw']= 'password reset, mail sent.'; |
|
47 | + $data['processing_msg_raw'] = 'password reset, mail sent.'; |
|
48 | 48 | $this->_success = true; |
49 | 49 | break; |
50 | 50 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | private function load_datamanager() |
31 | 31 | { |
32 | 32 | $dm = datamanager::from_schemadb($this->_config->get('schemadb_group')); |
33 | - $persons =& $dm->get_schema('default')->get_field('persons'); |
|
33 | + $persons = & $dm->get_schema('default')->get_field('persons'); |
|
34 | 34 | $persons['hidden'] = true; |
35 | 35 | return $dm->set_storage($this->_group); |
36 | 36 | } |
@@ -61,7 +61,8 @@ |
||
61 | 61 | { |
62 | 62 | try { |
63 | 63 | $this->_object = midcom::get()->dbfactory->get_object_by_guid($guid); |
64 | - } catch (midcom_error $e) { |
|
64 | + } |
|
65 | + catch (midcom_error $e) { |
|
65 | 66 | if (midcom_connection::get_error() == MGD_ERR_OBJECT_DELETED) { |
66 | 67 | $relocate = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX) . '__mfa/asgard/object/deleted/' . $guid . '/'; |
67 | 68 | midcom::get()->relocate($relocate); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $this->_load_schemadb(); |
124 | 124 | |
125 | 125 | // Hide the revision message |
126 | - $field =& $this->schemadb->get('object')->get_field('_rcs_message'); |
|
126 | + $field = & $this->schemadb->get('object')->get_field('_rcs_message'); |
|
127 | 127 | $field['hidden'] = true; |
128 | 128 | |
129 | 129 | $this->datamanager = new datamanager($this->schemadb); |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | } |
212 | 212 | $this->_new_object = new $create_type(); |
213 | 213 | |
214 | - if ( $handler_id == '____mfa-asgard-object_create_toplevel' |
|
214 | + if ($handler_id == '____mfa-asgard-object_create_toplevel' |
|
215 | 215 | || $handler_id == '____mfa-asgard-object_create_chooser') { |
216 | 216 | midcom::get()->auth->require_user_do('midgard:create', null, $create_type); |
217 | 217 | |
@@ -265,14 +265,14 @@ discard block |
||
265 | 265 | $parent_property = midgard_object_class::get_property_parent($this->_request_data['current_type']); |
266 | 266 | $new_type_reflector = midcom_helper_reflector::get($new_type); |
267 | 267 | $link_properties = $new_type_reflector->get_link_properties(); |
268 | - $type_to_link_to = midcom_helper_reflector::class_rewrite(get_class($this->_object)); |
|
268 | + $type_to_link_to = midcom_helper_reflector::class_rewrite(get_class($this->_object)); |
|
269 | 269 | foreach ($link_properties as $child_property => $link) { |
270 | 270 | $linked_type = midcom_helper_reflector::class_rewrite($link['class']); |
271 | - if ( midcom_helper_reflector::is_same_class($linked_type, $type_to_link_to) |
|
272 | - || ( $link['type'] == MGD_TYPE_GUID |
|
271 | + if (midcom_helper_reflector::is_same_class($linked_type, $type_to_link_to) |
|
272 | + || ($link['type'] == MGD_TYPE_GUID |
|
273 | 273 | && is_null($link['class']))) { |
274 | 274 | $defaults[$child_property] = $this->_object->{$link['target']}; |
275 | - } elseif ( $child_property == $parent_property |
|
275 | + } elseif ($child_property == $parent_property |
|
276 | 276 | && midcom_helper_reflector::is_same_class($new_type, $type_to_link_to)) { |
277 | 277 | $defaults[$child_property] = $this->_object->$parent_property; |
278 | 278 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | } |
284 | 284 | |
285 | 285 | // Allow setting defaults from query string, useful for things like "create event for today" and chooser |
286 | - if ( isset($_GET['defaults']) |
|
286 | + if (isset($_GET['defaults']) |
|
287 | 287 | && is_array($_GET['defaults'])) { |
288 | 288 | $get_defaults = array_intersect_key($_GET['defaults'], $this->schemadb->get('object')->get('fields')); |
289 | 289 | $defaults = array_merge($defaults, array_map('trim', $get_defaults)); |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | { |
302 | 302 | if ($handler_id == '____mfa-asgard-object_create_chooser') { |
303 | 303 | midcom_show_style('midgard_admin_asgard_popup_header'); |
304 | - if ( $this->_new_object->id |
|
304 | + if ($this->_new_object->id |
|
305 | 305 | || isset($data['cancelled'])) { |
306 | 306 | $data['jsdata'] = $this->_object_to_jsdata($this->_new_object); |
307 | 307 | midcom_show_style('midgard_admin_asgard_object_create_after'); |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | $url = $type; |
353 | 353 | |
354 | 354 | $class_extends = $this->_config->get('class_extends'); |
355 | - if ( is_array($class_extends) |
|
355 | + if (is_array($class_extends) |
|
356 | 356 | && array_key_exists($type, $class_extends)) { |
357 | 357 | $url = $class_extends[$type]; |
358 | 358 | } |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | |
446 | 446 | $this->_load_schemadb($target['class'], $target['parent'], true); |
447 | 447 | // Change the name for the parent field |
448 | - $field =& $this->schemadb->get('object')->get_field($target['parent']); |
|
448 | + $field = & $this->schemadb->get('object')->get_field($target['parent']); |
|
449 | 449 | $field['title'] = $this->_l10n->get('choose the target'); |
450 | 450 | |
451 | 451 | $dm = new datamanager($this->schemadb); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | |
54 | 54 | foreach ($schemadb->all() as $schema) { |
55 | 55 | if ($schema->has_field('name')) { |
56 | - $field =& $schema->get_field('name'); |
|
56 | + $field = & $schema->get_field('name'); |
|
57 | 57 | $field['required'] = ($this->_handler_id === 'edit'); |
58 | 58 | } |
59 | 59 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | public function __construct() |
31 | 31 | { |
32 | - $this->_request_data['page'] =& $this->_page; |
|
32 | + $this->_request_data['page'] = & $this->_page; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -247,9 +247,9 @@ discard block |
||
247 | 247 | $toc .= "\n<ol class=\"midcom_helper_toc_formatter level_{$current_list_level}\">\n"; |
248 | 248 | foreach ($headings[4] as $key => $heading) { |
249 | 249 | $anchor = 'heading-' . md5($heading); |
250 | - $tag_level =& $headings[3][$key]; |
|
251 | - $heading_code =& $headings[0][$key]; |
|
252 | - $heading_tag =& $headings[2][$key]; |
|
250 | + $tag_level = & $headings[3][$key]; |
|
251 | + $heading_code = & $headings[0][$key]; |
|
252 | + $heading_tag = & $headings[2][$key]; |
|
253 | 253 | $heading_new_code = "<a id='{$anchor}'></a>{$heading_code}"; |
254 | 254 | $content = str_replace($heading_code, $heading_new_code, $content); |
255 | 255 | if ($current_tag_level === false) { |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | } |
276 | 276 | } |
277 | 277 | } |
278 | - $toc .= "<li class='{$heading_tag}'><a href='#{$anchor}'>" . strip_tags($heading) . "</a>"; |
|
278 | + $toc .= "<li class='{$heading_tag}'><a href='#{$anchor}'>" . strip_tags($heading) . "</a>"; |
|
279 | 279 | } |
280 | 280 | for ($i = $current_list_level; $i > 0; $i--) { |
281 | 281 | $toc .= "</li>\n</ol>\n"; |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | |
338 | 338 | $user = midcom::get()->auth->user->get_storage(); |
339 | 339 | |
340 | - if ( array_key_exists('target', $_POST) |
|
340 | + if (array_key_exists('target', $_POST) |
|
341 | 341 | && $_POST['target'] == 'folder') { |
342 | 342 | // We're subscribing to the whole wiki |
343 | 343 | $object = $this->_topic; |