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:
chschy 2011-10-21 08:28:23 +00:00
parent 5e43a9f656
commit 9ede5fedd2
4 changed files with 65 additions and 27 deletions

View file

@ -23,17 +23,14 @@
$pc = Context::get('pc');
$mobile = Context::get('mobile');
$fixed = Context::get('fixed');
$favorite = Context::get('favorite');
if (!$pc) $pc = array();
if (!$mobile) $mobile = array();
if (!$fixed) $fixed = array();
if (!$favorite) $favorite = array();
if (!is_array($pc)) $pc = array($pc);
if (!is_array($mobile)) $pc = array($mobile);
if (!is_array($fixed)) $pc = array($fixed);
if (!is_array($favorite)) $pc = array($favorite);
// get current addon info
$oModel = &getAdminModel('addon');
@ -103,20 +100,67 @@
**/
function procAddonAdminToggleActivate() {
$oAddonModel = &getAdminModel('addon');
$site_module_info = Context::get('site_module_info');
// batahom addon values
$addon = Context::get('addon');
$type = Context::get('type');
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);
}
$pc = Context::get('pc');
$mobile = Context::get('mobile');
$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() {
$args = Context::getRequestVars();
$module = $args->module;
$addon_name = $args->addon_name;
unset($args->module);
unset($args->act);
@ -139,7 +184,7 @@
$this->makeCacheFile($site_module_info->site_srl, "pc", '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));
}

View file

@ -9,12 +9,3 @@ function doToggleAddon(addon, type) {
fo_obj.type.value = type;
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"; } );
}

View file

@ -14,7 +14,7 @@
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<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="addon_name" value="{$addon_info->addon_name}" />

View file

@ -265,7 +265,9 @@
Context::set('page', $output->page);
Context::set('lang_code_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
$this->setLayoutPath('./common/tpl');
$this->setLayoutFile('popup_layout');
// Set a template file
$this->setTemplateFile('module_langcode');
}