1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 11:50:30 +02:00

Fixed <body> tag when using Menu Manager. Stored HTML-theme true/false var for each theme.

This commit is contained in:
Cameron
2019-06-22 11:43:46 -07:00
parent 1cb3f934ea
commit a2c384c57f
3 changed files with 50 additions and 8 deletions

View File

@@ -489,11 +489,20 @@ e107Event.trigger('loaded', null, document);
e107::getJs()->renderJs('header_inline', 5);
echo "</head>
<body".$body_onload.">\n";
echo "</head>";
echo getModal();
echo getAlert();
if(deftrue('e_MENUMANAGER_ACTIVE') && defset('THEME_LAYOUT') && e_theme::loadLayout(THEME_LAYOUT)) // v2.2.2+ html layout is active which contains <body> tag.
{
echo "\n\n<!-- Start theme.html -->\n";
}
else
{
echo "
<body".$body_onload.">\n";
echo getModal();
echo getAlert();
}
function getModal()
{

View File

@@ -1405,7 +1405,7 @@ class e_menuManager {
if(strpos($LAYOUT,'<body ') !== false) // FIXME Find a way to remove the <body> tag from the admin header when menu-manager is active.
{
$LAYOUT = preg_replace('/<body[^>]*>/','', $LAYOUT);
// $LAYOUT = preg_replace('/<body[^>]*>/','', $LAYOUT);
}
// Split up using the same function as the shortcode handler
@@ -1512,9 +1512,40 @@ class e_menuManager {
// }
elseif(strstr($str, '{---MODAL---}'))
{
echo "\n<!-- Modal would appear here --> \n";
//echo '<div id="uiAlert" class="notifications center"><!-- empty --></div>';
//echo getAlert();
//echo "\n<!-- Modal would appear here --> \n";
echo '<div id="uiAlert" class="notifications center"><!-- empty --></div>';
//TODO Store in a central area - currently used in header.php, header_default.php and here.
echo '
<div id="uiModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-caption">&nbsp;</h4>
</div>
<div class="modal-body">
<p>Loading…</p>
</div>
<div class="modal-footer">
<a href="#" data-dismiss="modal" class="btn btn-primary">Close</a>
</div>
</div>
</div>
</div>';
//echo getModal();
}
elseif(strstr($str, '{---CAPTION---}'))
{
echo LAN_CAPTION;
}
elseif(strstr($str, '{LAYOUT_ID}'))
{
echo 'layout-'.e107::getForm()->name2id($this->curLayout);
}
elseif(strstr($str, "ALERT"))
{

View File

@@ -765,6 +765,7 @@ class e_theme
// echo "<h2>".$themeArray['name']."</h2>";
// print_a($lays);
$themeArray['legacy'] = true;
$themeArray['html'] = false;
return $themeArray;
}
@@ -808,6 +809,7 @@ class e_theme
$vars['@attributes']['default'] = (varset($vars['@attributes']['default']) && strtolower($vars['@attributes']['default']) == 'true') ? 1 : 0;
$vars['preview'] = varset($vars['screenshots']['image']);
$vars['thumbnail'] = isset($vars['preview'][0]) && file_exists(e_THEME.$path.'/'.$vars['preview'][0]) ? $vars['preview'][0] : '';
$vars['html'] = file_exists(e_THEME.$path.'/theme.html') && is_dir(e_THEME.$path.'/layouts') ? true : false;
if(!empty($vars['themePrefs']))