From bb59e332e61ba220ad4bda7d7214b01c65516a6b Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 11 Feb 2015 11:05:33 -0800 Subject: [PATCH] Corrected MenuPresets --- e107_handlers/menumanager_class.php | 52 +++++++++-------------------- e107_handlers/theme_handler.php | 11 +++--- 2 files changed, 22 insertions(+), 41 deletions(-) diff --git a/e107_handlers/menumanager_class.php b/e107_handlers/menumanager_class.php index e3ea49a1f..ffd7d3717 100644 --- a/e107_handlers/menumanager_class.php +++ b/e107_handlers/menumanager_class.php @@ -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 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 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; diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index cf6f54d6b..90f8bdab3 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -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 "
".print_a($vars,true)."".print_a($adv,true)."
"; + // echo " + // + //
oldnew parser
".print_a($oldvars,true)."".print_a($vars,true)."
"; } @@ -2139,8 +2141,9 @@ class themeHandler // $mes->addDebug("
"); } - if($path == "_blank" ) + if($path == "bootstrap3" ) { + // print_a($vars); // echo "
".print_a($vars,true)."".print_a($adv,true)."
"; }