* code for task #2993.

This commit is contained in:
wangyidong
2017-05-08 10:48:51 +08:00
parent 8e78fa7abf
commit 73bf63b4a4
3 changed files with 41 additions and 4 deletions
+1
View File
@@ -57,6 +57,7 @@ $lang->misc->copyright = "&copy; 2009 - 2016 <a href='http://www.cnezsoft.com'
$lang->misc->checkTable = "Check Data Table";
$lang->misc->needRepair = "Repair Table";
$lang->misc->repairTable = "Database table is damaged due to power outage. Please chech and repair!";
$lang->misc->repairFail = "Failed to repair. Please go to the database data directory, try to perform <code>myisamchk -r -f %s.MYI</code> repair.";
$lang->misc->tableName = "Table Name";
$lang->misc->tableStatus = "Status";
$lang->misc->novice = "First time to ZenTao? Do you want to start rookie mode?";
+1
View File
@@ -57,6 +57,7 @@ $lang->misc->copyright = "&copy; 2009 - 2016 <a href='http://www.cnezsoft.com'
$lang->misc->checkTable = "检查修复数据表";
$lang->misc->needRepair = "修复表";
$lang->misc->repairTable = "数据库表可以因为断电原因损坏,需要检查修复!!";
$lang->misc->repairFail = "修复失败,请到该数据库的数据目录下,尝试执行<code>myisamchk -r -f %s.MYI</code>进行修复。";
$lang->misc->tableName = "表名";
$lang->misc->tableStatus = "状态";
$lang->misc->novice = "您可能初次使用禅道,是否进入新手模式?";
+39 -4
View File
@@ -1,10 +1,45 @@
<?php
error_reporting(0);
error_reporting(E_ALL);
date_default_timezone_set('Asia/Shanghai');
include '../framework/helper.class.php';
include '../config/config.php';
define('DS', DIRECTORY_SEPARATOR);
session_start();
/* Set Client lang. */
if(isset($_SESSION['lang']))
{
$clientLang = $_SESSION['lang'];
}
elseif(isset($_COOKIE['lang']))
{
$clientLang = $_COOKIE['lang'];
}
elseif(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
{
if(strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], ',') === false)
{
$clientLang = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
else
{
$clientLang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, strpos($_SERVER['HTTP_ACCEPT_LANGUAGE'], ','));
}
/* Fix clientLang for ie >= 10. https://www.drupal.org/node/365615. */
if(stripos($clientLang, 'hans')) $clientLang = 'zh-cn';
if(stripos($clientLang, 'hant')) $clientLang = 'zh-tw';
}
if(!empty($clientLang))
{
$clientLang = strtolower($clientLang);
if(!isset($config->langs[$clientLang])) $clientLang = $config->default->lang;
}
else
{
$clientLang = $config->default->lang;
}
?>
<?php
$webRoot = $config->webRoot;
@@ -25,12 +60,12 @@ if(!file_exists($checkFileName) or (time() - filemtime($checkFileName)) > 60 * 1
$lang = new stdclass();
$lang->misc = new stdclass();
include '../module/misc/lang/zh-cn.php';
include "../module/misc/lang/{$clientLang}.php";
if($status == 'createFile')
{
$lang->user = new stdclass();
$lang->projectCommon = '';
include '../module/user/lang/zh-cn.php';
include "../module/user/lang/{$clientLang}.php";
}
else
{
@@ -96,7 +131,7 @@ else
<tr>
<td><?php echo $tableName;?></td>
<td><span style='color:<?php echo $tableStatus == 'ok' ? 'green' : 'red'?>'><?php echo $tableStatus;?></span></td>
<td><?php if($type == 'repair' and $tableStatus != 'ok') echo "修复失败,请到该数据库的数据目录下,尝试执行<code>myisamchk -r -f {$tableName}.MYI</code>进行修复。"?></td>
<td><?php if($type == 'repair' and $tableStatus != 'ok') printf($lang->misc->repairFail, $tableName)?></td>
</tr>
</tbody>
<?php endforeach;?>