1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Corrected MenuPresets

This commit is contained in:
Cameron 2015-02-11 11:05:33 -08:00
parent 00696d92d3
commit bb59e332e6
2 changed files with 22 additions and 41 deletions

View File

@ -692,49 +692,27 @@ class e_menuManager {
return FALSE;
}
$temp = $pref['sitetheme_layouts'][$layout]['menuPresets']['area'];
$areas = $pref['sitetheme_layouts'][$layout]['menuPresets']['area'];
// print_a($temp);
$multiple = isset($temp['menu'][1]);
foreach($temp as $key=>$val)
foreach($areas as $area => $menus)
{
if($val['id'])
$areaID = $menus['@attributes']['id'];
foreach($menus['menu'] as $k=>$v)
{
$iD = $val['id'];
}
// $iD = $val['id'];
if($key == 'menu')
{
if($multiple) // More than one menu item under <area> in theme.xml.
{
foreach($val as $k=>$v)
{
// $uclass = (defined(trim($v['@attributes']['perm']))) ? constant(trim($v['@attributes']['userclass'])) : 0;
$menuArea[] = array(
'menu_location' => $iD,
'menu_order' => $k,
'menu_name' => $v['@attributes']['name']."_menu",
'menu_class' => $this->menuPresetPerms($v['@attributes']['perm'])
);
}
}
else // Only one menu item under <area> in theme.xml.
{
// $uclass = (defined(trim($val['menu']['@attributes']['userclass']))) ? constant(trim($val['menu']['@attributes']['userclass'])) : 0;
$menuArea[] = array(
'menu_location' => $iD,
'menu_order' => 0,
'menu_name' => $val['menu']['@attributes']['name']."_menu",
'menu_class' => $this->menuPresetPerms($v['@attributes']['perm'])
);
}
$menuArea[] = array(
'menu_location' => $areaID,
'menu_order' => $k,
'menu_name' => $v['@attributes']['name']."_menu",
'menu_class' => $this->menuPresetPerms($v['@attributes']['perm'])
);
}
}
if(E107_DEBUG_LEVEL > 0)
{
// e107::getMessage()->addDebug(print_a($menuArea,true));
}
// print_a($menuArea);
return $menuArea;

View File

@ -2021,12 +2021,14 @@ class themeHandler
// $vars = $xml->loadXMLfile(e_THEME.$path.'/theme.xml', true, true);
// $oldvars =
$vars = $xml->loadXMLfile(e_THEME.$path.'/theme.xml', 'advanced', true); // must be 'advanced'
if($path == "_blank" )
if($path == "bootstrap3" )
{
// echo "<table class='table'><tr><td>".print_a($vars,true)."</td><td>".print_a($adv,true)."</td></tr></table>";
// echo "<table class='table table-bordered'>
// <tr><th>old</th><th>new parser</th></tr>
// <tr><td>".print_a($oldvars,true)."</td><td>".print_a($vars,true)."</td></tr></table>";
}
@ -2139,8 +2141,9 @@ class themeHandler
// $mes->addDebug("<hr />");
}
if($path == "_blank" )
if($path == "bootstrap3" )
{
// print_a($vars);
// echo "<table class='table'><tr><td>".print_a($vars,true)."</td><td>".print_a($adv,true)."</td></tr></table>";
}