@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | |
362 | 362 | $label_prop = $this->get_label_property(); |
363 | 363 | |
364 | - if ( is_string($label_prop) |
|
364 | + if (is_string($label_prop) |
|
365 | 365 | && $label_prop != 'guid' |
366 | 366 | && $this->_mgd_reflector->property_exists($label_prop)) { |
367 | 367 | $search_properties[$label_prop] = true; |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | continue; |
423 | 423 | } |
424 | 424 | |
425 | - if ( !$ref->is_link($property) |
|
425 | + if (!$ref->is_link($property) |
|
426 | 426 | && $ref->get_midgard_type($property) != MGD_TYPE_GUID) { |
427 | 427 | continue; |
428 | 428 | } |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | throw new midcom_error("config->get('class_extends') did not return array, invalid configuration ??"); |
486 | 486 | } |
487 | 487 | } |
488 | - if ( isset($extends[$schema_type]) |
|
488 | + if (isset($extends[$schema_type]) |
|
489 | 489 | && class_exists($extends[$schema_type])) { |
490 | 490 | return $extends[$schema_type]; |
491 | 491 | } |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | $exceptions = $this->_config->get($type . '_exceptions'); |
560 | 560 | foreach ($exceptions as $class => $property) { |
561 | 561 | if (midcom::get()->dbfactory->is_a($object, $class)) { |
562 | - if ( $property !== false |
|
562 | + if ($property !== false |
|
563 | 563 | && !$this->_mgd_reflector->property_exists($property)) { |
564 | 564 | debug_add("Matched class '{$key}' to '{$class}' via is_a but property '{$property}' does not exist", MIDCOM_LOG_ERROR); |
565 | 565 | } else { |
@@ -91,7 +91,7 @@ |
||
91 | 91 | midcom::get()->head->set_pagetitle($this->_request_data['page_title']); |
92 | 92 | |
93 | 93 | // Activate correct leaf |
94 | - if ( $this->_config->get('show_navigation_pseudo_leaves') |
|
94 | + if ($this->_config->get('show_navigation_pseudo_leaves') |
|
95 | 95 | && in_array($this->category, $this->_request_data['categories'])) { |
96 | 96 | $this->set_active_leaf($this->_topic->id . '_CAT_' . $this->category); |
97 | 97 | } |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | $year_data = []; |
132 | 132 | $first_post = $this->_compute_welcome_first_post(); |
133 | 133 | $this->_request_data['first_post'] = $first_post; |
134 | - $this->_request_data['total_count'] =& $total_count; |
|
135 | - $this->_request_data['year_data'] =& $year_data; |
|
134 | + $this->_request_data['total_count'] = & $total_count; |
|
135 | + $this->_request_data['year_data'] = & $year_data; |
|
136 | 136 | if (!$first_post) { |
137 | 137 | return; |
138 | 138 | } |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | switch ($handler_id) { |
264 | 264 | case 'archive-year-category': |
265 | 265 | $category = trim(strip_tags($args[1])); |
266 | - if ( $data['datamanager']->get_schema('default')->has_field('categories') |
|
266 | + if ($data['datamanager']->get_schema('default')->has_field('categories') |
|
267 | 267 | && !$data['datamanager']->get_schema('default')->get_field('categories')['type_config']['allow_multiple']) { |
268 | 268 | $qb->add_constraint('extra1', '=', (string) $category); |
269 | 269 | } else { |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | throw new midcom_error_notfound("The year '{$year}' is not a valid year identifier."); |
353 | 353 | } |
354 | 354 | |
355 | - if ( $month < 1 |
|
355 | + if ($month < 1 |
|
356 | 356 | || $month > 12) { |
357 | 357 | throw new midcom_error_notfound("The year {$month} is not a valid year identifier."); |
358 | 358 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | $published = sprintf($data['l10n']->get('posted on %s.'), "<abbr title=\"" . strftime('%Y-%m-%dT%H:%M:%S%z', $data['article']->metadata->published) . "\">" . $published . "</abbr>"); |
13 | 13 | |
14 | 14 | if (array_key_exists('base_ajax_comments_url', $data)) { |
15 | - $published .= ' <a href="#switch_comments" onClick="showAjaxComments(this, \''.$data['article']->guid.'\'); return false;">' |
|
15 | + $published .= ' <a href="#switch_comments" onClick="showAjaxComments(this, \'' . $data['article']->guid . '\'); return false;">' |
|
16 | 16 | . sprintf($data['l10n']->get('%s comments'), net_nehmer_comments_comment::count_by_objectguid($data['article']->guid)) |
17 | 17 | . "</a>."; |
18 | 18 | } elseif ($data['config']->get('comments_enable')) { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | &(published:h); |
29 | 29 | <?php |
30 | 30 | if ($data['linked']) { |
31 | - echo $data['l10n']->get('to') ." <a href=\"{$data['node'][MIDCOM_NAV_ABSOLUTEURL]}\">{$data['node'][MIDCOM_NAV_NAME]}</a>\n"; |
|
31 | + echo $data['l10n']->get('to') . " <a href=\"{$data['node'][MIDCOM_NAV_ABSOLUTEURL]}\">{$data['node'][MIDCOM_NAV_NAME]}</a>\n"; |
|
32 | 32 | } |
33 | 33 | ?> |
34 | 34 | </p> |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | $this->_object = midcom::get()->dbfactory->get_object_by_guid($guid); |
37 | 37 | |
38 | - if ( !is_a($this->_object, midcom_db_topic::class) |
|
38 | + if (!is_a($this->_object, midcom_db_topic::class) |
|
39 | 39 | && !is_a($this->_object, midcom_db_article::class)) { |
40 | 40 | throw new midcom_error_notfound("Moving only topics and articles is supported."); |
41 | 41 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $folder = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ROOTTOPIC); |
77 | 77 | } |
78 | 78 | |
79 | - if ( is_a($this->_object, midcom_db_topic::class) |
|
79 | + if (is_a($this->_object, midcom_db_topic::class) |
|
80 | 80 | && $folder->up == $this->_object->id) { |
81 | 81 | $tree_disabled = true; |
82 | 82 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $selected = ' checked="checked"'; |
90 | 90 | } |
91 | 91 | |
92 | - if ( !is_a($this->_object, midcom_db_topic::class) |
|
92 | + if (!is_a($this->_object, midcom_db_topic::class) |
|
93 | 93 | && $folder->component !== $this->current_folder->component) { |
94 | 94 | // Non-topic objects may only be moved under folders of same component |
95 | 95 | $class = 'wrong_component'; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | private function search_nodes(array $node, midcom_helper_nav $nap, string $prefix) |
52 | 52 | { |
53 | - if ( !array_key_exists($node[MIDCOM_NAV_COMPONENT], $this->_request_data['components']) |
|
53 | + if (!array_key_exists($node[MIDCOM_NAV_COMPONENT], $this->_request_data['components']) |
|
54 | 54 | && $node[MIDCOM_NAV_COMPONENT] != 'midcom.helper.search') { |
55 | 55 | $l10n = $this->_i18n->get_l10n($node[MIDCOM_NAV_COMPONENT]); |
56 | 56 | $this->_request_data['components'][$node[MIDCOM_NAV_COMPONENT]] = $l10n->get($node[MIDCOM_NAV_COMPONENT]); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | $this->prepare_formdata($_REQUEST['type']); |
100 | 100 | |
101 | - if ( count(explode(' ', $data['query'])) == 1 |
|
101 | + if (count(explode(' ', $data['query'])) == 1 |
|
102 | 102 | && !str_contains($data['query'], '*') |
103 | 103 | && $this->_config->get('single_term_auto_wildcard')) { |
104 | 104 | //If there is only one search term append * to the query if auto_wildcard is enabled |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | // Register GUIDs for cache engine |
168 | 168 | foreach ($this->_request_data['result'] as $doc) { |
169 | - if ( !isset($doc->source) |
|
169 | + if (!isset($doc->source) |
|
170 | 170 | || !mgd_is_guid($doc->source)) { |
171 | 171 | // Non-Midgard results don't need to go through cache registration |
172 | 172 | continue; |
@@ -202,9 +202,9 @@ |
||
202 | 202 | $toc .= "\n<ol class=\"midcom_helper_toc_formatter level_{$current_list_level}\">\n"; |
203 | 203 | foreach ($headings[4] as $key => $heading) { |
204 | 204 | $anchor = 'heading-' . md5($heading); |
205 | - $tag_level =& $headings[3][$key]; |
|
206 | - $heading_code =& $headings[0][$key]; |
|
207 | - $heading_tag =& $headings[2][$key]; |
|
205 | + $tag_level = & $headings[3][$key]; |
|
206 | + $heading_code = & $headings[0][$key]; |
|
207 | + $heading_tag = & $headings[2][$key]; |
|
208 | 208 | $heading_new_code = "<a id='{$anchor}'></a>{$heading_code}"; |
209 | 209 | $content = str_replace($heading_code, $heading_new_code, $content); |
210 | 210 | if ($current_tag_level === false) { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | private function load_next() |
43 | 43 | { |
44 | - $i =& $this->_request_data['loop_i']; |
|
44 | + $i = & $this->_request_data['loop_i']; |
|
45 | 45 | while ($i < 100) { |
46 | 46 | debug_add("Loop iteration {$i}"); |
47 | 47 | $qb = new midgard_query_builder('midgard_parameter'); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | continue; |
70 | 70 | } |
71 | 71 | // Make sure we actually have enough rights to do this |
72 | - if ( !$person1->can_do('midgard:update') |
|
72 | + if (!$person1->can_do('midgard:update') |
|
73 | 73 | || !$person1->can_do('midgard:delete') |
74 | 74 | || !$person2->can_do('midgard:update') |
75 | 75 | || !$person2->can_do('midgard:delete')) { |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | continue; |
79 | 79 | } |
80 | 80 | // Extra sanity check (in case of semi-successful not-duplicate mark) |
81 | - if ( $person1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $person2->guid) |
|
81 | + if ($person1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $person2->guid) |
|
82 | 82 | || $person2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $person1->guid)) { |
83 | 83 | debug_add("It seems these two (#{$person1->id} and #{$person2->id}) have also marked as not duplicates, some cleanup might be a good thing", MIDCOM_LOG_WARN); |
84 | 84 | $i++; |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | if ($keep == 'both') { |
103 | 103 | $option1->require_do('midgard:update'); |
104 | 104 | $option2->require_do('midgard:update'); |
105 | - if ( $option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time()) |
|
105 | + if ($option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time()) |
|
106 | 106 | && $option2->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option1->guid, time())) { |
107 | 107 | // Clear the possible duplicate parameters |
108 | 108 | $option1->delete_parameter('org.openpsa.contacts.duplicates:possible_duplicate', $option2->guid); |
@@ -120,11 +120,11 @@ discard block |
||
120 | 120 | } |
121 | 121 | } else { |
122 | 122 | if ($keep == $option1->guid) { |
123 | - $person1 =& $option1; |
|
124 | - $person2 =& $option2; |
|
123 | + $person1 = & $option1; |
|
124 | + $person2 = & $option2; |
|
125 | 125 | } elseif ($keep == $option2->guid) { |
126 | - $person1 =& $option2; |
|
127 | - $person2 =& $option1; |
|
126 | + $person1 = & $option2; |
|
127 | + $person2 = & $option1; |
|
128 | 128 | } else { |
129 | 129 | throw new midcom_error('Something weird happened (basically we got bogus data)'); |
130 | 130 | } |
@@ -114,7 +114,7 @@ |
||
114 | 114 | { |
115 | 115 | $nap = new midcom_helper_nav(); |
116 | 116 | $node = $nap->get_node($nap->get_current_node()); |
117 | - $compose_url = $node[MIDCOM_NAV_RELATIVEURL] . 'message/compose/' . $data['message']->guid .'/'; |
|
117 | + $compose_url = $node[MIDCOM_NAV_RELATIVEURL] . 'message/compose/' . $data['message']->guid . '/'; |
|
118 | 118 | $this->batch_url_base_full = $node[MIDCOM_NAV_RELATIVEURL] . 'message/send_bg/' . $data['message']->guid . '/'; |
119 | 119 | debug_add("compose_url: {$compose_url}"); |
120 | 120 | debug_add("batch_url base: {$this->batch_url_base_full}"); |