mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Update menu_srl of module to 0 if linked menu is deleted
This commit is contained in:
parent
1a65634413
commit
e1b6e0e70d
1 changed files with 29 additions and 14 deletions
|
|
@ -206,7 +206,7 @@ class menuAdminController extends menu
|
||||||
$moduleInfo->menu_srl = $menuSrl;
|
$moduleInfo->menu_srl = $menuSrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
$output = executeQuery('module.updateModule', $moduleInfo);
|
ModuleController::getInstance()->updateModule($moduleInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
Rhymix\Framework\Cache::clearGroup('site_and_module');
|
Rhymix\Framework\Cache::clearGroup('site_and_module');
|
||||||
|
|
@ -372,8 +372,6 @@ class menuAdminController extends menu
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete linked module
|
// Delete linked module
|
||||||
if ($delete_module)
|
|
||||||
{
|
|
||||||
$oModuleController = ModuleController::getInstance();
|
$oModuleController = ModuleController::getInstance();
|
||||||
foreach($output->data as $itemInfo)
|
foreach($output->data as $itemInfo)
|
||||||
{
|
{
|
||||||
|
|
@ -381,8 +379,17 @@ class menuAdminController extends menu
|
||||||
{
|
{
|
||||||
$moduleInfo = ModuleModel::getModuleInfoByMid($itemInfo->url, $menuInfo->site_srl);
|
$moduleInfo = ModuleModel::getModuleInfoByMid($itemInfo->url, $menuInfo->site_srl);
|
||||||
if ($moduleInfo->module_srl)
|
if ($moduleInfo->module_srl)
|
||||||
|
{
|
||||||
|
if ($delete_module)
|
||||||
{
|
{
|
||||||
$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
|
$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$moduleInfo->menu_srl = 0;
|
||||||
|
$output = $oModuleController->updateModule($moduleInfo);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$output->toBool())
|
if (!$output->toBool())
|
||||||
{
|
{
|
||||||
$oDB->rollback();
|
$oDB->rollback();
|
||||||
|
|
@ -391,7 +398,6 @@ class menuAdminController extends menu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Delete menu items
|
// Delete menu items
|
||||||
$output = executeQuery("menu.deleteMenuItems", $args);
|
$output = executeQuery("menu.deleteMenuItems", $args);
|
||||||
|
|
@ -1003,7 +1009,7 @@ class menuAdminController extends menu
|
||||||
if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
|
if($node['active_btn']) FileHandler::removeFile($node['active_btn']);
|
||||||
|
|
||||||
// Delete module
|
// Delete module
|
||||||
if($delete_module && $node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
|
if($node['is_shortcut'] != 'Y' && strncasecmp('http', $node['url'], 4) !== 0)
|
||||||
{
|
{
|
||||||
// reference menu's url modify
|
// reference menu's url modify
|
||||||
$args->url = $node['url'];
|
$args->url = $node['url'];
|
||||||
|
|
@ -1025,8 +1031,17 @@ class menuAdminController extends menu
|
||||||
$oModuleController = ModuleController::getInstance();
|
$oModuleController = ModuleController::getInstance();
|
||||||
$moduleInfo = ModuleModel::getModuleInfoByMid($node['url'], $menuInfo->site_srl);
|
$moduleInfo = ModuleModel::getModuleInfoByMid($node['url'], $menuInfo->site_srl);
|
||||||
if($moduleInfo->module_srl)
|
if($moduleInfo->module_srl)
|
||||||
|
{
|
||||||
|
if ($delete_module)
|
||||||
{
|
{
|
||||||
$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
|
$output = $oModuleController->onlyDeleteModule($moduleInfo->module_srl);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$moduleInfo->menu_srl = 0;
|
||||||
|
$output = $oModuleController->updateModule($moduleInfo);
|
||||||
|
}
|
||||||
|
|
||||||
if(!$output->toBool())
|
if(!$output->toBool())
|
||||||
{
|
{
|
||||||
$oDB->rollback();
|
$oDB->rollback();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue