mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
메뉴가 중복으로 생성되는 문제 수정
fix https://github.com/rhymix/rhymix/issues/2129 - $isMenuCreate 선언을 arrangeModuleInfo 위로 옮깁니다. - updateModule도 insertModule와 비슷한 결과를 위하여 코드를 정리하였습니다.
This commit is contained in:
parent
94069ebfd6
commit
b09dff4613
1 changed files with 28 additions and 33 deletions
|
|
@ -374,6 +374,8 @@ class ModuleController extends Module
|
||||||
*/
|
*/
|
||||||
function insertModule($args)
|
function insertModule($args)
|
||||||
{
|
{
|
||||||
|
$isMenuCreate = $args->isMenuCreate ?? true;
|
||||||
|
|
||||||
$output = $this->arrangeModuleInfo($args, $extra_vars);
|
$output = $this->arrangeModuleInfo($args, $extra_vars);
|
||||||
if(!$output->toBool())
|
if(!$output->toBool())
|
||||||
{
|
{
|
||||||
|
|
@ -428,7 +430,6 @@ class ModuleController extends Module
|
||||||
$oDB = DB::getInstance();
|
$oDB = DB::getInstance();
|
||||||
$oDB->begin();
|
$oDB->begin();
|
||||||
|
|
||||||
$isMenuCreate = $args->isMenuCreate ?? true;
|
|
||||||
if($isMenuCreate)
|
if($isMenuCreate)
|
||||||
{
|
{
|
||||||
$menuArgs = new stdClass;
|
$menuArgs = new stdClass;
|
||||||
|
|
@ -487,39 +488,28 @@ class ModuleController extends Module
|
||||||
*/
|
*/
|
||||||
function updateModule($args)
|
function updateModule($args)
|
||||||
{
|
{
|
||||||
if(isset($args->isMenuCreate))
|
$isMenuCreate = $args->isMenuCreate ?? true;
|
||||||
{
|
|
||||||
$isMenuCreate = $args->isMenuCreate;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$isMenuCreate = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
$output = $this->arrangeModuleInfo($args, $extra_vars);
|
$output = $this->arrangeModuleInfo($args, $extra_vars);
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool())
|
||||||
// begin transaction
|
|
||||||
$oDB = &DB::getInstance();
|
|
||||||
$oDB->begin();
|
|
||||||
|
|
||||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($args->module_srl);
|
|
||||||
|
|
||||||
if(!$args->browser_title)
|
|
||||||
{
|
{
|
||||||
$args->browser_title = $module_info->browser_title;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
$args->browser_title = strip_tags($args->browser_title);
|
// Check whether the module name already exists
|
||||||
|
|
||||||
$output = executeQuery('module.isExistsModuleName', $args);
|
$output = executeQuery('module.isExistsModuleName', $args);
|
||||||
if(!$output->toBool() || $output->data->count)
|
if(!$output->toBool() || $output->data->count)
|
||||||
{
|
{
|
||||||
$oDB->rollback();
|
|
||||||
return new BaseObject(-1, 'msg_module_name_exists');
|
return new BaseObject(-1, 'msg_module_name_exists');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$module_info = ModuleModel::getModuleInfoByModuleSrl($args->module_srl);
|
||||||
|
|
||||||
|
$args->browser_title = escape(strip_tags($args->browser_title ?? $module_info->browser_title), false);
|
||||||
|
$args->description = isset($args->description) ? escape($args->description, false) : null;
|
||||||
|
|
||||||
// default value
|
// default value
|
||||||
if($args->skin == '/USE_DEFAULT/')
|
if(!isset($args->skin) || $args->skin == '/USE_DEFAULT/')
|
||||||
{
|
{
|
||||||
$args->is_skin_fix = 'N';
|
$args->is_skin_fix = 'N';
|
||||||
}
|
}
|
||||||
|
|
@ -535,7 +525,7 @@ class ModuleController extends Module
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($args->mskin == '/USE_DEFAULT/' || $args->mskin == '/USE_RESPONSIVE/')
|
if(!isset($args->mskin) || $args->mskin == '/USE_DEFAULT/' || $args->mskin == '/USE_RESPONSIVE/')
|
||||||
{
|
{
|
||||||
$args->is_mskin_fix = 'N';
|
$args->is_mskin_fix = 'N';
|
||||||
}
|
}
|
||||||
|
|
@ -550,14 +540,12 @@ class ModuleController extends Module
|
||||||
$args->is_mskin_fix = 'Y';
|
$args->is_mskin_fix = 'Y';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$output = executeQuery('module.updateModule', $args);
|
|
||||||
if(!$output->toBool())
|
|
||||||
{
|
|
||||||
$oDB->rollback();
|
|
||||||
return $output;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($isMenuCreate === TRUE)
|
// begin transaction
|
||||||
|
$oDB = DB::getInstance();
|
||||||
|
$oDB->begin();
|
||||||
|
|
||||||
|
if($isMenuCreate)
|
||||||
{
|
{
|
||||||
$menuArgs = new stdClass;
|
$menuArgs = new stdClass;
|
||||||
$menuArgs->url = $module_info->mid;
|
$menuArgs->url = $module_info->mid;
|
||||||
|
|
@ -579,6 +567,13 @@ class ModuleController extends Module
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$output = executeQuery('module.updateModule', $args);
|
||||||
|
if(!$output->toBool())
|
||||||
|
{
|
||||||
|
$oDB->rollback();
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
// if mid changed, change mid of success_return_url to new mid
|
// if mid changed, change mid of success_return_url to new mid
|
||||||
if($module_info->mid != $args->mid && Context::get('success_return_url'))
|
if($module_info->mid != $args->mid && Context::get('success_return_url'))
|
||||||
{
|
{
|
||||||
|
|
@ -616,12 +611,12 @@ class ModuleController extends Module
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change the module's virtual site
|
* Change the module's virtual site
|
||||||
*
|
*
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
function updateModuleSite($module_srl, $site_srl = 0, $layout_srl = 0)
|
function updateModuleSite($module_srl, $site_srl = 0, $layout_srl = 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1275,7 +1270,7 @@ class ModuleController extends Module
|
||||||
*/
|
*/
|
||||||
function updateModuleInSites($site_srls, $args)
|
function updateModuleInSites($site_srls, $args)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue