From b8724bc4bc73d02b59015e53ce91afeab6490add Mon Sep 17 00:00:00 2001 From: Cameron Date: Mon, 30 Dec 2013 06:23:12 -0800 Subject: [PATCH] Fixes #465 - Bootstrap3 layout with sidebar panel added. Menu Preset added. Bootstrap3 styling tweaks to news menus. --- e107_core/templates/header_default.php | 4 +- e107_handlers/menumanager_class.php | 62 ++++++--- e107_handlers/theme_handler.php | 8 +- .../blogcalendar_menu/blogcalendar_menu.php | 6 +- e107_plugins/news/other_news_menu.php | 4 +- .../news/templates/news_menu_template.php | 4 +- e107_themes/bootstrap3/style.css | 2 +- e107_themes/bootstrap3/theme.php | 131 ++++++++---------- e107_themes/bootstrap3/theme.xml | 11 ++ 9 files changed, 121 insertions(+), 111 deletions(-) diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php index 729654255..95b033c9e 100644 --- a/e107_core/templates/header_default.php +++ b/e107_core/templates/header_default.php @@ -581,8 +581,8 @@ echo "\n"; foreach($LAYOUT as $key=>$template) { list($hd,$ft) = explode("{---}",$template); - $HEADER[$key] = $hd; - $FOOTER[$key] = $ft; + $HEADER[$key] = isset($LAYOUT['_header_']) ? $LAYOUT['_header_'] . $hd : $hd; + $FOOTER[$key] = isset($LAYOUT['_footer_']) ? $ft . $LAYOUT['_footer_'] : $ft ; } unset($hd,$ft); } diff --git a/e107_handlers/menumanager_class.php b/e107_handlers/menumanager_class.php index 8702c738e..06c7eada1 100644 --- a/e107_handlers/menumanager_class.php +++ b/e107_handlers/menumanager_class.php @@ -177,8 +177,8 @@ class e_menuManager { foreach($LAYOUT as $key=>$template) { list($hd,$ft) = explode("{---}",$template); - $HEADER[$key] = $hd; - $FOOTER[$key] = $ft; + $HEADER[$key] = isset($LAYOUT['_header_']) ? $LAYOUT['_header_'] . $hd : $hd; + $FOOTER[$key] = isset($LAYOUT['_footer_']) ? $ft . $LAYOUT['_footer_'] : $ft ; } unset($hd,$ft); } @@ -317,6 +317,7 @@ class e_menuManager { if(!$menuAreas = $this->getMenuPreset()) { + e107::getMessage()->addDebug("No Menu Preset Found"); return FALSE; } @@ -668,40 +669,55 @@ class e_menuManager { if(!isset($pref['sitetheme_layouts'][$layout]['menuPresets'])) { + e107::getMessage()->addDebug(print_a($pref['sitetheme_layouts'],true)); return FALSE; } $temp = $pref['sitetheme_layouts'][$layout]['menuPresets']['area']; + // print_a($temp); + $multiple = isset($temp['menu'][1]); + foreach($temp as $key=>$val) { - $iD = $val['@attributes']['id']; - if(varset($val['menu'][1])) // More than one menu item under in theme.xml. + if($val['id']) { - foreach($val['menu'] as $k=>$v) + $iD = $val['id']; + } + // $iD = $val['id']; + + if($key == 'menu') + { + if($multiple) // More than one menu item under in theme.xml. { - // $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']) - ); + 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']) + ); } } - 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']) - ); - } } + + // print_a($menuArea); - return $menuArea; + return $menuArea; } diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index 01196d5df..153aa4487 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -1263,7 +1263,13 @@ class themeHandler $itext .= ""; - $itext .= (varset($val['menuPresets'])) ? $this->frm->admin_button("setMenuPreset[".$key."]", "Use Preset") : ""; + if(varset($val['menuPresets'])) + { + $itext .= $this->frm->admin_button("setMenuPreset[".$key."]", "Use Preset"); + // $itext .= print_a($val['menuPresets'],true); + } + + $itext .= " "; diff --git a/e107_plugins/blogcalendar_menu/blogcalendar_menu.php b/e107_plugins/blogcalendar_menu/blogcalendar_menu.php index 68b87e5b1..84ce98f62 100644 --- a/e107_plugins/blogcalendar_menu/blogcalendar_menu.php +++ b/e107_plugins/blogcalendar_menu/blogcalendar_menu.php @@ -162,8 +162,8 @@ if(false === $cached) if(deftrue('BOOTSTRAP')) // v2.x { - $month_selector = '
-
'; + $month_selector = '
+
'; $caption = "".BLOGCAL_L1." ".$month_selector.""; @@ -180,7 +180,7 @@ if(false === $cached) $menu .= ""; $menu .= " "; diff --git a/e107_plugins/news/other_news_menu.php b/e107_plugins/news/other_news_menu.php index 6a9b27793..50751537e 100644 --- a/e107_plugins/news/other_news_menu.php +++ b/e107_plugins/news/other_news_menu.php @@ -39,8 +39,8 @@ if(!$OTHERNEWS_STYLE) define("OTHERNEWS_COLS",false); $template = e107::getTemplate('news', 'news_menu', 'other'); - $item_selector = '
-
'; + $item_selector = '
+
'; $caption = "".$template['caption']." ".$item_selector.""; diff --git a/e107_plugins/news/templates/news_menu_template.php b/e107_plugins/news/templates/news_menu_template.php index a9fc15db9..ec211ad20 100644 --- a/e107_plugins/news/templates/news_menu_template.php +++ b/e107_plugins/news/templates/news_menu_template.php @@ -64,7 +64,7 @@ $NEWS_MENU_TEMPLATE['other']['item'] = '
{NEWSIMAGE}

{NEWSTITLE}

{NEWSSUMMARY}

-

'.LAN_READ_MORE.' »

+

'.LAN_READ_MORE.' »

'; $NEWS_MENU_TEMPLATE['other']['end'] = ""; @@ -82,7 +82,7 @@ $NEWS_MENU_TEMPLATE['other2']['start'] = "