diff --git a/Makefile b/Makefile index 4f57265a75..38f45f704c 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,8 @@ package: if [ ! -d "zentaopms/config/ext" ]; then mkdir zentaopms/config/ext; fi for module in `ls zentaopms/module/`; do if [ ! -d "zentaopms/module/$$module/ext" ]; then mkdir zentaopms/module/$$module/ext; fi done find zentaopms/ -name ext |xargs chmod -R 777 - tools/cn2tw.php + mkdir zentaopms/tools; cp tools/cn2tw.php zentaopms/tools; cd zentaopms/tools; php cn2tw.php + rm -rf zentaopms/tools pms: make common make zentaoxx diff --git a/module/misc/control.php b/module/misc/control.php index 50be5e57d2..ec78640a24 100644 --- a/module/misc/control.php +++ b/module/misc/control.php @@ -59,16 +59,15 @@ class misc extends control /** * Check current version is latest or not. * + * @param string $sn * @access public * @return void */ - public function checkUpdate() + public function checkUpdate($sn) { - $note = isset($_GET['note']) ? $_GET['note'] : ''; - $browser = isset($_GET['browser']) ? $_GET['browser'] : ''; - - $this->view->note = urldecode(helper::safe64Decode($note)); - $this->view->browser = $browser; + session_write_close(); + $link = $this->lang->misc->api . "/updater-isLatest-{$this->config->version}-{$sn}.html?lang=" . str_replace('-', '_', $this->app->getClientLang()); + $this->view->note = file_get_contents($link); $this->display(); } diff --git a/module/misc/view/checkupdate.html.php b/module/misc/view/checkupdate.html.php index 1d2c232160..a382cecefd 100644 --- a/module/misc/view/checkupdate.html.php +++ b/module/misc/view/checkupdate.html.php @@ -1,7 +1,7 @@ - style='color:white; font-size:13px; text-align:center'> +server->http_user_agen, 'opera') === false) echo "bgcolor='transparent'";?> style='color:white; font-size:13px; text-align:center'> diff --git a/module/user/view/login.html.php b/module/user/view/login.html.php index 44a212fce3..61e43b8b73 100644 --- a/module/user/view/login.html.php +++ b/module/user/view/login.html.php @@ -82,8 +82,7 @@ if(empty($config->notMd5Pwd))js::import($jsRoot . 'md5.js');
checkVersion):?> - - +
diff --git a/tools/cn2tw.php b/tools/cn2tw.php index 8af43a45b4..e993d86635 100755 --- a/tools/cn2tw.php +++ b/tools/cn2tw.php @@ -3,16 +3,34 @@ $langType = 'zh-tw'; $langDesc = 'zh-tw'; if(empty($langType)) die('lang') . "\n"; -foreach(glob('../module/*') as $moduleName) +foreach(array('../module/') as $subModuleRoot) { - $moduleLangPath = realpath($moduleName) . '/lang/'; - $defaultLangFile = $moduleLangPath . 'zh-cn.php'; - $targetLangFile = $moduleLangPath . $langType . '.php'; - if(!file_exists($defaultLangFile)) continue; + foreach(glob($subModuleRoot . '*') as $moduleName) + { + $realModulePath = realpath($moduleName); + $moduleLangPath = $realModulePath . '/lang/'; + $defaultLangFile = $moduleLangPath . 'zh-cn.php'; + $targetLangFile = $moduleLangPath . $langType . '.php'; + if(file_exists($defaultLangFile)) + { + system("cconv -f utf-8 -t UTF8-TW $defaultLangFile > $targetLangFile"); + $defaultLang = file_get_contents($targetLangFile); + $targetLang = str_replace('zh-cn', $langDesc, $defaultLang); + file_put_contents($targetLangFile, $targetLang); + } - system("cconv -f utf-8 -t UTF8-TW $defaultLangFile > $targetLangFile"); - $defaultLang = file_get_contents($targetLangFile); - $targetLang = str_replace('zh-cn', $langDesc, $defaultLang); - file_put_contents($targetLangFile, $targetLang); + $extModuleLangPath = $realModulePath . '/ext/lang/zh-cn/*.php'; + foreach(glob($extModuleLangPath) as $extModuleLang) + { + $fileName = basename($extModuleLang); + if(!is_dir("{$realModulePath}/ext/lang/{$langType}/")) `mkdir -p {$realModulePath}/ext/lang/{$langType}/`; + $targetLangFile = $realModulePath . "/ext/lang/{$langType}/" . $fileName; + + system("cconv -f utf-8 -t UTF8-TW $extModuleLang > $targetLangFile"); + $defaultLang = file_get_contents($targetLangFile); + $targetLang = str_replace('zh-cn', $langDesc, $defaultLang); + file_put_contents($targetLangFile, $targetLang); + } + } } ?>