mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
if is_shortcut is 'N' and url is empty, is_shortcut change to 'Y'
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12149 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e8b7ba2711
commit
de741ff82a
2 changed files with 36 additions and 15 deletions
|
|
@ -360,6 +360,7 @@
|
|||
$menuList = array();
|
||||
if($menuSrl)
|
||||
{
|
||||
$isMenuFixed = false;
|
||||
$output = $this->getMenu($menuSrl);
|
||||
$php_file = sprintf('./files/cache/menu/%s.php',$output->menu_srl);
|
||||
if(file_exists($php_file)) @include($php_file);
|
||||
|
|
@ -368,10 +369,17 @@
|
|||
{
|
||||
foreach($menu->list AS $key=>$value)
|
||||
{
|
||||
$this->_menuInfoSetting($menu->list[$key], $start_module);
|
||||
$this->_menuInfoSetting($menu->list[$key], $start_module, $isMenuFixed);
|
||||
}
|
||||
}
|
||||
|
||||
// menu recreate
|
||||
if($isMenuFixed)
|
||||
{
|
||||
$oMenuAdminController = &getAdminController('menu');
|
||||
$oMenuAdminController->makeXmlFile($menuSrl);
|
||||
}
|
||||
|
||||
$menuItems->menuSrl = $output->menu_srl;
|
||||
$menuItems->title = $output->title;
|
||||
$menuItems->menuItems = $menu;
|
||||
|
|
@ -393,14 +401,22 @@
|
|||
$value->php_file = sprintf('./files/cache/menu/%s.php',$value->menu_srl);
|
||||
if(file_exists($value->php_file)) @include($value->php_file);
|
||||
|
||||
$isMenuFixed = false;
|
||||
if(count($menu->list)>0)
|
||||
{
|
||||
foreach($menu->list AS $key2=>$value2)
|
||||
{
|
||||
$this->_menuInfoSetting($menu->list[$key2], $start_module);
|
||||
$this->_menuInfoSetting($menu->list[$key2], $start_module, $isMenuFixed);
|
||||
}
|
||||
}
|
||||
|
||||
// menu recreate
|
||||
if($isMenuFixed)
|
||||
{
|
||||
$oMenuAdminController = &getAdminController('menu');
|
||||
$oMenuAdminController->makeXmlFile($value->menu_srl);
|
||||
}
|
||||
|
||||
$menuItems->menuSrl = $value->menu_srl;
|
||||
$menuItems->title = $value->title;
|
||||
$menuItems->menuItems = $menu;
|
||||
|
|
@ -450,9 +466,25 @@
|
|||
* @param array $menu
|
||||
* @return void
|
||||
*/
|
||||
private function _menuInfoSetting(&$menu, &$start_module)
|
||||
private function _menuInfoSetting(&$menu, &$start_module, &$isMenuFixed)
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
// if url is empty and is_shortcut is 'N', change to is_shortcut 'Y'
|
||||
if(!$menu['url'] && $menu['is_shortcut'] == 'N')
|
||||
{
|
||||
$menu['is_shortcut'] = 'Y';
|
||||
|
||||
unset($args);
|
||||
$args->menu_item_srl = $menu['node_srl'];
|
||||
$args->is_shortcut = 'Y';
|
||||
if($menu['menu_name_key']) $args->name = $menu['menu_name_key'];
|
||||
else $args->name = $menu['menu_name'];
|
||||
$output = executeQuery('menu.updateMenuItem', $args);
|
||||
|
||||
$isMenuFixed = true;
|
||||
}
|
||||
|
||||
//if menu type is module menu
|
||||
if(!empty($menu['url']) && !preg_match('/^http/i', $menu['url']))
|
||||
{
|
||||
unset($midInfo);
|
||||
|
|
@ -484,7 +516,7 @@
|
|||
{
|
||||
foreach($menu['list'] AS $key=>$value)
|
||||
{
|
||||
$this->_menuInfoSetting($menu['list'][$key], &$start_module);
|
||||
$this->_menuInfoSetting($menu['list'][$key], &$start_module, $isMenuFixed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
<query id="updateMenuShortcutForMigration" action="update">
|
||||
<tables>
|
||||
<table name="menu_item" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="is_shortcut" var="is_shortcut" default="Y" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="menu_item_srl" var="menu_item_srl" filter="number" notnull="notnull" />
|
||||
</conditions>
|
||||
</query>
|
||||
Loading…
Add table
Add a link
Reference in a new issue