mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +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->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
|
||||
**/
|
||||
function procAddonAdminToggleActivate() {
|
||||
$oAddonModel = &getAdminModel('addon');
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
|
||||
$pc = Context::get('pc');
|
||||
$mobile = Context::get('mobile');
|
||||
$oAddonModel = &getAdminModel('addon');
|
||||
|
||||
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;
|
||||
}
|
||||
$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);
|
||||
}
|
||||
|
||||
// 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'));
|
||||
$this->makeCacheFile($site_module_info->site_srl, $type);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -75,6 +75,12 @@
|
|||
// Template specifies the path and file
|
||||
$this->setTemplateFile('setup_addon');
|
||||
|
||||
if(Context::get('module') != 'admin')
|
||||
{
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile('popup_layout');
|
||||
}
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('addon_info.', 'addon_info.author..', 'mid_list....');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<form action="./" method="post">
|
||||
<input type="hidden" name="module" value="addon" />
|
||||
<input type="hidden" name="act" value="procAddonAdminSaveActivate" />
|
||||
<input type="hidden" name="sccess_return_url" value="{getRequestUriByServerEnviroment()}" />
|
||||
|
||||
<h1 class="h1">{$lang->installed_addon}</h1>
|
||||
<p>{$lang->about_installed_addon}</p>
|
||||
|
|
@ -50,4 +51,4 @@
|
|||
<div class="btnArea">
|
||||
<span class="btn medium"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
</div>
|
||||
</form>
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue