* finish task #5829,5828,5826,5825.
This commit is contained in:
@@ -375,7 +375,7 @@ $lang->admin->menu->custom = array('link' => '自定义|custom|set', 'subModu
|
||||
$lang->admin->menu->sso = array('link' => '集成|admin|sso');
|
||||
$lang->admin->menu->extension = array('link' => '插件|extension|browse', 'subModule' => 'extension');
|
||||
$lang->admin->menu->dev = array('link' => '二次开发|dev|api', 'alias' => 'db', 'subModule' => 'dev,editor,entry');
|
||||
$lang->admin->menu->translate = array('link' => '翻译|translate|index');
|
||||
$lang->admin->menu->translate = array('link' => '翻译|translate|index', 'subModule' => 'translate');
|
||||
$lang->admin->menu->data = array('link' => '数据|backup|index', 'subModule' => 'backup,action');
|
||||
$lang->admin->menu->safe = array('link' => '安全|admin|safe', 'alias' => 'checkweak');
|
||||
$lang->admin->menu->system = array('link' => '系统|cron|index', 'subModule' => 'cron');
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
$config->translate->columnNum = 2;
|
||||
$config->translate->defaultLang = array('en', 'zh-cn', 'zh-tw');
|
||||
$config->translate->limit = 10;
|
||||
$config->translate->needReview = '1';
|
||||
|
||||
$config->translate->editor = new stdclass();
|
||||
$config->translate->editor->result = array('id' => 'reason', 'tools' => 'simpleTools');
|
||||
|
||||
+114
-102
@@ -33,11 +33,11 @@ class translate extends control
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$itemCount = $this->translate->getLangItemCount();
|
||||
$progress = $this->translate->getProgress();
|
||||
$itemCount = $this->translate->getLangItemCount();
|
||||
$statistics = $this->translate->getLangStatistics();
|
||||
$finishedLangs = $translatingLangs = array();
|
||||
foreach($this->config->translate->defaultLang as $defaultLang) $finishedLangs[$defaultLang] = $this->config->langs[$defaultLang];
|
||||
foreach($progress as $translateLang => $data)
|
||||
foreach($statistics as $translateLang => $data)
|
||||
{
|
||||
if($data->progress == 1)
|
||||
{
|
||||
@@ -111,6 +111,7 @@ class translate extends control
|
||||
$this->view->position[] = html::a($this->createLink('translate', 'index'), $this->lang->translate->common);
|
||||
$this->view->position[] = $this->lang->translate->chooseModule;
|
||||
$this->view->modules = $this->translate->getModules();
|
||||
$this->view->statistics = $this->translate->getModuleStatistics($language);
|
||||
$this->view->language = $language;
|
||||
|
||||
$this->display();
|
||||
@@ -126,20 +127,12 @@ class translate extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function module($language, $module = '', $referLang = '')
|
||||
public function module($language, $module, $referLang = '')
|
||||
{
|
||||
$moduleGroup = $this->translate->getModules();
|
||||
if(empty($module))
|
||||
foreach($moduleGroup as $group => $modules)
|
||||
{
|
||||
$group = current($this->lang->dev->groupList);
|
||||
$module = current($moduleGroup[$group]);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($moduleGroup as $group => $modules)
|
||||
{
|
||||
if(in_array($module, $modules)) break;
|
||||
}
|
||||
if(in_array($module, $modules)) break;
|
||||
}
|
||||
if(empty($referLang))
|
||||
{
|
||||
@@ -169,111 +162,130 @@ class translate extends control
|
||||
$this->view->referItems = $this->translate->getModuleLangs($module, $referLang);
|
||||
$this->view->translations = $this->translate->getTranslations($language, $module);
|
||||
$this->view->moduleGroup = $moduleGroup;
|
||||
$this->view->currentModule = $module;
|
||||
$this->view->currentGroup = $group;
|
||||
$this->view->currentModule = $module;
|
||||
$this->view->currentGroup = $group;
|
||||
$this->view->language = $language;
|
||||
$this->view->referLang = $referLang;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Download selected language.
|
||||
*
|
||||
* @param string $zentaoVersion
|
||||
* @param string $language
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function download($zentaoVersion = '3.0', $language = 'en', $downloadModule = '')
|
||||
public function review($language, $module, $referLang = '')
|
||||
{
|
||||
$translateDir = $this->app->getBasePath() . "www/data/guard/zentaopms-$language" . date('His') . mt_rand(0, 100);
|
||||
$moduleDir = $translateDir . '/module/';
|
||||
mkdir($translateDir);
|
||||
mkdir($moduleDir);
|
||||
$modules = $this->translate->getModules($zentaoVersion);
|
||||
foreach ($modules as $module)
|
||||
$moduleGroup = $this->translate->getModules();
|
||||
foreach($moduleGroup as $group => $modules)
|
||||
{
|
||||
if(!empty($downloadModule) and $downloadModule != $module) continue;
|
||||
$langPath = $moduleDir . $module . '/lang/';
|
||||
mkdir($moduleDir . $module);
|
||||
mkdir($langPath);
|
||||
$fileName = $langPath . $language . '.php';
|
||||
$filePath = $this->translate->getLangFilePath($zentaoVersion, 'en', $module);
|
||||
if(in_array($language, $this->config->translate->defaultLang))
|
||||
if(in_array($module, $modules)) break;
|
||||
}
|
||||
if(empty($referLang))
|
||||
{
|
||||
$langs = json_decode($this->config->global->langs, true);
|
||||
if(isset($langs[$language]))
|
||||
{
|
||||
$filePath = $this->translate->getLangFilePath($zentaoVersion, $language, $module);
|
||||
copy($filePath, $fileName);
|
||||
continue;
|
||||
$referLang = $langs[$language]['reference'];
|
||||
}
|
||||
|
||||
$translations = $this->translate->getTranslations($zentaoVersion, $language, $module);
|
||||
|
||||
/* Write content for new lang file*/
|
||||
if(file_exists($filePath))
|
||||
else
|
||||
{
|
||||
$langHandle = fopen($filePath, "r");
|
||||
$writeHandle = fopen($fileName, 'w');
|
||||
while(!feof($langHandle))
|
||||
$referLang = $language == 'zh-cn' ? 'en' : 'zh-cn';
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->translate->review;
|
||||
$this->view->position[] = html::a($this->createLink('translate', 'index'), $this->lang->translate->common);
|
||||
$this->view->position[] = $this->lang->translate->review;
|
||||
|
||||
$this->view->referItems = $this->translate->getModuleLangs($module, $referLang);
|
||||
$this->view->translations = $this->translate->getTranslations($language, $module);
|
||||
$this->view->moduleGroup = $moduleGroup;
|
||||
$this->view->currentModule = $module;
|
||||
$this->view->currentGroup = $group;
|
||||
$this->view->language = $language;
|
||||
$this->view->referLang = $referLang;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
public function result($translationID, $result)
|
||||
{
|
||||
if($result == 'pass')
|
||||
{
|
||||
$this->dao->update(TABLE_TRANSLATION)->set('status')->eq('reviewed')->set('reviewer')->eq($this->app->user->account)->set('reviewTime')->eq(helper::now())->where('id')->eq($translationID)->exec();
|
||||
die(js::reload());
|
||||
}
|
||||
if($result == 'reject' and empty($_POST)) die($this->display());
|
||||
if($result == 'reject' and $_POST)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
if(empty($data->reason)) $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->error->notempty, $this->lang->translate->reason)));
|
||||
$this->dao->update(TABLE_TRANSLATION)->set('status')->eq('rejected')->set('reviewer')->eq($this->app->user->account)->set('reviewTime')->eq(helper::now())->set('reason')->eq($data->reason)->where('id')->eq($translationID)->exec();
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'callback' => "parent.reloadStatus($translationID)"));
|
||||
}
|
||||
}
|
||||
|
||||
public function batchPass()
|
||||
{
|
||||
$this->dao->update(TABLE_TRANSLATION)->set('status')->eq('reviewed')->set('reviewer')->eq($this->app->user->account)->set('reviewTime')->eq(helper::now())->where('id')->in($this->post->idList)->exec();
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload'));
|
||||
}
|
||||
|
||||
public function setting()
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$data = fixer::input('post')->get();
|
||||
$this->loadModel('setting')->setItem('system.translate.needReview', $data->needReview);
|
||||
die(js::reload('parent.parent'));
|
||||
}
|
||||
$this->display();
|
||||
}
|
||||
|
||||
public function export($language)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$account = $this->app->user->account;
|
||||
$cacheRoot = $this->app->getCacheRoot();
|
||||
|
||||
$zfile = $this->app->loadClass('zfile');
|
||||
if(is_dir($cacheRoot . "{$account}_lang/")) $zfile->removeDir($cacheRoot . "{$account}_lang/");
|
||||
|
||||
$downloadFile = $cacheRoot . "{$account}_lang/zentao.zip";
|
||||
$downloadPath = $cacheRoot . "{$account}_lang/zentao/";
|
||||
mkdir($downloadPath, 0777, true);
|
||||
|
||||
$langs = json_decode($this->config->global->langs, true);
|
||||
$referLang = isset($langs[$language]) ? $langs[$language]['reference'] : '';
|
||||
|
||||
$moduleRoot = $this->app->getModuleRoot();
|
||||
foreach(glob($moduleRoot . '/*') as $modulePath)
|
||||
{
|
||||
$moduleName = basename($modulePath);
|
||||
if(!is_dir($downloadPath . "module/{$moduleName}/lang/")) mkdir($downloadPath . "module/{$moduleName}/lang/", 0777, true);
|
||||
if(!file_exists($modulePath . "/lang/{$language}.php") and !empty($referLang) and file_exists($modulePath . "/lang/{$referLang}.php"))
|
||||
{
|
||||
$line = fgets($langHandle);
|
||||
$position = strpos($line, '=');
|
||||
if($position !== false and strrpos(ltrim($line), '$lang->') === 0)
|
||||
{
|
||||
$leftContent = substr($line, 0, $position);
|
||||
$langKey = str_replace(array("'", '$lang->'), array('"', ''), trim($leftContent));
|
||||
$write = $line;
|
||||
if(isset($translations[$langKey]))
|
||||
{
|
||||
$translation = current($translations[$langKey]);
|
||||
$write = $leftContent . "= '" . $translation->translation . "';\n";
|
||||
}
|
||||
fwrite($writeHandle, $write);
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite($writeHandle, $line);
|
||||
}
|
||||
$translations = $this->dao->select('*')->from(TABLE_TRANSLATION)->where('lang')->eq($language)->andWhere('module')->eq($moduleName)->andWhere('flow')->eq($this->config->global->flow)->fetchAll('key');
|
||||
$this->translate->buildLangFile($language, $moduleName, $translations, $referLang);
|
||||
}
|
||||
fclose($langHandle);
|
||||
if(file_exists($modulePath . "/lang/{$language}.php")) copy($modulePath . "/lang/{$language}.php", $downloadPath . "module/{$moduleName}/lang/{$language}.php");
|
||||
}
|
||||
|
||||
$this->app->loadClass('pclzip', true);
|
||||
$zip = new pclzip($downloadFile);
|
||||
$zip->create($downloadPath, PCLZIP_OPT_REMOVE_PATH, dirname($downloadPath));
|
||||
|
||||
$content = file_get_contents($downloadFile);
|
||||
if(is_dir($cacheRoot . "{$account}_lang/")) $zfile->removeDir($cacheRoot . "{$account}_lang/");
|
||||
|
||||
$this->loadModel('file')->sendDownHeader($this->post->fileName . '.zip', 'zip', $content);
|
||||
}
|
||||
$downloadDir = dirname($translateDir);
|
||||
$fileDir = basename($translateDir);
|
||||
$fileName = $fileDir . '.zip';
|
||||
$downloadFile = $downloadDir . '/' . $fileName;
|
||||
`cd $downloadDir; zip -rm -9 $fileName $fileDir`;
|
||||
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) $fileName = urlencode($fileName);
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-type: application/octet-stream');
|
||||
header("Content-Disposition: attachment; filename=$fileName");
|
||||
header('Content-Length: ' . filesize($downloadFile));
|
||||
readfile($downloadFile);
|
||||
unlink($downloadFile);
|
||||
die();
|
||||
$this->app->loadLang('file');
|
||||
$this->display();
|
||||
}
|
||||
|
||||
public function ajaxVote($translateID)
|
||||
public function ajaxGetStatus($id)
|
||||
{
|
||||
$this->dao->update(TABLE_TRANSLATE)->set('vote = vote + 1')->where('id')->eq($translateID)->exec(false);
|
||||
$userVotes = $this->cookie->votes;
|
||||
$userVotes .= $userVotes . "_" . $translateID . "_";
|
||||
setCookie('votes', $userVotes, $this->config->cookieLife);
|
||||
$translation = $this->dao->findByID($translateID)->from(TABLE_TRANSLATE)->fetch('', false);
|
||||
echo $translation->vote;
|
||||
}
|
||||
$translation = $this->dao->select('*')->from(TABLE_TRANSLATION)->where('id')->eq($id)->fetch();
|
||||
|
||||
public function delete($translateID, $consultLang, $confirm = 'no')
|
||||
{
|
||||
if($confirm == 'no')
|
||||
{
|
||||
die(js::confirm($this->lang->translate->notice->delete, inlink('delete', "translateID=$translateID&consultLang=$consultLang&confirm=yes")));
|
||||
}
|
||||
$translation = $this->dao->findByID($translateID)->from(TABLE_TRANSLATE)->fetch('', false);
|
||||
|
||||
$scores = $this->translate->countWords($translation->translation);
|
||||
$this->loadModel('score')->log($translation->account, 'deleteTranslate', 'punish', $scores, 'TRANSLATE');
|
||||
|
||||
$this->dao->delete()->from(TABLE_TRANSLATE)->where('id')->eq($translateID)->exec(false);
|
||||
die(js::locate(inLink('showLang', "version=$translation->version&language=$translation->language&module=$translation->module&consultLang=$consultLang"), 'parent'));
|
||||
$status = zget($this->lang->translate->statusList, $translation->status);
|
||||
if($translation->status == 'rejected') $status .= " <span title='{$translation->reason}'><i class='icon icon-help'></i></span>";
|
||||
die($status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#mainMenu{font-size:16px;padding:5px 0px;}
|
||||
.panel{margin-bottom:0px; border:0px;}
|
||||
.panel .panel-body{padding-bottom:5px;}
|
||||
#translatingLangs .panel .panel-body{padding-right:0px;}
|
||||
.panel .text-progress{color:#999;}
|
||||
.panel p{padding-bottom:5px;}
|
||||
.item .pull-right{color:#999;}
|
||||
.table-condensed td, .table-condensed th{padding:2px !important;}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
.table-data tbody>tr>td{border:1px solid #cbd0db !important; padding-right:8px !important;}
|
||||
.main-col .main-form .table-footer{padding-left: 7px; border: 1px solid #cbd0db; border-top: 0px;}
|
||||
.main-col .main-form .table thead tr th .check-all{margin-left: -3px;}
|
||||
@@ -0,0 +1,10 @@
|
||||
function adjustKeyWidth()
|
||||
{
|
||||
var maxWidth = 0;
|
||||
$('.table-data tbody tr').each(function()
|
||||
{
|
||||
keyWidth = $(this).find('td').eq(1).find('nobr').width();
|
||||
if(maxWidth < keyWidth) maxWidth = keyWidth;
|
||||
});
|
||||
$('.table-data thead tr:first th').eq(1).width(maxWidth);
|
||||
}
|
||||
@@ -4,16 +4,6 @@ function setTranslateView(view)
|
||||
location.reload();
|
||||
}
|
||||
|
||||
function adjustKeyWidth()
|
||||
{
|
||||
var maxWidth = 0;
|
||||
$('.table-data tbody tr').each(function()
|
||||
{
|
||||
keyWidth = $(this).find('td').eq(1).find('nobr').width();
|
||||
if(maxWidth < keyWidth) maxWidth = keyWidth;
|
||||
});
|
||||
$('.table-data thead tr:first th').eq(1).width(maxWidth);
|
||||
}
|
||||
$(function()
|
||||
{
|
||||
adjustKeyWidth();
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
function reloadStatus(translationID)
|
||||
{
|
||||
$.get(createLink('translate', 'ajaxGetStatus', 'id=' + translationID), function(data)
|
||||
{
|
||||
var $td = $('#mainContent table tbody tr .pass[data-id=' + translationID + ']').closest('td');
|
||||
$td.closest('tr').find('.status').html(data)
|
||||
$td.html('');
|
||||
});
|
||||
}
|
||||
$(function()
|
||||
{
|
||||
adjustKeyWidth();
|
||||
$('#mainContent table tbody [id^=idList]').change(function()
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
var isCheckAll = true;
|
||||
$('#mainContent table tbody [id^=idList]').each(function()
|
||||
{
|
||||
if(!$(this).prop('checked')) isCheckAll = false;
|
||||
})
|
||||
if(isCheckAll) $('.check-all').addClass('checked');
|
||||
if(!isCheckAll) $('.check-all').removeClass('checked');
|
||||
}, 50);
|
||||
})
|
||||
|
||||
$('#mainContent table tbody tr .pass').click(function()
|
||||
{
|
||||
var $td = $(this).closest('td');
|
||||
var $tr = $td.closest('tr');
|
||||
var id = $(this).data('id');
|
||||
$.get($(this).attr('href'), function()
|
||||
{
|
||||
$.get(createLink('translate', 'ajaxGetStatus', 'id=' + id), function(data)
|
||||
{
|
||||
$tr.find('.status').html(data)
|
||||
$td.html('');
|
||||
});
|
||||
});
|
||||
return false;
|
||||
})
|
||||
});
|
||||
@@ -12,6 +12,8 @@ $lang->translate->common = '翻译';
|
||||
$lang->translate->index = '首页';
|
||||
$lang->translate->addLang = '新增语言';
|
||||
$lang->translate->module = '翻译模块';
|
||||
$lang->translate->review = '审校';
|
||||
$lang->translate->setting = '设置';
|
||||
$lang->translate->chooseModule = '选择翻译模块';
|
||||
|
||||
$lang->translate->name = '语言名称';
|
||||
@@ -20,6 +22,22 @@ $lang->translate->key = '键';
|
||||
$lang->translate->reference = '参考语言';
|
||||
$lang->translate->status = '状态';
|
||||
$lang->translate->refreshPage = '刷新';
|
||||
$lang->translate->reason = '拒绝原因';
|
||||
|
||||
$lang->translate->reviewTurnon = '评审流程';
|
||||
$lang->translate->reviewTurnonList['1'] = '开启';
|
||||
$lang->translate->reviewTurnonList['0'] = '关闭';
|
||||
|
||||
$lang->translate->resultList['pass'] = '通过';
|
||||
$lang->translate->resultList['reject'] = '拒绝';
|
||||
|
||||
$lang->translate->group = '分组';
|
||||
$lang->translate->allTotal = '总条目';
|
||||
$lang->translate->translatedTotal = '已翻译条目数';
|
||||
$lang->translate->changedTotal = '已修改条目数';
|
||||
$lang->translate->reviewedTotal = '已审校条目数';
|
||||
$lang->translate->translatedProgress = '翻译进度';
|
||||
$lang->translate->reviewedProgress = '审校进度';
|
||||
|
||||
$lang->translate->builtIn = '内置语言';
|
||||
$lang->translate->finished = '翻译完成';
|
||||
|
||||
@@ -162,7 +162,7 @@ class translateModel extends model
|
||||
{
|
||||
$cmd = '';
|
||||
$moduleRoot = $this->app->getModuleRoot();
|
||||
$modules = empty($moduleName) ? array($moduleRoot . $moduleName) : glob($moduleRoot . '*');
|
||||
$modules = !empty($moduleName) ? array($moduleRoot . $moduleName) : glob($moduleRoot . '*');
|
||||
foreach($modules as $modulePath)
|
||||
{
|
||||
if(is_dir($modulePath . '/lang') and !is_writable($modulePath . '/lang')) $cmd .= "chmod 777 {$modulePath}/lang <br />";
|
||||
@@ -205,13 +205,21 @@ class translateModel extends model
|
||||
return $itemCount;
|
||||
}
|
||||
|
||||
public function getProgress()
|
||||
public function getLangStatistics()
|
||||
{
|
||||
$langs = $this->dao->select("`lang`,sum(if((status != 'waiting'),1,0)) as waitItems, count(*) as count")->from(TABLE_TRANSLATION)->groupBy('`lang`')->fetchAll('lang');
|
||||
foreach($langs as $lang => $data) $data->progress = round($data->waitItems / $data->count, 3);
|
||||
$langs = $this->dao->select("`lang`,sum(if((status = 'translated'),1,0)) as translatedItems,sum(if((status = 'reviewed'),1,0)) as reviewedItems, count(*) as count")->from(TABLE_TRANSLATION)->groupBy('`lang`')->fetchAll('lang');
|
||||
foreach($langs as $lang => $data) $data->progress = round(($data->translatedItems + $data->reviewedItems) / $data->count, 3);
|
||||
return $langs;
|
||||
}
|
||||
|
||||
public function getModuleStatistics($language)
|
||||
{
|
||||
$fields = 'lang,module,';
|
||||
foreach($this->lang->translate->statusList as $status => $title) $fields .= "sum(if((status = '$status'),1,0)) as $status,";
|
||||
$fields .= "count(*) as count";
|
||||
return $this->dao->select($fields)->from(TABLE_TRANSLATION)->where('lang')->eq($language)->groupBy('module')->fetchAll('module');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Translations
|
||||
*
|
||||
@@ -256,7 +264,6 @@ class translateModel extends model
|
||||
if(!empty($_POST['values'][$i])) $value = $this->post->values[$i];
|
||||
if($dbItem)
|
||||
{
|
||||
unset($dbItem->id);
|
||||
$translation = $dbItem;
|
||||
$translation->version = $this->config->version;
|
||||
if($dbItem->value != $value)
|
||||
|
||||
@@ -13,23 +13,51 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->dev->moduleList . ' > ' . $lang->translate->chooseModule;?></h2>
|
||||
<h2><?php echo "[{$config->langs[$language]}] " . $lang->dev->moduleList . ' > ' . $lang->translate->chooseModule;?></h2>
|
||||
</div>
|
||||
<table class='table table-form'>
|
||||
<?php foreach($lang->dev->groupList as $group => $groupName):?>
|
||||
<tr>
|
||||
<th class='w-100px text-top'>
|
||||
<div class='item'><?php echo $groupName;?></div>
|
||||
</th>
|
||||
<td>
|
||||
<div class='clearfix'>
|
||||
<?php foreach($modules[$group] as $module):?>
|
||||
<div class='item'><?php echo html::a($this->createLink('translate', 'module', "language=$language&module=$module"), zget($lang->dev->tableList, $module, $module));?></div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<table class='table table-bordered table-hover'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php echo $lang->translate->group;?></th>
|
||||
<th><?php echo $lang->dev->moduleList;?></th>
|
||||
<th class='w-80px'><?php echo $lang->translate->allTotal;?></th>
|
||||
<th class='w-100px'><?php echo $lang->translate->translatedTotal;?></th>
|
||||
<th class='w-100px'><?php echo $lang->translate->changedTotal;?></th>
|
||||
<th class='w-100px'><?php echo $lang->translate->reviewedTotal;?></th>
|
||||
<th class='w-80px'><?php echo $lang->translate->translatedProgress;?></th>
|
||||
<th class='w-80px'><?php echo $lang->translate->reviewedProgress;?></th>
|
||||
<th class='w-80px'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($lang->dev->groupList as $group => $groupName):?>
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($modules[$group] as $module):?>
|
||||
<?php $moduleStatistics = $statistics[$module];?>
|
||||
<tr>
|
||||
<?php if($i == 0):?>
|
||||
<th rowspan='<?php echo count($modules[$group]);?>' class='w-100px text-top'>
|
||||
<div class='item'><?php echo $groupName;?></div>
|
||||
</th>
|
||||
<?php endif;?>
|
||||
<td><?php echo zget($lang->dev->tableList, $module, $module);?></td>
|
||||
<td class='text-center'><?php echo $moduleStatistics->count;?></td>
|
||||
<td class='text-center'><?php echo $moduleStatistics->translated + $moduleStatistics->reviewed;?></td>
|
||||
<td class='text-center'><?php echo $moduleStatistics->changed;?></td>
|
||||
<td class='text-center'><?php echo $moduleStatistics->reviewed;?></td>
|
||||
<td class='text-center'><?php echo (round(($moduleStatistics->translated + $moduleStatistics->reviewed) / $moduleStatistics->count, 3) * 100) . '%';?></td>
|
||||
<td class='text-center'><?php echo (round($moduleStatistics->reviewed / $moduleStatistics->count, 3) * 100) . '%';?></td>
|
||||
<td>
|
||||
<?php
|
||||
if(common::hasPriv('translate', 'module')) echo html::a($this->createLink('translate', 'module', "language=$language&module=$module"), $lang->translate->common);
|
||||
if(common::hasPriv('translate', 'review') and $config->translate->needReview) echo html::a($this->createLink('translate', 'review', "language=$language&module=$module"), $lang->translate->review);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i++;?>
|
||||
<?php endforeach;?>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Executable
+43
@@ -0,0 +1,43 @@
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<script>
|
||||
function setDownloading()
|
||||
{
|
||||
if($.browser.opera) return true; // Opera don't support, omit it.
|
||||
|
||||
var $fileName = $('#fileName');
|
||||
if($fileName.val() === '') $fileName.val('<?php echo $lang->file->untitled;?>');
|
||||
|
||||
$.cookie('downloading', 0);
|
||||
time = setInterval("closeWindow()", 300);
|
||||
$('#mainContent').addClass('loading');
|
||||
return true;
|
||||
}
|
||||
|
||||
function closeWindow()
|
||||
{
|
||||
if($.cookie('downloading') == 1)
|
||||
{
|
||||
$('#mainContent').removeClass('loading');
|
||||
parent.$.closeModal();
|
||||
$.cookie('downloading', null);
|
||||
clearInterval(time);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div id="mainContent" class="main-content load-indicator">
|
||||
<div class="main-header">
|
||||
<h2><?php echo $lang->export;?></h2>
|
||||
</div>
|
||||
<form class="main-form" method="post" target="hiddenwin">
|
||||
<table class="table table-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->file->fileName;?></th>
|
||||
<td class="w-300px"><?php echo html::input('fileName', isset($fileName) ? $fileName : '', "class='form-control' autofocus placeholder='{$lang->file->untitled}'");?></td>
|
||||
<td><?php echo html::submitButton($lang->export, "onclick='setDownloading();'", 'btn btn-primary');?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
@@ -1,6 +1,11 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div class='center-block mw-800px'>
|
||||
<div id="mainMenu" class="clearfix"><?php printf($lang->translate->allItems, $itemCount);?></div>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<?php printf($lang->translate->allItems, $itemCount);?>
|
||||
<div class='pull-right'>
|
||||
<?php echo html::a(inlink('setting'), "<i class='icon icon-cog'></i>", '', "class='iframe btn btn-sm btn-link'");?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class='col-sm-6'>
|
||||
<div class='panel'>
|
||||
@@ -18,19 +23,24 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-sm-6'>
|
||||
<div class='col-sm-6' id='translatingLangs'>
|
||||
<div class='panel'>
|
||||
<div class='panel-heading'>
|
||||
<div class='panel-title'><?php echo $lang->translate->translatingLang;?></div>
|
||||
<div class='panel-actions'><?php printf($lang->translate->count, count($translatingLangs));?></div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<table class='table table-form table-condensed'>
|
||||
<table class='table table-form'>
|
||||
<?php foreach($translatingLangs as $langKey => $data):?>
|
||||
<tr>
|
||||
<th class='text-left'><?php echo $data->name;?></th>
|
||||
<td class='text-progress text-center'><?php printf($lang->translate->progress, ($data->progress * 100) . '%');?></td>
|
||||
<td class='w-50px'><?php echo html::a(inlink('chooseModule', "language=$langKey"), $lang->translate->common, '', "class='btn btn-mini'");?></td>
|
||||
<td class='w-110px'>
|
||||
<?php
|
||||
echo html::a(inlink('chooseModule', "language=$langKey"), $lang->translate->common, '', "class='btn btn-sm'");
|
||||
echo html::a(inlink('export', "language=$langKey"), $lang->export, '', "class='btn btn-sm iframe'");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
<?php else:?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a(inlink('chooseModule', "language=$language"), $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
<div class='divider'></div>
|
||||
<?php foreach($lang->dev->groupList as $group => $groupName):?>
|
||||
<?php $active = $group == $currentGroup ? 'btn-active-text' : '';?>
|
||||
<?php echo html::a(inlink('module', "language=$language&module=" . current($moduleGroup[$group])), "<span class='text'>{$groupName}</span>", '', "class='btn btn-link $active'");?>
|
||||
@@ -34,7 +36,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class='main-col main-content'>
|
||||
<form class='main-form form-ajax' method='post'>
|
||||
<form class='main-form form-ajax' method='post' data-ride="table">
|
||||
<table class='table table-bordered table-data'>
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -46,7 +48,7 @@
|
||||
<?php else:?>
|
||||
<th><?php echo $config->langs[$referLang] . ' / ' . $config->langs[$language];?></th>
|
||||
<?php endif;;?>
|
||||
<th class='w-70px'><?php echo $lang->translate->status;?></th>
|
||||
<th class='w-80px'><?php echo $lang->translate->status;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -73,7 +75,15 @@
|
||||
echo html::$function('values[]', ($translation and $translation->value != $item) ? htmlspecialchars($translation->value) : '', "class='form-control'");
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $translation ? zget($lang->translate->statusList, $translation->status) : '';?></td>
|
||||
<td>
|
||||
<?php
|
||||
if($translation)
|
||||
{
|
||||
echo zget($lang->translate->statusList, $translation->status);
|
||||
if($translation->status == 'rejected') echo " <span title='$translation->reason'><i class='icon icon-help'></i></span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php else:?>
|
||||
<tr <?php echo $hideClass;?>>
|
||||
@@ -81,7 +91,15 @@
|
||||
<td class='text-right' rowspan='2'><?php echo $i;?></td>
|
||||
<td class='text-right' rowspan='2'><?php echo "<nobr>$key</nobr>" . $hiddenKey;?></td>
|
||||
<td><?php echo $hasNL ? nl2br(htmlspecialchars($item)) : htmlspecialchars($item);?></td>
|
||||
<td rowspan='2'><?php echo $translation ? zget($lang->translate->statusList, $translation->status) : '';?></td>
|
||||
<td rowspan='2'>
|
||||
<?php
|
||||
if($translation)
|
||||
{
|
||||
echo zget($lang->translate->statusList, $translation->status);
|
||||
if($translation->status == 'rejected') echo " <span title='$translation->reason'><i class='icon icon-help'></i></span>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr <?php echo $hideClass;?>>
|
||||
<td class='translated'>
|
||||
@@ -94,12 +112,8 @@
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan='<?php echo $isSplit ? 5 : 4;?>' class='text-center'><?php echo html::submitButton()?></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<div class="table-footer text-center"><?php echo html::submitButton();?></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<div id="mainContent" class="main-content load-indicator">
|
||||
<div class="main-header">
|
||||
<h2><?php echo $lang->translate->resultList['reject'];?></h2>
|
||||
</div>
|
||||
<form class="main-form form-ajax" method="post">
|
||||
<table class="table table-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class='w-100px'><?php echo $lang->translate->reason;?></th>
|
||||
<td class='required'><?php echo html::textarea('reason', '', "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php echo html::a(inlink('chooseModule', "language=$language"), $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
<div class='divider'></div>
|
||||
<?php foreach($lang->dev->groupList as $group => $groupName):?>
|
||||
<?php $active = $group == $currentGroup ? 'btn-active-text' : '';?>
|
||||
<?php echo html::a(inlink('review', "language=$language&module=" . current($moduleGroup[$group])), "<span class='text'>{$groupName}</span>", '', "class='btn btn-link $active'");?>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='side-col' id='sidebar'>
|
||||
<div class='cell'>
|
||||
<div class='list-group'>
|
||||
<?php foreach($moduleGroup[$currentGroup] as $module):?>
|
||||
<?php echo html::a(inlink('review', "language=$language&module=$module"), zget($lang->dev->tableList, $module, $module), '', $module == $currentModule ? "class='active'" : '');?>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='main-col main-content'>
|
||||
<?php $hasPriv = common::hasPriv('translate', 'batchPass');?>
|
||||
<form class='main-form form-ajax' method='post' action='<?php echo inlink('batchPass');?>' data-ride="table">
|
||||
<table class='table table-bordered table-data'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='w-80px'>
|
||||
<?php if($hasPriv):?>
|
||||
<div class='checkbox-primary check-all' title='<?php echo $this->lang->selectAll;?>'>
|
||||
<label></label>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</th>
|
||||
<th><?php echo $lang->translate->key;?></th>
|
||||
<th><?php echo $config->langs[$referLang] . ' / ' . $config->langs[$language];?></th>
|
||||
<th class='w-80px'><?php echo $lang->translate->status;?></th>
|
||||
<th class='w-80px'><?php echo $lang->actions?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($referItems as $key => $item):?>
|
||||
<?php
|
||||
if(!isset($translations[$key])) continue;
|
||||
$translation = $translations[$key];
|
||||
$hasNL = strpos($item, "\n") !== false;
|
||||
$hideClass = $this->translate->checkNeedTranslate($item) ? '' : "class='hidden'";
|
||||
if(empty($hideClass)) $i++;
|
||||
?>
|
||||
<tr <?php echo $hideClass;?>>
|
||||
<td class='text-left' rowspan='2'><?php echo $hasPriv ? html::checkbox('idList', array($translation->id => $i)) : $i;?></td>
|
||||
<td class='text-right' rowspan='2'><?php echo "<nobr>$key</nobr>"?></td>
|
||||
<td><?php echo $hasNL ? nl2br(htmlspecialchars($item)) : htmlspecialchars($item);?></td>
|
||||
<td rowspan='2' class='status'>
|
||||
<?php
|
||||
echo zget($lang->translate->statusList, $translation->status);
|
||||
if($translation->status == 'rejected') echo " <span title='$translation->reason'><i class='icon icon-help'></i></span>";
|
||||
?>
|
||||
</td>
|
||||
<td rowspan='2'>
|
||||
<?php
|
||||
if($translation->status == 'translated' and common::hasPriv('translate', 'result'))
|
||||
{
|
||||
echo html::a(inlink('result', "id={$translation->id}&result=pass"), $lang->translate->resultList['pass'], '', "class='pass' data-id='{$translation->id}'");
|
||||
echo html::a(inlink('result', "id={$translation->id}&result=reject"), $lang->translate->resultList['reject'], '', "class='iframe'");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr <?php echo $hideClass;?>>
|
||||
<td><?php echo $hasNL ? nl2br(htmlspecialchars($translation->value)) : htmlspecialchars($translation->value);?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if($hasPriv):?>
|
||||
<div class="table-footer">
|
||||
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
|
||||
<div class="table-actions btn-toolbar"><?php echo html::submitButton($lang->translate->resultList['pass']);?></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<div id="mainContent" class="main-content load-indicator">
|
||||
<div class="main-header">
|
||||
<h2><?php echo $lang->translate->setting;?></h2>
|
||||
</div>
|
||||
<form class="main-form" method="post" target="hiddenwin">
|
||||
<table class="table table-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><?php echo $lang->translate->reviewTurnon;?></th>
|
||||
<td><?php echo html::radio('needReview', $lang->translate->reviewTurnonList, zget($this->config->translate, 'needReview', 0));?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
Reference in New Issue
Block a user