* mereg zentaophp framework to zentao.

This commit is contained in:
wangyidong
2017-06-09 17:06:18 +08:00
parent c27f1f7d34
commit a37df65bc8
11 changed files with 1514 additions and 1364 deletions
+31 -1
View File
@@ -77,7 +77,32 @@ class router extends baseRouter
$lang->projectCommon = isset($this->config->projectCommonList[$this->clientLang][(int)$projectCommon]) ? $this->config->projectCommonList[$this->clientLang][(int)$projectCommon] : $this->config->projectCommonList['zh-cn'][0];
}
return parent::loadLang($moduleName, $appName);
parent::loadLang($moduleName, $appName);
/* Merge from the db lang. */
if($moduleName != 'common' and isset($lang->db->custom[$moduleName]))
{
foreach($lang->db->custom[$moduleName] as $section => $fields)
{
if(isset($lang->{$moduleName}->{$section}['']))
{
$nullKey = '';
$nullValue = $lang->{$moduleName}->{$section}[$nullKey];
}
elseif(isset($lang->{$moduleName}->{$section}[0]))
{
$nullKey = 0;
$nullValue = $lang->{$moduleName}->{$section}[0];
}
unset($lang->{$moduleName}->{$section});
if(isset($nullKey))$lang->{$moduleName}->{$section}[$nullKey] = $nullValue;
foreach($fields as $key => $value) $lang->{$moduleName}->{$section}[$key] = $value;
unset($nullKey);
unset($nullValue);
}
}
return $lang;
}
/**
@@ -99,4 +124,9 @@ class router extends baseRouter
if(isset($fatalLevel[$level])) $this->config->debug = true;
parent::saveError($level, $message, $file, $line);
}
public function loadConfig($moduleName, $appName = '')
{
return parent::loadModuleConfig($moduleName, $appName);
}
}