mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
issue 840, fixed a bug for setup addon in textyle.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9790 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
41584ccd58
commit
8abcf7fae4
3 changed files with 28 additions and 61 deletions
|
|
@ -92,75 +92,35 @@
|
||||||
$this->makeCacheFile(0, 'mobile', 'site');
|
$this->makeCacheFile(0, 'mobile', 'site');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAddonAdminIndex'));
|
if (Context::get('success_return_url'))
|
||||||
|
{
|
||||||
|
$this->setRedirectUrl(Context::get('success_return_url'));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->setRedirectUrl(getNotEncodedUrl('', 'module', 'admin', 'act', 'dispAddonAdminIndex'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Add active/inactive change
|
* @brief Add active/inactive change
|
||||||
**/
|
**/
|
||||||
function procAddonAdminToggleActivate() {
|
function procAddonAdminToggleActivate() {
|
||||||
$oAddonModel = &getAdminModel('addon');
|
$oAddonModel = &getAdminModel('addon');
|
||||||
$site_module_info = Context::get('site_module_info');
|
|
||||||
|
|
||||||
$pc = Context::get('pc');
|
|
||||||
$mobile = Context::get('mobile');
|
|
||||||
|
|
||||||
if (!$pc) $pc = array();
|
$site_module_info = Context::get('site_module_info');
|
||||||
if (!$mobile) $mobile = array();
|
// batahom addon values
|
||||||
|
$addon = Context::get('addon');
|
||||||
if (!is_array($pc)) $pc = array($pc);
|
$type = Context::get('type');
|
||||||
if (!is_array($mobile)) $pc = array($mobile);
|
if(!$type) $type = "pc";
|
||||||
|
if($addon) {
|
||||||
// get current addon info
|
// If enabled Disables
|
||||||
$oModel = &getAdminModel('addon');
|
if($oAddonModel->isActivatedAddon($addon, $site_module_info->site_srl, $type)) $this->doDeactivate($addon, $site_module_info->site_srl, $type);
|
||||||
$currentAddonList = $oModel->getAddonList($site_module_info->site_srl, 'site');
|
// If it is disabled Activate
|
||||||
|
else $this->doActivate($addon, $site_module_info->site_srl, $type);
|
||||||
// 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
|
$this->makeCacheFile($site_module_info->site_srl, $type);
|
||||||
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'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,12 @@
|
||||||
// Template specifies the path and file
|
// Template specifies the path and file
|
||||||
$this->setTemplateFile('setup_addon');
|
$this->setTemplateFile('setup_addon');
|
||||||
|
|
||||||
|
if(Context::get('module') != 'admin')
|
||||||
|
{
|
||||||
|
$this->setLayoutPath('./common/tpl');
|
||||||
|
$this->setLayoutFile('popup_layout');
|
||||||
|
}
|
||||||
|
|
||||||
$security = new Security();
|
$security = new Security();
|
||||||
$security->encodeHTML('addon_info.', 'addon_info.author..', 'mid_list....');
|
$security->encodeHTML('addon_info.', 'addon_info.author..', 'mid_list....');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<form action="./" method="post">
|
<form action="./" method="post">
|
||||||
<input type="hidden" name="module" value="addon" />
|
<input type="hidden" name="module" value="addon" />
|
||||||
<input type="hidden" name="act" value="procAddonAdminSaveActivate" />
|
<input type="hidden" name="act" value="procAddonAdminSaveActivate" />
|
||||||
|
<input type="hidden" name="sccess_return_url" value="{getRequestUriByServerEnviroment()}" />
|
||||||
|
|
||||||
<h1 class="h1">{$lang->installed_addon}</h1>
|
<h1 class="h1">{$lang->installed_addon}</h1>
|
||||||
<p>{$lang->about_installed_addon}</p>
|
<p>{$lang->about_installed_addon}</p>
|
||||||
|
|
@ -50,4 +51,4 @@
|
||||||
<div class="btnArea">
|
<div class="btnArea">
|
||||||
<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
|
<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue