mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Merge branch 'develop' into pr/change-object
This commit is contained in:
commit
03d74a984f
19 changed files with 179 additions and 134 deletions
|
|
@ -470,7 +470,7 @@ class DB
|
|||
}
|
||||
if(!$this->db_type)
|
||||
{
|
||||
return;
|
||||
return new BaseObject(-1, 'msg_db_not_setted');
|
||||
}
|
||||
|
||||
$this->actDBClassStart();
|
||||
|
|
@ -493,7 +493,7 @@ class DB
|
|||
if(!isset($typeList[$target]))
|
||||
{
|
||||
$this->actDBClassFinish();
|
||||
return;
|
||||
return new BaseObject(-1, 'msg_invalid_queryid');
|
||||
}
|
||||
$module = $id_args[1];
|
||||
$id = $id_args[2];
|
||||
|
|
|
|||
|
|
@ -30,7 +30,9 @@ class Config
|
|||
{
|
||||
if (file_exists(\RX_BASEDIR . self::$config_filename))
|
||||
{
|
||||
ob_start();
|
||||
self::$_config = (include \RX_BASEDIR . self::$config_filename);
|
||||
ob_end_clean();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ class ConfigParser
|
|||
// Load DB info file.
|
||||
if (file_exists(\RX_BASEDIR . Config::$old_db_config_filename))
|
||||
{
|
||||
ob_start();
|
||||
include \RX_BASEDIR . Config::$old_db_config_filename;
|
||||
ob_end_clean();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -32,7 +34,9 @@ class ConfigParser
|
|||
// Load FTP info file.
|
||||
if (file_exists(\RX_BASEDIR . Config::$old_ftp_config_filename))
|
||||
{
|
||||
ob_start();
|
||||
include \RX_BASEDIR . Config::$old_ftp_config_filename;
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
// Load selected language file.
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@
|
|||
URITemplate : window.URITemplate,
|
||||
SecondLevelDomains : window.SecondLevelDomains,
|
||||
IPv6 : window.IPv6,
|
||||
baseurl : null,
|
||||
|
||||
/**
|
||||
* @brief 특정 name을 가진 체크박스들의 checked 속성 변경
|
||||
|
|
@ -198,6 +199,9 @@
|
|||
|
||||
/* 동일 사이트 내 주소인지 판단 (프로토콜 제외) */
|
||||
isSameHost: function(url) {
|
||||
if (typeof url !== "string") {
|
||||
return false;
|
||||
}
|
||||
if (url.match(/^\/[^\/]/)) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -205,16 +209,21 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
var site_baseurl = window.XE.URI(window.request_uri).normalizePort().normalizePathname();
|
||||
site_baseurl = site_baseurl.hostname() + site_baseurl.directory();
|
||||
if (!window.XE.baseurl) {
|
||||
window.XE.baseurl = window.XE.URI(window.request_uri).normalizePort().normalizePathname();
|
||||
window.XE.baseurl = window.XE.baseurl.hostname() + window.XE.baseurl.directory();
|
||||
}
|
||||
|
||||
var target_url = window.XE.URI(url).normalizePort().normalizePathname();
|
||||
if (target_url.is("urn")) {
|
||||
return false;
|
||||
}
|
||||
if (!target_url.hostname()) {
|
||||
target_url = target_url.absoluteTo(window.request_uri);
|
||||
}
|
||||
target_url = target_url.hostname() + target_url.directory();
|
||||
|
||||
return target_url.indexOf(site_baseurl) === 0;
|
||||
return target_url.indexOf(window.XE.baseurl) === 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -233,8 +242,8 @@ jQuery(function($) {
|
|||
/* Tabnapping protection, step 1 */
|
||||
$('a[target]').each(function() {
|
||||
var $this = $(this);
|
||||
var href = $this.attr('href');
|
||||
var target = $this.attr('target');
|
||||
var href = $this.attr('href').trim();
|
||||
var target = $this.attr('target').trim();
|
||||
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
|
||||
return;
|
||||
}
|
||||
|
|
@ -250,8 +259,8 @@ jQuery(function($) {
|
|||
/* Tabnapping protection, step 2 */
|
||||
$('body').on('click', 'a[target]', function(event) {
|
||||
var $this = $(this);
|
||||
var href = $this.attr('href');
|
||||
var target = $this.attr('target');
|
||||
var href = $this.attr('href').trim();
|
||||
var target = $this.attr('target').trim();
|
||||
if (!href || !target || target === '_top' || target === '_self' || target === '_parent') {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ class adminAdminController extends admin
|
|||
return $output;
|
||||
}
|
||||
|
||||
Rhymix\Framework\Cache::delete('admin_menu_langs:' . Context::getLangType());
|
||||
Rhymix\Framework\Storage::deleteDirectory(\RX_BASEDIR . 'files/cache/menu/admin_lang/');
|
||||
|
||||
$this->setRedirectUrl(Context::get('error_return_url'));
|
||||
|
|
|
|||
|
|
@ -624,38 +624,33 @@ class adminAdminModel extends admin
|
|||
*/
|
||||
function getAdminMenuLang()
|
||||
{
|
||||
$currentLang = Context::getLangType();
|
||||
$cacheFile = sprintf('./files/cache/menu/admin_lang/adminMenu.%s.lang.php', $currentLang);
|
||||
|
||||
// Update if no cache file exists or it is older than xml file
|
||||
if(!is_readable($cacheFile))
|
||||
static $lang = null;
|
||||
|
||||
if ($lang === null)
|
||||
{
|
||||
$lang = new stdClass();
|
||||
$lang = Rhymix\Framework\Cache::get('admin_menu_langs:' . Context::getLangType());
|
||||
}
|
||||
if ($lang === null)
|
||||
{
|
||||
$lang = array();
|
||||
$oModuleModel = getModel('module');
|
||||
$installed_module_list = $oModuleModel->getModulesXmlInfo();
|
||||
|
||||
$this->gnbLangBuffer = '<?php $lang = new stdClass();';
|
||||
foreach($installed_module_list AS $key => $value)
|
||||
foreach($installed_module_list as $key => $value)
|
||||
{
|
||||
$moduleActionInfo = $oModuleModel->getModuleActionXml($value->module);
|
||||
if(is_object($moduleActionInfo->menu))
|
||||
{
|
||||
foreach($moduleActionInfo->menu AS $key2 => $value2)
|
||||
foreach($moduleActionInfo->menu as $key2 => $value2)
|
||||
{
|
||||
$lang->menu_gnb_sub[$key2] = $value2->title;
|
||||
$this->gnbLangBuffer .=sprintf('$lang->menu_gnb_sub[\'%s\'] = \'%s\';', $key2, $value2->title);
|
||||
$lang[$key2] = $value2->title;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->gnbLangBuffer .= ' ?>';
|
||||
FileHandler::writeFile($cacheFile, $this->gnbLangBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
include $cacheFile;
|
||||
|
||||
Rhymix\Framework\Cache::set('admin_menu_langs:' . Context::getLangType(), $lang, 0, true);
|
||||
}
|
||||
|
||||
return $lang->menu_gnb_sub;
|
||||
return $lang;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2299,7 +2299,7 @@ class documentController extends document
|
|||
{
|
||||
foreach($langs as $key => $val)
|
||||
{
|
||||
$xml_header_buff .= sprintf('$_titles[%d]["%s"] = "%s"; ', $category_srl, $key, str_replace('"','\\"',htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)));
|
||||
$xml_header_buff .= sprintf('$_titles[%d][%s] = %s; ', $category_srl, var_export($key, true), var_export(escape($val, false), true));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2308,12 +2308,12 @@ class documentController extends document
|
|||
{
|
||||
foreach($langx as $key => $val)
|
||||
{
|
||||
$xml_header_buff .= sprintf('$_descriptions[%d]["%s"] = "%s"; ', $category_srl, $key, str_replace('"','\\"',htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)));
|
||||
$xml_header_buff .= sprintf('$_descriptions[%d][%s] = %s; ', $category_srl, var_export($key, true), var_export(escape($val, false), true));
|
||||
}
|
||||
}
|
||||
|
||||
$attribute = sprintf(
|
||||
'mid="%s" module_srl="%d" node_srl="%d" parent_srl="%d" category_srl="%d" text="<?php echo (%s?($_titles[%d][$lang_type]):"")?>" url="%s" expand="%s" color="%s" description="<?php echo (%s?($_descriptions[%d][$lang_type]):"")?>" document_count="%d" ',
|
||||
'mid="%s" module_srl="%d" node_srl="%d" parent_srl="%d" category_srl="%d" text="<?php echo (%s?($_titles[%d][$lang_type]):"")?>" url=%s expand=%s color=%s description="<?php echo (%s?($_descriptions[%d][$lang_type]):"")?>" document_count="%d" ',
|
||||
$mid,
|
||||
$module_srl,
|
||||
$category_srl,
|
||||
|
|
@ -2321,9 +2321,9 @@ class documentController extends document
|
|||
$category_srl,
|
||||
$group_check_code,
|
||||
$category_srl,
|
||||
getUrl('','mid',$node->mid,'category',$category_srl),
|
||||
$expand,
|
||||
htmlspecialchars($color, ENT_COMPAT | ENT_HTML401, 'UTF-8', false),
|
||||
str_replace("'", '"', var_export(getUrl('','mid',$node->mid,'category',$category_srl), true)),
|
||||
str_replace("'", '"', var_export($expand, true)),
|
||||
str_replace("'", '"', var_export(escape($color, false), true)),
|
||||
$group_check_code,
|
||||
$category_srl,
|
||||
$node->document_count
|
||||
|
|
@ -2388,10 +2388,10 @@ class documentController extends document
|
|||
{
|
||||
$val = htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
||||
$php_header_buff .= sprintf(
|
||||
'$_titles[%d]["%s"] = "%s"; ',
|
||||
'$_titles[%d][%s] = %s; ',
|
||||
$category_srl,
|
||||
$key,
|
||||
str_replace('"','\\"', $val)
|
||||
var_export($key, true),
|
||||
var_export($val, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -2404,17 +2404,17 @@ class documentController extends document
|
|||
{
|
||||
$val = htmlspecialchars($val, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
|
||||
$php_header_buff .= sprintf(
|
||||
'$_descriptions[%d]["%s"] = "%s"; ',
|
||||
'$_descriptions[%d][%s] = %s; ',
|
||||
$category_srl,
|
||||
$key,
|
||||
str_replace('"','\\"', $val)
|
||||
var_export($key, true),
|
||||
var_export($val, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Create attributes(Use the category_srl_list to check whether to belong to the menu's node. It seems to be tricky but fast fast and powerful;)
|
||||
$attribute = sprintf(
|
||||
'"mid" => "%s", "module_srl" => "%d","node_srl"=>"%s","category_srl"=>"%s","parent_srl"=>"%s","text"=>$_titles[%d][$lang_type],"selected"=>(in_array(Context::get("category"),array(%s))?1:0),"expand"=>"%s","color"=>"%s","description"=>$_descriptions[%d][$lang_type],"list"=>array(%s),"document_count"=>"%d","grant"=>%s?true:false',
|
||||
'"mid" => "%s", "module_srl" => "%d","node_srl"=>"%d","category_srl"=>"%d","parent_srl"=>"%d","text"=>$_titles[%d][$lang_type],"selected"=>(in_array(Context::get("category"),array(%s))?1:0),"expand"=>%s,"color"=>%s,"description"=>$_descriptions[%d][$lang_type],"list"=>array(%s),"document_count"=>"%d","grant"=>%s?true:false',
|
||||
$node->mid,
|
||||
$node->module_srl,
|
||||
$node->category_srl,
|
||||
|
|
@ -2422,8 +2422,8 @@ class documentController extends document
|
|||
$node->parent_srl,
|
||||
$node->category_srl,
|
||||
$selected,
|
||||
$expand,
|
||||
$node->color,
|
||||
var_export($expand, true),
|
||||
var_export($node->color, true),
|
||||
$node->category_srl,
|
||||
$child_buff,
|
||||
$node->document_count,
|
||||
|
|
|
|||
|
|
@ -492,7 +492,7 @@ class memberAdminController extends member
|
|||
$signupItem->required = in_array($key, $orgRequireds);
|
||||
$signupItem->isUse = ($config->{$key} == 'Y') || in_array($key, $orgUse);
|
||||
$signupItem->isPublic = ($signupItem->isUse) ? 'Y' : 'N';
|
||||
if($key == 'password')
|
||||
if(in_array($key, array('find_account_question', 'password', 'email_address')))
|
||||
{
|
||||
$signupItem->isPublic = 'N';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,24 +164,25 @@ class memberAdminView extends member
|
|||
*/
|
||||
public function dispMemberAdminAgreementsEdit()
|
||||
{
|
||||
$agreement_id = intval(Context::get('id'));
|
||||
Context::set('agreement_id', $agreement_id);
|
||||
Context::set('agreement_content', getModel('member')->getMemberConfig()->agreements[$agreement_id]->content);
|
||||
// Check parent input ID
|
||||
$parent_input_id = Context::get('parent_input_id');
|
||||
Context::addBodyClass('disable_debug_panel');
|
||||
|
||||
// Load editor
|
||||
$oEditorModel = getModel('editor');
|
||||
$option = $oEditorModel->getEditorConfig();
|
||||
$option->primary_key_name = 'agreement_id';
|
||||
$option->content_key_name = 'agreement_content';
|
||||
$option->primary_key_name = 'primary_key';
|
||||
$option->content_key_name = 'content';
|
||||
$option->allow_fileupload = FALSE;
|
||||
$option->enable_autosave = FALSE;
|
||||
$option->enable_default_component = TRUE;
|
||||
$option->enable_component = FALSE;
|
||||
$option->height = 300;
|
||||
$option->editor_focus = 'N';
|
||||
$editor = $oEditorModel->getEditor($logged_info->member_srl, $option);
|
||||
$option->editor_focus = 'Y';
|
||||
$editor = $oEditorModel->getEditor(0, $option);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
// Set template
|
||||
$this->setLayoutPath('./common/tpl/');
|
||||
$this->setLayoutFile("default_layout");
|
||||
$this->setTemplateFile('agreements_edit');
|
||||
|
|
|
|||
|
|
@ -177,6 +177,7 @@ class member extends ModuleObject {
|
|||
{
|
||||
$oDB = &DB::getInstance();
|
||||
$oModuleModel = getModel('module');
|
||||
|
||||
// check member directory (11/08/2007 added)
|
||||
if(!is_dir("./files/member_extra_info")) return true;
|
||||
// check member directory (22/10/2007 added)
|
||||
|
|
@ -216,7 +217,14 @@ class member extends ModuleObject {
|
|||
if(!$config->signupForm || !is_array($config->signupForm)) return true;
|
||||
foreach($config->signupForm as $signupItem)
|
||||
{
|
||||
if($signupItem->name === 'find_account_question') return true;
|
||||
if($signupItem->name === 'find_account_question')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if($signupItem->name === 'email_address' && $signupItem->isPublic !== 'N')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(!$config->agreements)
|
||||
{
|
||||
|
|
@ -357,7 +365,11 @@ class member extends ModuleObject {
|
|||
$config->identifier = $config->identifier ?: 'user_id';
|
||||
$config->signupForm = $oMemberAdminController->createSignupForm($config->identifier);
|
||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
||||
break;
|
||||
}
|
||||
if($signupItem->name === 'email_address' && $signupItem->isPublic !== 'N')
|
||||
{
|
||||
$signupItem->isPublic = 'N';
|
||||
$output = $oModuleController->updateModuleConfig('member', $config);
|
||||
}
|
||||
}
|
||||
if(!$config->agreements)
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@
|
|||
<div class="x_control-group">
|
||||
<div class="x_control-label">{$lang->cmd_agreement_content}</div>
|
||||
<div class="x_controls">
|
||||
<input type="hidden" name="agreement_{$i}_content" id="agreement_{$i}_content" value="{escape($config->agreements[$i]->content)}" />
|
||||
<iframe id="agreement_{$i}_iframe" class="agreement_iframe" src="{getUrl('act', 'dispMemberAdminAgreementsEdit', 'id', $i)}"></iframe>
|
||||
<input type="hidden" class="editor_content" name="agreement_{$i}_content" id="agreement_{$i}_content" value="{escape($config->agreements[$i]->content)}" />
|
||||
<div class="editor_preview xe_content" tabindex="0">{$config->agreements[$i]->content}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
|
|
|
|||
|
|
@ -2,27 +2,31 @@
|
|||
$(function() {
|
||||
var editor;
|
||||
var parent = window.opener ? window.opener : window.parent;
|
||||
var parent_input = $("#{$parent_input_id}", parent.document);
|
||||
var parent_iframe = parent_input.siblings("iframe.editor_iframe");
|
||||
CKEDITOR.on('instanceReady', function(evt) {
|
||||
editor = evt.editor;
|
||||
editor.setData(parent_input.val());
|
||||
editor.on("resize", function(evt){
|
||||
var height = evt.data.outerHeight;
|
||||
$("#agreement_{$agreement_id}_iframe", parent.document).height(height);
|
||||
parent_iframe.height(height);
|
||||
});
|
||||
editor.on("change", function() {
|
||||
var content = editor.getData();
|
||||
$("#agreement_{$agreement_id}_content", parent.document).val(content);
|
||||
parent_input.val(content);
|
||||
});
|
||||
$("#agreement_{$agreement_id}_iframe", parent.document).height($(".cke_chrome").first().parent().height());
|
||||
parent_iframe.height($(".cke_chrome").parent().height());
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
body { margin: 0; }
|
||||
.wfsr { display: none; }
|
||||
</style>
|
||||
|
||||
<form>
|
||||
<input type="hidden" name="agreement_id" id="agreement_id" value="{$agreement_id}" />
|
||||
<input type="hidden" name="agreement_content" id="agreement_content" value="{escape($agreement_content)}" />
|
||||
<input type="hidden" name="primary_key" id="primary_key" value="" />
|
||||
<input type="hidden" name="content" id="content" value="" />
|
||||
{$editor}
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,22 @@
|
|||
.agreement_iframe {
|
||||
display: inline-block;
|
||||
.editor_preview {
|
||||
width: 100%;
|
||||
min-height: 240px;
|
||||
max-height: 440px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: -4px;
|
||||
margin: 0;
|
||||
padding: 6px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
|
||||
overflow-y: auto;
|
||||
cursor: text;
|
||||
}
|
||||
|
||||
.editor_iframe {
|
||||
width: 100%;
|
||||
height: 440px;
|
||||
box-sizing: border-box;
|
||||
margin: 0 0 -4px 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
height: 440px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
(function($) {
|
||||
|
||||
// Editor replacement callback function
|
||||
var editor_replace = function(input) {
|
||||
var iframe = $('<iframe class="editor_iframe"></iframe>');
|
||||
iframe.attr("src", current_url.setQuery("act", "dispMemberAdminAgreementsEdit").setQuery("parent_input_id", input.attr("id")));
|
||||
iframe.insertAfter(input);
|
||||
input.siblings(".editor_preview").hide();
|
||||
if (input.attr("type") !== "hidden") {
|
||||
input.hide();
|
||||
}
|
||||
};
|
||||
|
||||
// Editor replacement
|
||||
$(function() {
|
||||
$(".editor_preview").on("click", function() {
|
||||
var input = $(this).siblings(".editor_content");
|
||||
if (input.size()) {
|
||||
$(this).off("click").off("focus");
|
||||
editor_replace(input.first());
|
||||
}
|
||||
});
|
||||
$(".editor_preview").on("focus", function() {
|
||||
$(this).triggerHandler("click");
|
||||
});
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
|
@ -1,9 +1,4 @@
|
|||
jQuery(function($){
|
||||
$('input[name=enable_join]').click(function(){
|
||||
var checked = $('input[name=enable_join]:checked').val();
|
||||
enableSignUpTab(checked == 'Y');
|
||||
});
|
||||
|
||||
$('.__sync').click(function (){
|
||||
exec_xml(
|
||||
'importer', // module
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@
|
|||
</thead>
|
||||
<tbody class="uDrag">
|
||||
{@ $disabled_list = array('find_account_question')}
|
||||
{@ $fixed_public_list = array('nick_name', 'password')}
|
||||
{@ $fixed_public_list = array('nick_name', 'password', 'email_address')}
|
||||
<!--@foreach($config->signupForm as $item)-->
|
||||
<!--@if(in_array($item->name, $disabled_list))-->
|
||||
<!--@elseif($item->isIdentifier)-->
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
</th>
|
||||
<td style="text-align:center"><input type="radio" name="identifier" value="{$item->name}" checked="checked" /></td>
|
||||
<td style="text-align:center"><input type="checkbox" name="usable_list[]" value="{$item->name}" title="{$lang->use}" checked="checked" disabled="disabled" /></td>
|
||||
<td style="text-align:center"><input type="checkbox" name="is_{$item->name}_public" value="Y" checked="checked"|cond="$item->isPublic == 'Y'"/></td>
|
||||
<td style="text-align:center"><input type="checkbox" name="is_{$item->name}_public" value="Y" checked="checked"|cond="$item->isPublic == 'Y'" disabled="disabled"|cond="in_array($item->name, $fixed_public_list) || !$item->isUse" /></td>
|
||||
<td class="nowr">
|
||||
<label for="{$item->name}_re" class="x_inline"><input type="radio" id="{$item->name}_re" name="{$item->name}" value="requierd" checked="checked" disabled="disabled" /> {$lang->cmd_required}</label>
|
||||
<label for="{$item->name}_op" class="x_inline"><input type="radio" id="{$item->name}_op" name="{$item->name}" value="option" disabled="disabled" /> {$lang->cmd_optional}</label>
|
||||
|
|
|
|||
|
|
@ -1896,7 +1896,7 @@ class menuAdminController extends menu
|
|||
$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
|
||||
foreach($names as $key => $val)
|
||||
{
|
||||
$name_arr_str .= sprintf('"%s"=>%s,', $key, var_export($val, true));
|
||||
$name_arr_str .= sprintf('%s => %s, ', var_export($key, true), var_export($val, true));
|
||||
}
|
||||
$name_str = sprintf('$_names = array(%s); print $_names[$lang_type];', $name_arr_str);
|
||||
|
||||
|
|
@ -1940,23 +1940,23 @@ class menuAdminController extends menu
|
|||
if($group_srls)$group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s))))||($is_logged&&%s))',$group_srls,$group_srls == -1?1:0);
|
||||
else $group_check_code = "true";
|
||||
$attribute = sprintf(
|
||||
'node_srl="%s" parent_srl="%s" menu_name_key=\'%s\' text="<?php if(%s) { %s }?>" url="<?php print(%s?"%s":"")?>" href="<?php print(%s?%s:"")?>" is_shortcut="%s" desc="%s" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="<?php if(%s) {?>%s<?php }?>"',
|
||||
'node_srl="%d" parent_srl="%d" menu_name_key=%s text="<?php if(%s) { %s }?>" url="<?php print(%s?%s:"")?>" href="<?php print(%s?%s:"")?>" is_shortcut=%s desc=%s open_window=%s expand=%s normal_btn=%s hover_btn=%s active_btn=%s link="<?php if(%s) {?>%s<?php }?>"',
|
||||
$menu_item_srl,
|
||||
$node->parent_srl,
|
||||
addslashes($node->name),
|
||||
var_export($node->name, true),
|
||||
$group_check_code,
|
||||
$name_str,
|
||||
$group_check_code,
|
||||
$url,
|
||||
var_export($url, true),
|
||||
$group_check_code,
|
||||
$href,
|
||||
$is_shortcut,
|
||||
$desc,
|
||||
$open_window,
|
||||
$expand,
|
||||
$normal_btn,
|
||||
$hover_btn,
|
||||
$active_btn,
|
||||
var_export($is_shortcut, true),
|
||||
var_export($desc, true),
|
||||
var_export($open_window, true),
|
||||
var_export($expand, true),
|
||||
var_export($normal_btn, true),
|
||||
var_export($hover_btn, true),
|
||||
var_export($active_btn, true),
|
||||
$group_check_code,
|
||||
$link
|
||||
);
|
||||
|
|
@ -2069,26 +2069,26 @@ class menuAdminController extends menu
|
|||
}
|
||||
// Create properties (check if it belongs to the menu node by url_list. It looks a trick but fast and powerful)
|
||||
$attribute = sprintf(
|
||||
'"node_srl" => %d, "parent_srl" => %d, "menu_name_key" => \'%s\', "isShow" => (%s ? true : false), "text" => (%s ? $_menu_names[%d][$lang_type] : ""), "href" => (%s ? %s : ""), "url" => (%s ? "%s" : ""), "is_shortcut" => "%s", "desc" => \'%s\', "open_window" => "%s", "normal_btn" => "%s", "hover_btn" => "%s", "active_btn" => "%s", "selected" => (array(%s) && in_array(Context::get("mid"), array(%s)) ? 1 : 0), "expand" => \'%s\', "list" => array(%s), "link" => (%s ? (array(%s) && in_array(Context::get("mid"), array(%s)) ? %s : %s) : ""),',
|
||||
'"node_srl" => %d, "parent_srl" => %d, "menu_name_key" => %s, "isShow" => (%s ? true : false), "text" => (%s ? $_menu_names[%d][$lang_type] : ""), "href" => (%s ? %s : ""), "url" => (%s ? %s : ""), "is_shortcut" => %s, "desc" => %s, "open_window" => %s, "normal_btn" => %s, "hover_btn" => %s, "active_btn" => %s, "selected" => (array(%s) && in_array(Context::get("mid"), array(%s)) ? 1 : 0), "expand" => %s, "list" => array(%s), "link" => (%s ? (array(%s) && in_array(Context::get("mid"), array(%s)) ? %s : %s) : ""),',
|
||||
$node->menu_item_srl,
|
||||
$node->parent_srl,
|
||||
strip_tags(addslashes($node->name)),
|
||||
var_export(strip_tags($node->name), true),
|
||||
$group_check_code,
|
||||
$group_check_code,
|
||||
$node->menu_item_srl,
|
||||
$group_check_code,
|
||||
$href,
|
||||
$group_check_code,
|
||||
$url,
|
||||
$is_shortcut,
|
||||
$desc,
|
||||
$open_window,
|
||||
$normal_btn,
|
||||
$hover_btn,
|
||||
$active_btn,
|
||||
var_export($url, true),
|
||||
var_export($is_shortcut, true),
|
||||
var_export($desc, true),
|
||||
var_export($open_window, true),
|
||||
var_export($normal_btn, true),
|
||||
var_export($hover_btn, true),
|
||||
var_export($active_btn, true),
|
||||
$selected,
|
||||
$selected,
|
||||
$expand,
|
||||
var_export($expand, true),
|
||||
$child_buff,
|
||||
$group_check_code,
|
||||
$selected,
|
||||
|
|
|
|||
|
|
@ -864,14 +864,11 @@ class moduleAdminController extends module
|
|||
}
|
||||
$output = executeQueryArray('module.getLang', $args);
|
||||
if(!$output->toBool() || !$output->data) return;
|
||||
// Set the cache directory
|
||||
$cache_path = _XE_PATH_.'files/cache/lang_defined/';
|
||||
FileHandler::makeDir($cache_path);
|
||||
|
||||
$langMap = array();
|
||||
foreach($output->data as $val)
|
||||
foreach($output->data as $lang)
|
||||
{
|
||||
$langMap[$val->lang_code][$val->name] = $val->value;
|
||||
$langMap[$lang->lang_code][$lang->name] = $lang->value;
|
||||
}
|
||||
|
||||
$lang_supported = Context::loadLangSelected();
|
||||
|
|
@ -904,17 +901,11 @@ class moduleAdminController extends module
|
|||
|
||||
$langMap[$langCode] += $langMap[$targetLangCode];
|
||||
}
|
||||
|
||||
$buff = array("<?php if(!defined('__XE__')) exit();");
|
||||
foreach($langMap[$langCode] as $code => $value)
|
||||
{
|
||||
$buff[] = sprintf('$lang[%s] = %s;', var_export(strval($code), true), var_export(strval($value), true));
|
||||
}
|
||||
if (!Rhymix\Framework\Storage::write(sprintf('%s/%d.%s.php', $cache_path, $args->site_srl, $langCode), implode(PHP_EOL, $buff)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Rhymix\Framework\Cache::set('site_and_module:user_defined_langs:' . $args->site_srl . ':' . $langCode, $langMap[$langCode], 0, true);
|
||||
}
|
||||
|
||||
return $langMap[Context::getLangType()];
|
||||
}
|
||||
|
||||
public function procModuleAdminSetDesignInfo()
|
||||
|
|
|
|||
|
|
@ -1041,45 +1041,34 @@ class moduleController extends module
|
|||
* @brief Change user-defined language
|
||||
*/
|
||||
function replaceDefinedLangCode(&$output, $isReplaceLangCode = true)
|
||||
{
|
||||
if($isReplaceLangCode)
|
||||
{
|
||||
$output = preg_replace_callback('!\$user_lang->([a-z0-9\_]+)!is', array($this,'_replaceLangCode'), $output);
|
||||
}
|
||||
}
|
||||
|
||||
function _replaceLangCode($matches)
|
||||
{
|
||||
static $lang = null;
|
||||
|
||||
if(is_null($lang))
|
||||
if($isReplaceLangCode)
|
||||
{
|
||||
$cache_file = sprintf('%sfiles/cache/lang_defined/%d.%s.php', _XE_PATH_, 0, Context::getLangType());
|
||||
if(!file_exists($cache_file))
|
||||
if($lang === null)
|
||||
{
|
||||
$oModuleAdminController = getAdminController('module');
|
||||
$oModuleAdminController->makeCacheDefinedLangCode(0);
|
||||
}
|
||||
|
||||
if(file_exists($cache_file))
|
||||
{
|
||||
$moduleAdminControllerMtime = filemtime(_XE_PATH_ . 'modules/module/module.admin.controller.php');
|
||||
$cacheFileMtime = filemtime($cache_file);
|
||||
if($cacheFileMtime < $moduleAdminControllerMtime)
|
||||
$lang = Rhymix\Framework\Cache::get('site_and_module:user_defined_langs:' . $args->site_srl . ':' . Context::getLangType());
|
||||
if($lang === null)
|
||||
{
|
||||
$oModuleAdminController = getAdminController('module');
|
||||
$oModuleAdminController->makeCacheDefinedLangCode(0);
|
||||
$lang = $oModuleAdminController->makeCacheDefinedLangCode($site_module_info->site_srl);
|
||||
}
|
||||
|
||||
require_once($cache_file);
|
||||
}
|
||||
|
||||
$output = preg_replace_callback('!\$user_lang->([a-z0-9\_]+)!is', function($matches) use($lang) {
|
||||
if(isset($lang[$matches[1]]) && !Context::get($matches[1]))
|
||||
{
|
||||
return $lang[$matches[1]];
|
||||
}
|
||||
else
|
||||
{
|
||||
return str_replace('$user_lang->', '', $matches[0]);
|
||||
}
|
||||
}, $output);
|
||||
}
|
||||
if(!Context::get($matches[1]) && $lang[$matches[1]]) return $lang[$matches[1]];
|
||||
|
||||
return str_replace('$user_lang->','',$matches[0]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Add and update a file into the file box
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue