Completed
Push — master ( 9af678...0b04ee )
by Andreas
22:48
created
lib/midgard/admin/asgard/navigation.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         parent::__construct();
44 44
 
45 45
         $this->_object = $object;
46
-        $this->_request_data =& $request_data;
46
+        $this->_request_data = & $request_data;
47 47
 
48 48
         $this->root_types = midcom_helper_reflector_tree::get_root_classes();
49 49
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             // we go through the path bottom up and show the first root type we find
60 60
             foreach (array_reverse($this->_object_path) as $node) {
61 61
                 foreach ($this->root_types as $root_type) {
62
-                    if (   is_a($node, $root_type)
62
+                    if (is_a($node, $root_type)
63 63
                         || midcom_helper_reflector::is_same_class($root_type, $node->__midcom_class_name__)) {
64 64
                         $this->expanded_root_types[] = $root_type;
65 65
                         break;
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
     protected function _is_collapsed($type, $total) : bool
73 73
     {
74
-        return (   $total > $this->_config->get('max_navigation_entries')
74
+        return ($total > $this->_config->get('max_navigation_entries')
75 75
                 && empty($_GET['show_all_' . $type]));
76 76
     }
77 77
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         foreach ($ref->get_child_classes() as $class) {
88 88
             $qb = $ref->_child_objects_type_qb($class, $object, false);
89 89
 
90
-            if (   !$qb
90
+            if (!$qb
91 91
                 || !($count = $qb->count_unchecked())) {
92 92
                 continue;
93 93
             }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     {
136 136
         $qb = $ref->_root_objects_qb(false);
137 137
 
138
-        if (   !$qb
138
+        if (!$qb
139 139
             || !($total = $qb->count_unchecked())) {
140 140
             return;
141 141
         }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         $label = html_entity_decode($label);
215 215
 
216 216
         echo "<a href=\"" . midcom_connection::get_url('self') . "__mfa/asgard/object/{$mode}/{$object->guid}/\" title=\"GUID: {$object->guid}, ID: {$object->id}\">{$icon}{$label}</a>\n";
217
-        if (   $selected
217
+        if ($selected
218 218
             || $autoexpand) {
219 219
             $this->_list_child_elements($object, $level + 1);
220 220
         }
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                 continue;
235 235
             }
236 236
 
237
-            if (   method_exists($class, 'navigation')
237
+            if (method_exists($class, 'navigation')
238 238
                 && ($this->_request_data['plugin_name'] == "asgard_{$component}")) {
239 239
                 $this->_request_data['expanded'] = true;
240 240
                 midcom_show_style('midgard_admin_asgard_navigation_section_header');
@@ -268,13 +268,13 @@  discard block
 block discarded – undo
268 268
         if ($this->_is_selected($object)) {
269 269
             $css_class .= ' selected';
270 270
         }
271
-        if (   is_object($this->_object)
272
-            && (   $object->guid == $this->_object->guid
273
-                || (   is_a($this->_object, midcom_db_parameter::class)
271
+        if (is_object($this->_object)
272
+            && ($object->guid == $this->_object->guid
273
+                || (is_a($this->_object, midcom_db_parameter::class)
274 274
                     && $object->guid == $this->_object->parentguid))) {
275 275
             $css_class .= ' current';
276 276
         }
277
-        if ( !$object->can_do('midgard:update')) {
277
+        if (!$object->can_do('midgard:update')) {
278 278
             $css_class .= ' readonly';
279 279
         }
280 280
         return $css_class;
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 
321 321
         // If the regular expression has been set, check which types should be shown
322 322
         if ($regexp !== '//') {
323
-            $label_mapping = array_filter($label_mapping, function ($root_type) use ($regexp, $exclude) {
323
+            $label_mapping = array_filter($label_mapping, function($root_type) use ($regexp, $exclude) {
324 324
                 return preg_match($regexp, $root_type) == $exclude;
325 325
             }, ARRAY_FILTER_USE_KEY);
326 326
         }
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
          * click if nothing is expanded
351 351
          */
352 352
         $types_shown = false;
353
-        if (    !empty($expanded_types)
353
+        if (!empty($expanded_types)
354 354
              && midgard_admin_asgard_plugin::get_preference('navigation_type') === 'dropdown') {
355 355
             $this->_draw_select_navigation();
356 356
             $types_shown = true;
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
             echo "    <li class=\"mgdschema-type\">";
390 390
 
391 391
             $dbaclass = midcom::get()->dbclassloader->get_midcom_class_name_for_mgdschema_object($type);
392
-            if (   $dbaclass
392
+            if ($dbaclass
393 393
                 && class_exists($dbaclass)) {
394 394
                 $object = new $dbaclass;
395 395
             } else {
Please login to merge, or discard this patch.