From b9b52ac28bf4d64f9d82388b38dbb3cd7518efbb Mon Sep 17 00:00:00 2001 From: sunguangming Date: Mon, 27 Nov 2023 13:08:04 +0800 Subject: [PATCH] * Remove unused code. --- module/common/model.php | 188 +++++------------------- module/common/view/footer.html.php | 104 ------------- module/common/view/footer.lite.html.php | 8 - module/common/view/header.html.php | 70 --------- module/common/view/header.lite.html.php | 97 ------------ 5 files changed, 39 insertions(+), 428 deletions(-) delete mode 100755 module/common/view/footer.html.php delete mode 100755 module/common/view/footer.lite.html.php delete mode 100755 module/common/view/header.html.php delete mode 100755 module/common/view/header.lite.html.php diff --git a/module/common/model.php b/module/common/model.php index 39604d6e16..adbae9c4b5 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -536,9 +536,7 @@ class commonModel extends model */ public static function getMainNavList(string $moduleName): array { - global $lang; - global $app; - global $config; + global $lang, $app, $config; $app->loadLang('my'); @@ -570,7 +568,7 @@ class commonModel extends model if(common::hasPriv($currentModule, $currentMethod)) $display = true; /* 2. 如果没有资产库落地页的权限,则查看是否有资产库其他方法的权限. */ - if($currentModule == 'assetlib' && !$display) list($display, $currentMethod) = commonTao::setAssetLibMenu($display, $currentMethod); + if($currentModule == 'assetlib' && !$display) list($display, $currentMethod) = commonTao::setAssetLibMenu($display, $currentModule, $currentMethod); /* 3. 可以个性化设置的导航,如果没有落地页的权限,则查看是否有其他落地页的权限。 */ $moduleLinkList = $currentModule . 'LinkList'; @@ -614,24 +612,15 @@ class commonModel extends model } /** - * Print the main menu. + * Get active main menu. * - * @param bool $printHtml * @static * @access public * @return string */ - public static function printMainMenu(bool $printHtml = true): string + public static function getActiveMainMenu(): string { - global $app, $lang, $config; - - /* Set main menu by app tab and module. */ - static::replaceMenuLang(); - static::setMainMenu(); - static::checkMenuVarsReplaced(); - - $activeMenu = ''; - $tab = $app->tab; + global $app; $isTutorialMode = commonModel::isTutorialMode(); $currentModule = $app->rawModule; @@ -643,168 +632,69 @@ class commonModel extends model /* Print all main menus. */ $menu = customModel::getMainMenu(); - $menuHtml = "\n"; - - if($printHtml) echo $menuHtml; return $activeMenu; } - /** - * Print the search box. - * - * @static - * @access public - * @return void - */ - public static function printSearchBox() - { - global $lang; - global $config; - - $searchObject = 'bug'; - echo "
"; - echo html::hidden('searchType', $searchObject); - echo "
'; - } - /** * Print the module menu. * diff --git a/module/common/view/footer.html.php b/module/common/view/footer.html.php deleted file mode 100755 index 160702d25a..0000000000 --- a/module/common/view/footer.html.php +++ /dev/null @@ -1,104 +0,0 @@ - - -getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> - - -viewType != 'xhtml'):?> - -
vision != 'lite') echo $this->loadModel('score')->getNotice(); ?>
- - - -loadModel('cron')->runnable()) js::execute('startCron()'); -if(isset($pageJS)) js::execute($pageJS); // load the js for current page. - -/* Load hook files for current page. */ -$extensionRoot = $this->app->getExtensionRoot(); -if($this->config->vision != 'open') -{ - $extHookRule = $extensionRoot . $this->config->edition . '/common/ext/view/footer.*.hook.php'; - $extHookFiles = glob($extHookRule); - if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile; -} -if($this->config->vision == 'lite') -{ - $extHookRule = $extensionRoot . $this->config->vision . '/common/ext/view/footer.*.hook.php'; - $extHookFiles = glob($extHookRule); - if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile; -} -$extHookRule = $extensionRoot . 'custom/common/ext/view/footer.*.hook.php'; -$extHookFiles = glob($extHookRule); -if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile; -?> -debug > 2 and $config->tabSession): ?> -
-tsid= - -servertid= - -sid= -
- -zinTool)) -{ - $pageVars = get_defined_vars(); - $exportVars = array('lang' => $lang); - foreach($pageVars as $varName => $varValue) - { - if(is_string($varValue) || is_bool($varValue) || is_numeric($varValue)) $exportVars[$varName] = $varValue; - } - js::set('pageVars', $exportVars); -} -?> - - diff --git a/module/common/view/footer.lite.html.php b/module/common/view/footer.lite.html.php deleted file mode 100755 index 40dfb001a7..0000000000 --- a/module/common/view/footer.lite.html.php +++ /dev/null @@ -1,8 +0,0 @@ -getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> - -loadModel('cron')->runnable()) js::execute('startCron()');?> - - - diff --git a/module/common/view/header.html.php b/module/common/view/header.html.php deleted file mode 100755 index caa2c93e2c..0000000000 --- a/module/common/view/header.html.php +++ /dev/null @@ -1,70 +0,0 @@ -getExtViewFile(__FILE__)){include $extView; return helper::cd();} -include 'header.lite.html.php'; -include 'chosen.html.php'; -//include 'validation.html.php'; -?> - -app->loadConfig('sso');?> -sso->redirect)) js::set('ssoRedirect', $config->sso->redirect);?> -showMainMenu):?> - - - - - - - -
sso->redirect)) echo "class='ranzhiFixedTfootAction'";?> > -
diff --git a/module/common/view/header.lite.html.php b/module/common/view/header.lite.html.php deleted file mode 100755 index 33729b2d77..0000000000 --- a/module/common/view/header.lite.html.php +++ /dev/null @@ -1,97 +0,0 @@ -getExtViewFile(__FILE__)){include $extView; return helper::cd();} -$clientLang = $app->getClientLang(); -$webRoot = $this->app->getWebRoot(); -$jsRoot = $webRoot . "js/"; -$themeRoot = $webRoot . "theme/"; -$defaultTheme = $webRoot . 'theme/default/'; -$langTheme = $themeRoot . 'lang/' . $clientLang . '.css'; -$clientTheme = $this->app->getClientTheme(); -$onlybody = zget($_GET, 'onlybody', 'no'); -$commonLang = array('zh-cn', 'zh-tw', 'en', 'fr', 'de'); -?> - - - - - - - - zentaoPMS); - js::exportConfigVars(); - if($config->debug) - { - $timestamp = time(); - - css::import($themeRoot . 'zui/css/min.css?t=' . $timestamp); - css::import($defaultTheme . 'style.css?t=' . $timestamp); - css::import($langTheme); - - if(strpos($clientTheme, 'default') === false) css::import($clientTheme . 'style.css?t=' . $timestamp); - - js::import($jsRoot . 'jquery/lib.js'); - js::import($jsRoot . 'zui/min.js?t=' . $timestamp); - - if(!in_array($clientLang, $commonLang)) js::import($jsRoot . 'zui/lang.' . $clientLang . '.min.js?t=' . $timestamp); - js::import($jsRoot . 'my.full.js?t=' . $timestamp); - - if(isset($config->zinTool)) js::import($jsRoot . 'zui3/zintool.js'); - } - else - { - $minCssFile = $defaultTheme . $this->cookie->lang . '.' . $this->cookie->theme . '.css'; - if(!file_exists($this->app->getThemeRoot() . 'default/' . $this->cookie->lang . '.' . $this->cookie->theme . '.css')) $minCssFile = $defaultTheme . 'en.' . $this->cookie->theme . '.css'; - css::import($minCssFile); - js::import($jsRoot . 'all.js'); - if(!in_array($clientLang, $commonLang)) js::import($jsRoot . 'zui/lang.' . $clientLang . '.min.js'); - } - if($this->app->getViewType() == 'xhtml') css::import($defaultTheme . 'x.style.css'); - - if($this->app->isServing() && commonModel::isTutorialMode()) - { - $wizardModule = isset($_SESSION['wizardModule']) ? $_SESSION['wizardModule'] : $this->moduleName; - $wizardMethod = isset($_SESSION['wizardMethod']) ? $_SESSION['wizardMethod'] : $this->methodName; - $requiredFields = ''; - if(isset($config->$wizardModule->$wizardMethod->requiredFields)) $requiredFields = str_replace(' ', '', $config->$wizardModule->$wizardMethod->requiredFields); - echo ""; - } - - if(isset($pageCSS)) css::internal($pageCSS); - - echo html::favicon($webRoot . 'favicon.ico'); - ?> - -app->getExtensionRoot(); -if($this->config->vision != 'open') -{ - $extHookRule = $extensionRoot . $this->config->edition . '/common/ext/view/header.*.hook.php'; - $extHookFiles = glob($extHookRule); - if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile; -} -if($this->config->vision == 'lite') -{ - $extHookRule = $extensionRoot . $this->config->vision . '/common/ext/view/header.*.hook.php'; - $extHookFiles = glob($extHookRule); - if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile; -} -$xuanExtFile = $extensionRoot . 'xuan/common/ext/view/header.xuanxuan.html.hook.php'; -if(file_exists($xuanExtFile)) include $xuanExtFile; -?> - -app->getViewType() == 'xhtml' ? 'allow-self-open' : ''; -if(isset($pageBodyClass)) $bodyClass = $bodyClass . ' ' . $pageBodyClass; -if($this->app->moduleName == 'index' && $this->app->methodName == 'index') $bodyClass .= ' menu-' . ($this->cookie->hideMenu ? 'hide' : 'show'); -if(strpos($_SERVER['HTTP_USER_AGENT'], 'xuanxuan') !== false) $bodyClass .= ' xxc-embed'; -?> - -app->getViewType() == 'xhtml'):?> - -