mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-08 19:42:15 +09:00
issue 2933 add isShow column and check isShow and unset menu item
git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12731 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
1379f68c92
commit
c657a0f2c1
2 changed files with 27 additions and 1 deletions
|
|
@ -1448,6 +1448,29 @@ function checkCSRF()
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* menu exposure check by isShow column
|
||||||
|
* @param array $menu
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function recurciveExposureCheck(&$menu)
|
||||||
|
{
|
||||||
|
if(is_array($menu))
|
||||||
|
{
|
||||||
|
foreach($menu AS $key=>$value)
|
||||||
|
{
|
||||||
|
if(!$value['isShow'])
|
||||||
|
{
|
||||||
|
unset($menu[$key]);
|
||||||
|
}
|
||||||
|
if(is_array($value['list']) && count($value['list']) > 0)
|
||||||
|
{
|
||||||
|
recurciveExposureCheck($menu[$key]['list']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print raw html header
|
* Print raw html header
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1651,6 +1651,7 @@ class menuAdminController extends menu
|
||||||
'%s; '.
|
'%s; '.
|
||||||
'%s; '.
|
'%s; '.
|
||||||
'$menu->list = array(%s); '.
|
'$menu->list = array(%s); '.
|
||||||
|
'if(!$is_admin) { recurciveExposureCheck($menu->list); }'.
|
||||||
'Context::set("included_menu", $menu); '.
|
'Context::set("included_menu", $menu); '.
|
||||||
'?>',
|
'?>',
|
||||||
$header_script,
|
$header_script,
|
||||||
|
|
@ -1850,11 +1851,12 @@ class menuAdminController extends menu
|
||||||
}
|
}
|
||||||
// Create properties (check if it belongs to the menu node by url_list. It looks a trick but fast and powerful)
|
// Create properties (check if it belongs to the menu node by url_list. It looks a trick but fast and powerful)
|
||||||
$attribute = sprintf(
|
$attribute = sprintf(
|
||||||
'"node_srl"=>"%s","parent_srl"=>"%s","menu_name_key"=>\'%s\',"text"=>(%s?$_menu_names[%d][$lang_type]:""),"href"=>(%s?"%s":""),"url"=>(%s?"%s":""),"is_shortcut"=>"%s","open_window"=>"%s","normal_btn"=>"%s","hover_btn"=>"%s","active_btn"=>"%s","selected"=>(array(%s)&&in_array(Context::get("mid"),array(%s))?1:0),"expand"=>"%s", "list"=>array(%s), "link"=>(%s? ( array(%s)&&in_array(Context::get("mid"),array(%s)) ?%s:%s):""),',
|
'"node_srl"=>"%s","parent_srl"=>"%s","menu_name_key"=>\'%s\',"isShow"=>(%s?true:false),"text"=>(%s?$_menu_names[%d][$lang_type]:""),"href"=>(%s?"%s":""),"url"=>(%s?"%s":""),"is_shortcut"=>"%s","open_window"=>"%s","normal_btn"=>"%s","hover_btn"=>"%s","active_btn"=>"%s","selected"=>(array(%s)&&in_array(Context::get("mid"),array(%s))?1:0),"expand"=>"%s", "list"=>array(%s), "link"=>(%s? ( array(%s)&&in_array(Context::get("mid"),array(%s)) ?%s:%s):""),',
|
||||||
$node->menu_item_srl,
|
$node->menu_item_srl,
|
||||||
$node->parent_srl,
|
$node->parent_srl,
|
||||||
addslashes($node->name),
|
addslashes($node->name),
|
||||||
$group_check_code,
|
$group_check_code,
|
||||||
|
$group_check_code,
|
||||||
$node->menu_item_srl,
|
$node->menu_item_srl,
|
||||||
$group_check_code,
|
$group_check_code,
|
||||||
$href,
|
$href,
|
||||||
|
|
@ -1875,6 +1877,7 @@ class menuAdminController extends menu
|
||||||
$link_active,
|
$link_active,
|
||||||
$link
|
$link
|
||||||
);
|
);
|
||||||
|
|
||||||
// Generate buff data
|
// Generate buff data
|
||||||
$output['buff'] .= sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
|
$output['buff'] .= sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
|
||||||
$output['name'] .= $name_str;
|
$output['name'] .= $name_str;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue