From 811d884802eea4f9f437ab91e186952943f6a855 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 23 Feb 2023 15:06:22 +0800 Subject: [PATCH] * Hide admin menu. --- module/dev/config.php | 4 ++-- module/dev/model.php | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/module/dev/config.php b/module/dev/config.php index c28d160ca5..7e24682bbd 100644 --- a/module/dev/config.php +++ b/module/dev/config.php @@ -248,9 +248,9 @@ if(!helper::hasFeature('waterfall')) $config->disableFeature = array('design', ' $config->dev->disableMainMenu = array('project', 'product', 'execution'); $config->dev->projectMenus = array('project', 'scrum', 'waterfall', 'kanbanProject'); -$config->dev->hideMainMenu = array(); +$config->dev->hideMainMenu = array('admin'); if($config->vision == 'lite') { $config->dev->projectMenus = array('project', 'kanbanProject'); - $config->dev->hideMainMenu = array('execution', 'kanban'); + $config->dev->hideMainMenu = array('execution', 'kanban', 'admin'); } diff --git a/module/dev/model.php b/module/dev/model.php index ca41e9398a..7d7633e315 100644 --- a/module/dev/model.php +++ b/module/dev/model.php @@ -298,11 +298,12 @@ class devModel extends model * @param string $type * @param string $module * @param string $method + * @param string $language * @param object $defaultLang * @access public * @return object */ - public function getNavLang($type, $module, $method, $defaultLang = null) + public function getNavLang($type, $module, $method, $language = 'zh-cn', $defaultLang = null) { if(empty($defaultLang)) $defaultLang = $this->loadDefaultLang(); @@ -393,7 +394,7 @@ class devModel extends model } else { - $lang = $this->getNavLang($type, $module, $method, $defaultLang); + $lang = $this->getNavLang($type, $module, $method, $language, $defaultLang); $langKey = $type == 'first' ? 'mainNav_' : ($type == 'third' ? "{$method}_" : ''); $menus = $this->getLinkTitle($lang); @@ -496,8 +497,10 @@ class devModel extends model { $clientLang = $this->app->clientLang; if($language != $clientLang) $this->app->clientLang = $language; + $langFilesToLoad = $this->app->getMainAndExtFiles($module); if($language != $clientLang) $this->app->clientLang = $clientLang; + if(empty($langFilesToLoad)) return false; $lang = $module == 'common' ? new language() : $this->defaultLang;