diff --git a/config/config.php b/config/config.php index 8d10905d51..173a4cd59f 100644 --- a/config/config.php +++ b/config/config.php @@ -231,3 +231,8 @@ else unset($config->maxVersion); unset($config->ipdVersion); } + +/* Set zin config. */ +$config->zin = new stdClass(); +$config->zin->mode = 'compatible'; // 启用兼容 18.x 模式。 +$config->zin->extraCSS = 'compatible.css'; // 额外的 CSS 样式文件。 diff --git a/lib/zin/config.php b/lib/zin/config.php index 1c0be501e8..630643653f 100644 --- a/lib/zin/config.php +++ b/lib/zin/config.php @@ -16,7 +16,7 @@ function loadConfig() { global $app, $config; - $config->zin = new \stdClass(); + if(!isset($config->zin)) $config->zin = new \stdClass(); $config->zin->lang = $app->getClientLang(); $config->zin->wgVer = isset($config->wgVer) ? $config->wgVer : '1'; diff --git a/lib/zin/wg/pagebase/v1.php b/lib/zin/wg/pagebase/v1.php index b2d9317086..26efeeb3ea 100644 --- a/lib/zin/wg/pagebase/v1.php +++ b/lib/zin/wg/pagebase/v1.php @@ -64,7 +64,7 @@ class pageBase extends wg $themeName = $app->cookie->theme; $zuiPath = $config->zin->zuiPath; - $jsConfig->zin = true; + $jsConfig->zin = (isset($config->zin->mode) && $config->zin->mode) ? $config->zin->mode : true; $headImports = array(); if($zui) @@ -73,6 +73,8 @@ class pageBase extends wg $headImports[] = h::importCss($zuiPath . 'themes/' . $themeName . '.css', setID('zuiTheme')); $headImports[] = h::importJs($zuiPath . 'zui.zentao.umd.cjs', setID('zuiJS')); $headImports[] = h::jsCall('$.setLibRoot', $zuiPath); + + if(isset($config->zin->extraCSS) && $config->zin->extraCSS) $headImports[] = h::importCss($webRoot . 'js/zui3/' . $config->zin->extraCSS); } $headImports[] = h::jsVar('window.config', $jsConfig, setID('configJS')); if($zui) $headImports[] = h::importJs($webRoot . 'js/zui3/zin.js', setID('zinJS')); diff --git a/www/js/zui3/compatible.css b/www/js/zui3/compatible.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/www/js/zui3/zin.js b/www/js/zui3/zin.js index edafb9021b..38cddf89aa 100644 --- a/www/js/zui3/zin.js +++ b/www/js/zui3/zin.js @@ -7,7 +7,7 @@ const currentMethod = config.currentMethod; const isIndexPage = currentModule === 'index' && currentMethod === 'index'; const isInAppTab = parent.window !== window; - const is18version = true; + const is18version = config.zin === 'compatible'; const selfOpenList = new Set('index|tutorial|install|upgrade|sso|cron|misc|user-login|user-deny|user-logout|user-reset|user-forgetpassword|user-resetpassword|my-changepassword|my-preference|file-read|file-download|file-uploadimages|report-annualdata|misc-captcha|execution-printkanban|traincourse-playvideo'.split('|')); const isAllowSelfOpen = isIndexPage @@ -46,7 +46,7 @@ if(isIndexPage) return; const DEBUG = config.debug; - const is18version = true; + const is18version = config.zin === 'compatible'; const currentCode = window.name.substring(4); const isInAppTab = parent.window !== window; const fetchTasks = new Map();