* adjust for build package.

This commit is contained in:
wangyidong
2019-01-30 11:38:29 +08:00
parent e156be97f4
commit f60a6c481a
5 changed files with 36 additions and 19 deletions
+2 -1
View File
@@ -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
+5 -6
View File
@@ -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();
}
+1 -1
View File
@@ -1,7 +1,7 @@
<?php error_reporting(0);?>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /></head>
<body <?php if($browser != 'opera') echo "bgcolor='transparent'";?> style='color:white; font-size:13px; text-align:center'>
<body <?php if(strpos($this->server->http_user_agen, 'opera') === false) echo "bgcolor='transparent'";?> style='color:white; font-size:13px; text-align:center'>
<?php if($note):?>
<?php echo $note;?>
<script>window.parent.document.getElementById('updater').className=''</script>
+1 -2
View File
@@ -82,8 +82,7 @@ if(empty($config->notMd5Pwd))js::import($jsRoot . 'md5.js');
<div class="table-col text-middle text-center">
<div id="poweredby">
<?php if($config->checkVersion):?>
<?php $siteURL = 'https://api.zentao.net';?>
<iframe id='updater' frameborder='0' width='100%' height='45' scrolling='no' allowtransparency='true' src="<?php echo $siteURL;?>/updater-isLatest-<?php echo $config->version;?>-<?php echo $s;?>.html?lang=<?php echo str_replace('-', '_', $this->app->getClientLang())?>"></iframe>
<iframe id='updater' class='hidden' frameborder='0' width='100%' height='45' scrolling='no' allowtransparency='true' src="<?php echo $this->createLink('misc', 'checkUpdate', "sn=$s");?>"></iframe>
<?php endif;?>
</div>
</div>
+27 -9
View File
@@ -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);
}
}
}
?>