diff --git a/application/admin/controller/Menu.php b/application/admin/controller/Menu.php index 59757b297..4ff62855b 100644 --- a/application/admin/controller/Menu.php +++ b/application/admin/controller/Menu.php @@ -52,9 +52,7 @@ class Menu extends BasicAdmin { */ protected function _index_data_filter(&$data) { foreach ($data as &$vo) { - if ($vo['url'] !== '#') { - $vo['url'] = url($vo['url']); - } + ($vo['url'] !== '#') && ($vo['url'] = url($vo['url'])); $vo['ids'] = join(',', Tools::getArrSubIds($data, $vo['id'])); } $data = Tools::arr2table($data); diff --git a/extend/library/Tools.php b/extend/library/Tools.php index bde044749..91663a4ce 100644 --- a/extend/library/Tools.php +++ b/extend/library/Tools.php @@ -57,7 +57,7 @@ class Tools { $tree[] = $_tree; if (!empty($sub)) { $sub_array = self::arr2table($sub, $id, $pid, $path, $_tree[$path]); - $tree = array_merge($tree, (Array) $sub_array); + $tree = array_merge($tree, (Array)$sub_array); } } return $tree; @@ -103,7 +103,7 @@ class Tools { $tree[] = $_tree; if (!empty($sub)) { $sub_array = self::node2table($sub, $node, $pnode, $path, $_tree[$path . "_node"]); - $tree = array_merge($tree, (Array) $sub_array); + $tree = array_merge($tree, (Array)$sub_array); } } return $tree;