mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-29 16:19:58 +09:00
issue 2364 menu item move bug fix
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11575 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7588c4ecc1
commit
46c625df6a
2 changed files with 49 additions and 6 deletions
|
|
@ -597,4 +597,7 @@ Menu không phải là người quản lý, nhiệm vụ của nó chỉ là li
|
||||||
<value xml:lang="en"><![CDATA[Exposure limits]]></value>
|
<value xml:lang="en"><![CDATA[Exposure limits]]></value>
|
||||||
<value xml:lang="zh-TW"><![CDATA[Exposure limits]]></value>
|
<value xml:lang="zh-TW"><![CDATA[Exposure limits]]></value>
|
||||||
</item>
|
</item>
|
||||||
|
<item name="msg_empty_menu_item">
|
||||||
|
<value xml:lang="ko"><![CDATA[선택된 메뉴의 정보가 없습니다.]]></value>
|
||||||
|
</item>
|
||||||
</lang>
|
</lang>
|
||||||
|
|
|
||||||
|
|
@ -599,11 +599,10 @@
|
||||||
*/
|
*/
|
||||||
function procMenuAdminMoveItem()
|
function procMenuAdminMoveItem()
|
||||||
{
|
{
|
||||||
//TODO 클라이언트가 넘기는 값을 그냥 사용하면 됨. parent_srl(부모), source_srl(같은 계층의 menu_item_srl), target_srl(나 자신의 menu_item_srl)
|
$mode = Context::get('mode'); //move
|
||||||
$mode = Context::get('mode');
|
$parent_srl = Context::get('parent_srl'); // Parent menu item serial number
|
||||||
$parent_srl = Context::get('parent_srl');
|
$source_srl = Context::get('source_srl'); // Same hierarchy's menu item serial number
|
||||||
$source_srl = Context::get('source_srl');
|
$target_srl = Context::get('target_srl'); // Self menu item serial number
|
||||||
$target_srl = Context::get('target_srl');
|
|
||||||
|
|
||||||
if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
|
if(!$mode || !$parent_srl || !$target_srl) return new Object(-1,'msg_invalid_request');
|
||||||
|
|
||||||
|
|
@ -611,6 +610,24 @@
|
||||||
|
|
||||||
// get original menu item info for cache file recreate
|
// get original menu item info for cache file recreate
|
||||||
$originalItemInfo = $oMenuAdminModel->getMenuItemInfo($target_srl);
|
$originalItemInfo = $oMenuAdminModel->getMenuItemInfo($target_srl);
|
||||||
|
if(!$originalItemInfo->menu_item_srl)
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_empty_menu_item');
|
||||||
|
}
|
||||||
|
|
||||||
|
// get menu properies with child menu
|
||||||
|
$phpFile = sprintf("./files/cache/menu/%s.php", $originalItemInfo->menu_srl);
|
||||||
|
$originMenu = NULL;
|
||||||
|
|
||||||
|
if(is_readable(FileHandler::getRealPath($phpFile)))
|
||||||
|
{
|
||||||
|
@include(FileHandler::getRealPath($phpFile));
|
||||||
|
|
||||||
|
if(is_array($menu->list))
|
||||||
|
{
|
||||||
|
$this->_searchMenu($menu->list, $originalItemInfo->menu_item_srl, $originMenu);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// get target menu info for move
|
// get target menu info for move
|
||||||
$targetMenuItemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
|
$targetMenuItemInfo = $oMenuAdminModel->getMenuItemInfo($parent_srl);
|
||||||
|
|
@ -627,7 +644,11 @@
|
||||||
$parent_srl = 0;
|
$parent_srl = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->moveMenuItem($menu_srl,$parent_srl,$source_srl,$target_srl,$mode);
|
$this->moveMenuItem($menu_srl, $parent_srl, $source_srl, $target_srl, $mode);
|
||||||
|
if(count($originMenu['list']) > 0)
|
||||||
|
{
|
||||||
|
$this->_recursiveUpdateMenuItem($originMenu['list'], $menu_srl);
|
||||||
|
}
|
||||||
|
|
||||||
//recreate original menu
|
//recreate original menu
|
||||||
$xml_file = $this->makeXmlFile($originalItemInfo->menu_srl);
|
$xml_file = $this->makeXmlFile($originalItemInfo->menu_srl);
|
||||||
|
|
@ -636,6 +657,25 @@
|
||||||
$xml_file = $this->makeXmlFile($menu_srl);
|
$xml_file = $this->makeXmlFile($menu_srl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function _recursiveUpdateMenuItem($node, $menu_srl)
|
||||||
|
{
|
||||||
|
if(is_array($node))
|
||||||
|
{
|
||||||
|
foreach($node AS $key=>$node)
|
||||||
|
{
|
||||||
|
unset($args);
|
||||||
|
$args->menu_srl = $menu_srl;
|
||||||
|
$args->menu_item_srl = $node['node_srl'];
|
||||||
|
$output = executeQuery('menu.updateMenuItemNode', $args);
|
||||||
|
|
||||||
|
if(count($node['list']) > 0)
|
||||||
|
{
|
||||||
|
$this->_recursiveUpdateMenuItem($node['list'], $menu_srl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cop menu item
|
* cop menu item
|
||||||
* @return void
|
* @return void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue