* Fix bug 1315

This commit is contained in:
滔哥
2017-12-04 13:32:17 +08:00
parent aaada03ccf
commit 11ad8f1d95
+8 -1
View File
@@ -21,11 +21,18 @@ class customModel extends model
{
$allCustomLang = $this->dao->select('*')->from(TABLE_LANG)->orderBy('lang,id')->fetchAll('id');
$currentLang = $this->app->getClientLang();
$currentLang = $this->app->getClientLang();
$sectionLang = array();
foreach($allCustomLang as $customLang)
{
$sectionLang[$customLang->module][$customLang->section][$customLang->lang] = $customLang->lang;
}
$processedLang = array();
foreach($allCustomLang as $id => $customLang)
{
if($customLang->lang != $currentLang and $customLang->lang != 'all') continue;
if(isset($sectionLang[$customLang->module][$customLang->section]['all']) && isset($sectionLang[$customLang->module][$customLang->section][$currentLang]) && $customLang->lang == 'all') continue;
$processedLang[$customLang->module][$customLang->section][$customLang->key] = $customLang->value;
}