@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | */ |
60 | 60 | private function search_nodes(array $node, midcom_helper_nav $nap, string $prefix) |
61 | 61 | { |
62 | - if ( !array_key_exists($node[MIDCOM_NAV_COMPONENT], $this->_request_data['components']) |
|
62 | + if (!array_key_exists($node[MIDCOM_NAV_COMPONENT], $this->_request_data['components']) |
|
63 | 63 | && $node[MIDCOM_NAV_COMPONENT] != 'midcom.helper.search') { |
64 | 64 | $l10n = $this->_i18n->get_l10n($node[MIDCOM_NAV_COMPONENT]); |
65 | 65 | $this->_request_data['components'][$node[MIDCOM_NAV_COMPONENT]] = $l10n->get($node[MIDCOM_NAV_COMPONENT]); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | } |
107 | 107 | $this->prepare_formdata($type, $request); |
108 | 108 | |
109 | - if ( count(explode(' ', $data['query'])) == 1 |
|
109 | + if (count(explode(' ', $data['query'])) == 1 |
|
110 | 110 | && !str_contains($data['query'], '*') |
111 | 111 | && $this->_config->get('single_term_auto_wildcard')) { |
112 | 112 | //If there is only one search term append * to the query if auto_wildcard is enabled |
@@ -44,7 +44,8 @@ |
||
44 | 44 | { |
45 | 45 | try { |
46 | 46 | $this->cache->invalidate_all(); |
47 | - } catch (\Throwable $e) { |
|
47 | + } |
|
48 | + catch (\Throwable $e) { |
|
48 | 49 | $output->writeln($e->getMessage()); |
49 | 50 | } |
50 | 51 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | $this->object = $this->load_object($guid); |
48 | 48 | |
49 | - if ( !midcom::get()->config->get('midcom_services_rcs_enable') |
|
49 | + if (!midcom::get()->config->get('midcom_services_rcs_enable') |
|
50 | 50 | || !$this->object->_use_rcs) { |
51 | 51 | throw new midcom_error_notfound("Revision control not supported for " . get_class($this->object) . "."); |
52 | 52 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | throw new midcom_error_notfound("Revision {$args[1]} does not exist."); |
258 | 258 | } |
259 | 259 | |
260 | - $data['preview'] = array_filter($this->backend->get_revision($revision), function ($value, $key) { |
|
260 | + $data['preview'] = array_filter($this->backend->get_revision($revision), function($value, $key) { |
|
261 | 261 | return !is_array($value) |
262 | 262 | && !in_array($value, ['', '0000-00-00']) |
263 | 263 | && midcom_services_rcs::is_field_showable($key); |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | $this->object->require_do('midgard:update'); |
288 | 288 | // TODO: set another privilege for restoring? |
289 | 289 | |
290 | - if ( $this->backend->get_history()->version_exists($args[1]) |
|
290 | + if ($this->backend->get_history()->version_exists($args[1]) |
|
291 | 291 | && $this->backend->restore_to_revision($args[1])) { |
292 | 292 | midcom::get()->uimessages->add($this->_l10n->get('midcom.admin.rcs'), sprintf($this->_l10n->get('restore to version %s successful'), $args[1])); |
293 | 293 | return new midcom_response_relocate($this->get_object_url()); |
@@ -62,7 +62,7 @@ |
||
62 | 62 | 'purge' => true |
63 | 63 | ] |
64 | 64 | ]); |
65 | - if ( midcom::get()->config->get('midcom_services_rcs_enable') |
|
65 | + if (midcom::get()->config->get('midcom_services_rcs_enable') |
|
66 | 66 | && $object->can_do('midgard:update') |
67 | 67 | && $object->_use_rcs) { |
68 | 68 | $this->_request_data['asgard_toolbar']->add_item([ |
@@ -29,7 +29,7 @@ |
||
29 | 29 | return parent::load_object($guid); |
30 | 30 | } catch (midcom_error_midgard $e) { |
31 | 31 | $mgd_exception = $e->getPrevious(); |
32 | - if ( $mgd_exception |
|
32 | + if ($mgd_exception |
|
33 | 33 | && $mgd_exception->getCode() == mgd_exception::OBJECT_DELETED) { |
34 | 34 | return $this->load_deleted($guid); |
35 | 35 | } |
@@ -27,7 +27,8 @@ |
||
27 | 27 | { |
28 | 28 | try { |
29 | 29 | return parent::load_object($guid); |
30 | - } catch (midcom_error_midgard $e) { |
|
30 | + } |
|
31 | + catch (midcom_error_midgard $e) { |
|
31 | 32 | $mgd_exception = $e->getPrevious(); |
32 | 33 | if ( $mgd_exception |
33 | 34 | && $mgd_exception->getCode() == mgd_exception::OBJECT_DELETED) { |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | $classes = []; |
203 | 203 | |
204 | 204 | if ($item[MIDCOM_NAV_TYPE] === 'node') { |
205 | - if ( $item[MIDCOM_NAV_ID] === $this->_nap->get_current_node() |
|
206 | - && ( !$this->_nap->get_current_leaf() |
|
205 | + if ($item[MIDCOM_NAV_ID] === $this->_nap->get_current_node() |
|
206 | + && (!$this->_nap->get_current_leaf() |
|
207 | 207 | || !$this->_nap->get_leaf($this->_nap->get_current_leaf()))) { |
208 | 208 | $classes[] = $this->css_active; |
209 | 209 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | } |
234 | 234 | |
235 | 235 | // Add information about the object's status |
236 | - if ( $this->object_status_to_class |
|
236 | + if ($this->object_status_to_class |
|
237 | 237 | && isset($item[MIDCOM_NAV_OBJECT]) |
238 | 238 | && $css_status_class = midcom::get()->metadata->get_object_classes($item[MIDCOM_NAV_OBJECT])) { |
239 | 239 | $classes[] = $css_status_class; |
@@ -253,11 +253,11 @@ discard block |
||
253 | 253 | echo "<a href=\"{$item[MIDCOM_NAV_ABSOLUTEURL]}\"{$link_class}>" . htmlspecialchars($item[MIDCOM_NAV_NAME]) . "</a>"; |
254 | 254 | // If either of the follow nodes switches is on, follow all the nodes |
255 | 255 | |
256 | - if ( $item[MIDCOM_NAV_TYPE] === 'node' |
|
257 | - && ( $this->list_levels === 0 |
|
256 | + if ($item[MIDCOM_NAV_TYPE] === 'node' |
|
257 | + && ($this->list_levels === 0 |
|
258 | 258 | || $this->_level < $this->list_levels)) { |
259 | - if ( $this->follow_all |
|
260 | - || ( $this->follow_selected |
|
259 | + if ($this->follow_all |
|
260 | + || ($this->follow_selected |
|
261 | 261 | && in_array($item[MIDCOM_NAV_ID], $this->node_path, true))) { |
262 | 262 | $this->_level++; |
263 | 263 | $this->_list_child_elements($item[MIDCOM_NAV_ID]); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $localpath = $path; |
151 | 151 | $matches['latest_parent'] = $folder_tree['/']; |
152 | 152 | $missing_levels = 0; |
153 | - while ( $localpath |
|
153 | + while ($localpath |
|
154 | 154 | && $localpath != '/') { |
155 | 155 | $localpath = dirname($localpath); |
156 | 156 | $missing_levels++; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | $root_folder = $folder; |
179 | 179 | $max = 100; |
180 | - while ( $folder[MIDCOM_NAV_COMPONENT] == 'net.nemein.wiki' |
|
180 | + while ($folder[MIDCOM_NAV_COMPONENT] == 'net.nemein.wiki' |
|
181 | 181 | && (($parent = $folder[MIDCOM_NAV_NODEID]) != -1) |
182 | 182 | && $max > 0) { |
183 | 183 | $root_folder = $folder; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // Get parent from DB and compare to catch moves |
55 | 55 | if ($parent = $napobject[MIDCOM_NAV_OBJECT]->get_parent()) { |
56 | 56 | $parent_entry = $this->get_guid($parent->guid); |
57 | - if ( $parent_entry |
|
57 | + if ($parent_entry |
|
58 | 58 | && $parent_entry[MIDCOM_NAV_ID] != $cached_node_id) { |
59 | 59 | $this->backend->deleteItem($parent_entry[MIDCOM_NAV_ID] . '-leaves'); |
60 | 60 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $parent_id = $napobject[MIDCOM_NAV_NODEID]; |
70 | 70 | $parent_entry = $this->get_node($parent_id); |
71 | 71 | |
72 | - if ( $parent_entry |
|
72 | + if ($parent_entry |
|
73 | 73 | && array_key_exists(MIDCOM_NAV_SUBNODES, $parent_entry)) { |
74 | 74 | unset($parent_entry[MIDCOM_NAV_SUBNODES]); |
75 | 75 | $this->put_node($parent_id, $parent_entry); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | if ($parent = $napobject[MIDCOM_NAV_OBJECT]->get_parent()) { |
80 | 80 | $parent_entry_from_object = $this->get_guid($parent->guid); |
81 | 81 | |
82 | - if ( !empty($parent_entry_from_object[MIDCOM_NAV_ID]) |
|
82 | + if (!empty($parent_entry_from_object[MIDCOM_NAV_ID]) |
|
83 | 83 | && !empty($parent_entry[MIDCOM_NAV_ID]) |
84 | 84 | && $parent_entry_from_object[MIDCOM_NAV_ID] != $parent_entry[MIDCOM_NAV_ID]) { |
85 | 85 | unset($parent_entry_from_object[MIDCOM_NAV_SUBNODES]); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | if ($object instanceof midcom_db_topic) { |
104 | 104 | return $nav->get_node($object->id); |
105 | 105 | } |
106 | - if ( ($node = $nav->find_closest_topic($object)) |
|
106 | + if (($node = $nav->find_closest_topic($object)) |
|
107 | 107 | && $nodeobject = $nav->get_node($node->id)) { |
108 | 108 | return $nav->get_leaf($nodeobject[MIDCOM_NAV_ID] . '-' . $object->id); |
109 | 109 | } |
@@ -107,7 +107,8 @@ |
||
107 | 107 | && $nodeobject = $nav->get_node($node->id)) { |
108 | 108 | return $nav->get_leaf($nodeobject[MIDCOM_NAV_ID] . '-' . $object->id); |
109 | 109 | } |
110 | - } catch (midcom_error $e) { |
|
110 | + } |
|
111 | + catch (midcom_error $e) { |
|
111 | 112 | $e->log(); |
112 | 113 | } |
113 | 114 | return null; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <div class="content-with-sidebar"> |
2 | 2 | <div class="main"> |
3 | 3 | <?php |
4 | - $data['view']->display_view(true); |
|
4 | + $data['view']->display_view(true); |
|
5 | 5 | $prefix = midcom_core_context::get()->get_key(MIDCOM_CONTEXT_ANCHORPREFIX); |
6 | 6 | midcom::get()->dynamic_load($prefix . 'members/' . $data['group']->guid . '/'); |
7 | 7 | ?> |