mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Merge pull request #2130 from dewekk/fix-menu-create
메뉴가 중복으로 생성되는 문제 수정
This commit is contained in:
commit
a4f5b5d0a9
1 changed files with 28 additions and 33 deletions
|
|
@ -374,6 +374,8 @@ class ModuleController extends Module
|
|||
*/
|
||||
function insertModule($args)
|
||||
{
|
||||
$isMenuCreate = $args->isMenuCreate ?? true;
|
||||
|
||||
$output = $this->arrangeModuleInfo($args, $extra_vars);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
|
|
@ -428,7 +430,6 @@ class ModuleController extends Module
|
|||
$oDB = DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$isMenuCreate = $args->isMenuCreate ?? true;
|
||||
if($isMenuCreate)
|
||||
{
|
||||
$menuArgs = new stdClass;
|
||||
|
|
@ -487,39 +488,28 @@ class ModuleController extends Module
|
|||
*/
|
||||
function updateModule($args)
|
||||
{
|
||||
if(isset($args->isMenuCreate))
|
||||
{
|
||||
$isMenuCreate = $args->isMenuCreate;
|
||||
}
|
||||
else
|
||||
{
|
||||
$isMenuCreate = TRUE;
|
||||
}
|
||||
$isMenuCreate = $args->isMenuCreate ?? true;
|
||||
|
||||
$output = $this->arrangeModuleInfo($args, $extra_vars);
|
||||
if(!$output->toBool()) return $output;
|
||||
// begin transaction
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$module_info = ModuleModel::getModuleInfoByModuleSrl($args->module_srl);
|
||||
|
||||
if(!$args->browser_title)
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$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);
|
||||
if(!$output->toBool() || $output->data->count)
|
||||
{
|
||||
$oDB->rollback();
|
||||
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
|
||||
if($args->skin == '/USE_DEFAULT/')
|
||||
if(!isset($args->skin) || $args->skin == '/USE_DEFAULT/')
|
||||
{
|
||||
$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';
|
||||
}
|
||||
|
|
@ -550,14 +540,12 @@ class ModuleController extends Module
|
|||
$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->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($module_info->mid != $args->mid && Context::get('success_return_url'))
|
||||
{
|
||||
|
|
@ -616,12 +611,12 @@ class ModuleController extends Module
|
|||
|
||||
/**
|
||||
* Change the module's virtual site
|
||||
*
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
function updateModuleSite($module_srl, $site_srl = 0, $layout_srl = 0)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1275,7 +1270,7 @@ class ModuleController extends Module
|
|||
*/
|
||||
function updateModuleInSites($site_srls, $args)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue