mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 03:52:15 +09:00
issue 661, cafeXE adapt to XE
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9709 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
5e43a9f656
commit
9ede5fedd2
4 changed files with 65 additions and 27 deletions
|
|
@ -23,17 +23,14 @@
|
||||||
$pc = Context::get('pc');
|
$pc = Context::get('pc');
|
||||||
$mobile = Context::get('mobile');
|
$mobile = Context::get('mobile');
|
||||||
$fixed = Context::get('fixed');
|
$fixed = Context::get('fixed');
|
||||||
$favorite = Context::get('favorite');
|
|
||||||
|
|
||||||
if (!$pc) $pc = array();
|
if (!$pc) $pc = array();
|
||||||
if (!$mobile) $mobile = array();
|
if (!$mobile) $mobile = array();
|
||||||
if (!$fixed) $fixed = array();
|
if (!$fixed) $fixed = array();
|
||||||
if (!$favorite) $favorite = array();
|
|
||||||
|
|
||||||
if (!is_array($pc)) $pc = array($pc);
|
if (!is_array($pc)) $pc = array($pc);
|
||||||
if (!is_array($mobile)) $pc = array($mobile);
|
if (!is_array($mobile)) $pc = array($mobile);
|
||||||
if (!is_array($fixed)) $pc = array($fixed);
|
if (!is_array($fixed)) $pc = array($fixed);
|
||||||
if (!is_array($favorite)) $pc = array($favorite);
|
|
||||||
|
|
||||||
// get current addon info
|
// get current addon info
|
||||||
$oModel = &getAdminModel('addon');
|
$oModel = &getAdminModel('addon');
|
||||||
|
|
@ -103,20 +100,67 @@
|
||||||
**/
|
**/
|
||||||
function procAddonAdminToggleActivate() {
|
function procAddonAdminToggleActivate() {
|
||||||
$oAddonModel = &getAdminModel('addon');
|
$oAddonModel = &getAdminModel('addon');
|
||||||
|
|
||||||
$site_module_info = Context::get('site_module_info');
|
$site_module_info = Context::get('site_module_info');
|
||||||
// batahom addon values
|
|
||||||
$addon = Context::get('addon');
|
$pc = Context::get('pc');
|
||||||
$type = Context::get('type');
|
$mobile = Context::get('mobile');
|
||||||
if(!$type) $type = "pc";
|
|
||||||
if($addon) {
|
|
||||||
// If enabled Disables
|
|
||||||
if($oAddonModel->isActivatedAddon($addon, $site_module_info->site_srl, $type)) $this->doDeactivate($addon, $site_module_info->site_srl, $type);
|
|
||||||
// If it is disabled Activate
|
|
||||||
else $this->doActivate($addon, $site_module_info->site_srl, $type);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->makeCacheFile($site_module_info->site_srl, $type);
|
if (!$pc) $pc = array();
|
||||||
|
if (!$mobile) $mobile = array();
|
||||||
|
|
||||||
|
if (!is_array($pc)) $pc = array($pc);
|
||||||
|
if (!is_array($mobile)) $pc = array($mobile);
|
||||||
|
|
||||||
|
// get current addon info
|
||||||
|
$oModel = &getAdminModel('addon');
|
||||||
|
$currentAddonList = $oModel->getAddonList($site_module_info->site_srl, 'site');
|
||||||
|
|
||||||
|
// get need update addon list
|
||||||
|
$updateList = array();
|
||||||
|
foreach($currentAddonList as $addon)
|
||||||
|
{
|
||||||
|
if ($addon->activated !== in_array($addon->addon_name, $pc))
|
||||||
|
{
|
||||||
|
$updateList[] = $addon->addon_name;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($addon->mactivated !== in_array($addon->addon_name, $mobile))
|
||||||
|
{
|
||||||
|
$updateList[] = $addon->addon_name;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// update
|
||||||
|
foreach($updateList as $targetAddon)
|
||||||
|
{
|
||||||
|
unset($args);
|
||||||
|
|
||||||
|
if (in_array($targetAddon, $pc))
|
||||||
|
$args->is_used = 'Y';
|
||||||
|
else
|
||||||
|
$args->is_used = 'N';
|
||||||
|
|
||||||
|
if (in_array($targetAddon, $mobile))
|
||||||
|
$args->is_used_m = 'Y';
|
||||||
|
else
|
||||||
|
$args->is_used_m = 'N';
|
||||||
|
|
||||||
|
$args->addon = $targetAddon;
|
||||||
|
$args->site_srl = $site_module_info->site_srl;
|
||||||
|
|
||||||
|
$output = executeQuery('addon.updateSiteAddon', $args);
|
||||||
|
if (!$output->toBool()) return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($updateList))
|
||||||
|
{
|
||||||
|
$this->makeCacheFile($site_module_info->site_srl, 'pc', 'site');
|
||||||
|
$this->makeCacheFile($site_module_info->site_srl, 'mobile', 'site');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'homepage', 'act', 'dispHomepageComponent'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -124,6 +168,7 @@
|
||||||
**/
|
**/
|
||||||
function procAddonAdminSetupAddon() {
|
function procAddonAdminSetupAddon() {
|
||||||
$args = Context::getRequestVars();
|
$args = Context::getRequestVars();
|
||||||
|
$module = $args->module;
|
||||||
$addon_name = $args->addon_name;
|
$addon_name = $args->addon_name;
|
||||||
unset($args->module);
|
unset($args->module);
|
||||||
unset($args->act);
|
unset($args->act);
|
||||||
|
|
@ -139,7 +184,7 @@
|
||||||
$this->makeCacheFile($site_module_info->site_srl, "pc", 'site');
|
$this->makeCacheFile($site_module_info->site_srl, "pc", 'site');
|
||||||
$this->makeCacheFile($site_module_info->site_srl, "mobile", 'site');
|
$this->makeCacheFile($site_module_info->site_srl, "mobile", 'site');
|
||||||
|
|
||||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAddonAdminSetup', 'selected_addon', $addon_name));
|
$this->setRedirectUrl(getNotEncodedUrl('', 'module', $module, 'act', 'dispAddonAdminSetup', 'selected_addon', $addon_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,3 @@ function doToggleAddon(addon, type) {
|
||||||
fo_obj.type.value = type;
|
fo_obj.type.value = type;
|
||||||
procFilter(fo_obj, toggle_activate_addon);
|
procFilter(fo_obj, toggle_activate_addon);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 관리자 제어판 페이지용
|
|
||||||
function doToggleAddonInAdmin(obj, addon, type) {
|
|
||||||
var params = new Array();
|
|
||||||
params['addon'] = addon;
|
|
||||||
if(typeof(type) == "undefined") type = "pc";
|
|
||||||
params['type'] = type;
|
|
||||||
exec_xml('addon','procAddonAdminToggleActivate',params,function() { if(/Active/.test(obj.className)) obj.className = "buttonSet buttonDisable"; else obj.className = "buttonSet buttonActive"; } );
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||||
</div>
|
</div>
|
||||||
<form action="./" method="post" class="form">
|
<form action="./" method="post" class="form">
|
||||||
<input type="hidden" name="module" value="addon" />
|
<input type="hidden" name="module" value="{$module}" />
|
||||||
<input type="hidden" name="act" value="procAddonAdminSetupAddon" />
|
<input type="hidden" name="act" value="procAddonAdminSetupAddon" />
|
||||||
<input type="hidden" name="addon_name" value="{$addon_info->addon_name}" />
|
<input type="hidden" name="addon_name" value="{$addon_info->addon_name}" />
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,9 @@
|
||||||
Context::set('page', $output->page);
|
Context::set('page', $output->page);
|
||||||
Context::set('lang_code_list', $output->data);
|
Context::set('lang_code_list', $output->data);
|
||||||
Context::set('page_navigation', $output->page_navigation);
|
Context::set('page_navigation', $output->page_navigation);
|
||||||
|
|
||||||
|
$this->setLayoutPath('./common/tpl');
|
||||||
|
$this->setLayoutFile('popup_layout');
|
||||||
// Set a template file
|
// Set a template file
|
||||||
$this->setTemplateFile('module_langcode');
|
$this->setTemplateFile('module_langcode');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue