mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 16:59:55 +09:00
merge from 1.5.2
git-svn-id: http://xe-core.googlecode.com/svn/trunk@10446 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
6c23751ef8
commit
c727926d9e
382 changed files with 6855 additions and 3603 deletions
|
|
@ -123,6 +123,8 @@
|
|||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
// Copy a module
|
||||
$triggerObj->originModuleSrl = $module_srl;
|
||||
$triggerObj->moduleSrlList = array();
|
||||
foreach($clones as $mid => $browser_title) {
|
||||
$clone_args = null;
|
||||
$clone_args = clone($module_info);
|
||||
|
|
@ -138,8 +140,11 @@
|
|||
if(count($grant)) $oModuleController->insertModuleGrants($module_srl, $grant);
|
||||
if ($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
|
||||
|
||||
array_push($triggerObj->moduleSrlList, $module_srl);
|
||||
}
|
||||
|
||||
$output = ModuleHandler::triggerCall('module.procModuleAdminCopyModule', 'after', $triggerObj);
|
||||
|
||||
$oDB->commit();
|
||||
$this->setMessage('success_registed');
|
||||
if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) {
|
||||
|
|
@ -593,21 +598,55 @@
|
|||
$cache_path = _XE_PATH_.'files/cache/lang_defined/';
|
||||
if(!is_dir($cache_path)) FileHandler::makeDir($cache_path);
|
||||
|
||||
$lang_supported = Context::get('lang_supported');
|
||||
foreach($lang_supported as $key => $val) {
|
||||
$fp[$key] = fopen( sprintf('%s/%d.%s.php', $cache_path, $args->site_srl, $key), 'w' );
|
||||
if(!$fp[$key]) return;
|
||||
fwrite($fp[$key],"<?php if(!defined('__ZBXE__')) exit(); \r\n");
|
||||
}
|
||||
|
||||
$langMap = array();
|
||||
foreach($output->data as $key => $val) {
|
||||
if($fp[$val->lang_code]) fwrite($fp[$val->lang_code], sprintf('$lang["%s"] = "%s";'."\r\n", $val->name, str_replace('"','\\"',$val->value)));
|
||||
$langMap[$val->lang_code][$val->name] = $val->value;
|
||||
}
|
||||
|
||||
foreach($lang_supported as $key => $val) {
|
||||
if(!$fp[$key]) continue;
|
||||
fwrite($fp[$key],"?>");
|
||||
fclose($fp[$key]);
|
||||
$lang_supported = Context::get('lang_supported');
|
||||
$dbInfo = Context::getDBInfo();
|
||||
$defaultLang = $dbInfo->lang_type;
|
||||
|
||||
if(!is_array($langMap[$defaultLang]))
|
||||
{
|
||||
$langMap[$defaultLang] = array();
|
||||
}
|
||||
|
||||
foreach($lang_supported as $langCode => $langName) {
|
||||
if(!is_array($langMap[$langCode]))
|
||||
{
|
||||
$langMap[$langCode] = array();
|
||||
}
|
||||
|
||||
$langMap[$langCode] += $langMap[$defaultLang];
|
||||
foreach($lang_supported as $targetLangCode => $targetLangName)
|
||||
{
|
||||
if($langCode == $targetLangCode || $langCode == $defaultLang)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!is_array($langMap[$targetLangCode]))
|
||||
{
|
||||
$langMap[$targetLangCode] = array();
|
||||
}
|
||||
|
||||
$langMap[$langCode] += $langMap[$targetLangCode];
|
||||
}
|
||||
|
||||
$fp = fopen(sprintf('%s/%d.%s.php', $cache_path, $args->site_srl, $langCode), 'w');
|
||||
if(!$fp)
|
||||
{
|
||||
return;
|
||||
}
|
||||
fwrite($fp, "<?php if(!defined('__XE__')) exit(); \r\n");
|
||||
|
||||
foreach($langMap[$langCode] as $code => $value)
|
||||
{
|
||||
fwrite($fp, sprintf('$lang[\'%s\'] = \'%s\';', $code, addcslashes($value, "'")));
|
||||
}
|
||||
|
||||
fwrite($fp, '?>');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue