mirror of
https://github.com/e107inc/e107.git
synced 2025-08-14 02:24:08 +02:00
Isse #2308 Remove the need for the BODYTAG constant.
This commit is contained in:
@@ -68,7 +68,12 @@ if (varset($e107_popup) != 1)
|
||||
//
|
||||
if(!deftrue('e_IFRAME'))
|
||||
{
|
||||
parseheader($FOOTER);
|
||||
|
||||
$psc = array(
|
||||
'</body>' => '',
|
||||
);
|
||||
|
||||
parseheader($FOOTER, $psc);
|
||||
}
|
||||
|
||||
$eTimingStop = microtime();
|
||||
|
@@ -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 "</head>\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 "</head>\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<!-- Start theme.html -->\n";
|
||||
}
|
||||
elseif(!deftrue('BODYTAG')) //TODO Discuss a better way?
|
||||
{
|
||||
$body_onload .= " id='layout-".e107::getForm()->name2id(THEME_LAYOUT)."' ";
|
||||
echo "<body".$body_onload.">\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);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
Reference in New Issue
Block a user