diff --git a/e107_core/templates/footer_default.php b/e107_core/templates/footer_default.php index 0949908e5..655447472 100644 --- a/e107_core/templates/footer_default.php +++ b/e107_core/templates/footer_default.php @@ -68,7 +68,12 @@ if (varset($e107_popup) != 1) // if(!deftrue('e_IFRAME')) { - parseheader($FOOTER); + + $psc = array( + '' => '', + ); + + parseheader($FOOTER, $psc); } $eTimingStop = microtime(); diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php index adaeb55ef..fd8f45615 100644 --- a/e107_core/templates/header_default.php +++ b/e107_core/templates/header_default.php @@ -81,18 +81,22 @@ $js_body_onload = array(); // Legacy array of code to load with page. if (!function_exists("parseheader")) { - function parseheader($LAYOUT) + function parseheader($LAYOUT, $opts=array()) { $tp = e107::getParser(); $tmp = explode("\n", $LAYOUT); $sc = e107::getScBatch('_theme_'); + + $search = array_keys($opts); + $replace = array_values($opts); foreach ($tmp as $line) { + $line = str_replace($search, $replace, $line); // Quick-fix allow for use of {THEME} shortcode. + if (preg_match("/{.+?}/", $line)) { - $line = str_replace('{THEME}',THEME_ABS, $line); // Quick-fix allow for use of {THEME} shortcode. echo $tp->parseTemplate($line, true, $sc)."\n"; // retain line-breaks. } else @@ -623,11 +627,12 @@ echo "\n"; $def = THEME_LAYOUT; // The active layout based on custompage matches. - + $noBody = false; // v2.2.2 --- Experimental -- if($tmp = e_theme::loadLayout(THEME_LAYOUT)) { $LAYOUT = $tmp; + $noBody = true; unset($tmp); } @@ -699,9 +704,11 @@ echo "\n"; //$body_onload .= " id='layout-".e107::getForm()->name2id(THEME_LAYOUT)."' "; - - -if(!deftrue('BODYTAG')) //TODO Discuss a better way? +if($noBody === true) // New in v2.2.2 - remove need for BODYTAG. +{ + echo "\n\n"; +} +elseif(!deftrue('BODYTAG')) //TODO Discuss a better way? { $body_onload .= " id='layout-".e107::getForm()->name2id(THEME_LAYOUT)."' "; echo "\n"; @@ -746,7 +753,10 @@ if(deftrue('BOOTSTRAP')) } - echo $LAYOUT['_modal_']; + if($noBody === false) + { + echo $LAYOUT['_modal_']; + } } @@ -787,13 +797,21 @@ if ($e107_popup != 1) { $HEADER = preg_replace('#(src|href)=("|\')([^:\'"]*)("|\')#','$1=$2'.THEME.'$3$4', $HEADER); $FOOTER = preg_replace('#(src|href)=("|\')([^:\'"]*)("|\')#','$1=$2'.THEME.'$3$4', $FOOTER); } + + + $psc = array( + '{THEME}' => THEME_ABS, + '{BODY_ONLOAD}' => $body_onload, + '{LAYOUT_ID}' => 'layout-'.e107::getForm()->name2id(THEME_LAYOUT), + '{---MODAL---}' => $LAYOUT['_modal_'], + ); - parseheader($HEADER); - + parseheader($HEADER, $psc); + // echo $HEADER; } - unset($def); + unset($def, $noBody, $psc); // ----------------------------------------------------------------------------- diff --git a/e107_handlers/menumanager_class.php b/e107_handlers/menumanager_class.php index eb4e401dd..18d38396f 100644 --- a/e107_handlers/menumanager_class.php +++ b/e107_handlers/menumanager_class.php @@ -1345,7 +1345,7 @@ class e_menuManager { echo $rs->form_close(); echo ""; - + $FOOTER = str_replace('','', $FOOTER); $this->parseheader($FOOTER); if($this->debug) @@ -1402,11 +1402,20 @@ class e_menuManager { { // $tmp = explode("\n", $LAYOUT); + + if(strpos($LAYOUT,' tag from the admin header when menu-manager is active. + { + $LAYOUT = preg_replace('/]*>/','', $LAYOUT); + } + // Split up using the same function as the shortcode handler $tmp = preg_split('#(\{\S[^\x02]*?\S\})#', $LAYOUT, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); $str = array(); for($c = 0; $c < count($tmp); $c++) { + + + if(preg_match("/[\{|\}]/", $tmp[$c])) { if($check) @@ -1501,6 +1510,12 @@ class e_menuManager { // $tp->parseTemplate("{NAVIGATION".$cust."}",true); // echo "Navigation Area"; // } + elseif(strstr($str, '{---MODAL---}')) + { + echo "\n \n"; + //echo '
'; + //echo getAlert(); + } elseif(strstr($str, "ALERT")) { //echo "[Navigation Area]";