From ba10199096fee2ed6f9e8bfdc08059e163580644 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 26 Apr 2016 16:47:38 +0800 Subject: [PATCH] * fix bug for build menu. --- module/common/model.php | 2 +- module/custom/model.php | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/module/common/model.php b/module/common/model.php index 4c7b5514c4..24b43b93cd 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1290,7 +1290,7 @@ class commonModel extends model */ public static function isTutorialMode() { - return $_SESSION['tutorialMode']; + return (isset($_SESSION['tutorialMode']) and $_SESSION['tutorialMode']); } } diff --git a/module/custom/model.php b/module/custom/model.php index 75cdaa0b77..bca0fcc6be 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -186,18 +186,16 @@ class customModel extends model $float = ''; $fixed = ''; - $link = is_array($item) ? $item['link'] : $item; + $link = is_array($item) ? $item['link'] : $item; + $label = $link; + $hasPriv = true; if(strpos($link, '|') !== false) { $link = explode('|', $link); list($label, $module, $method) = $link; - } - else - { - $label = $link; + $hasPriv = commonModel::hasPriv($module, $method); } - $hasPriv = commonModel::hasPriv($module, $method); if($isTutorialMode || $hasPriv) { $itemLink = ''; @@ -232,7 +230,7 @@ class customModel extends model if($hidden) $menuItem->hidden = $hidden; if($isTutorialMode) $menuItem->tutorial = true; - while(isset($menu[$menuItem->order])) { $menuItem->order++; } + while(isset($menu[$menuItem->order])) $menuItem->order++; $menu[$menuItem->order] = $menuItem; } }