mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Improved performance on getLayouts when using the new 'layouts' folder in the theme's directory.
Possible fix for missing class in footer_default.php
This commit is contained in:
@@ -56,6 +56,7 @@ if(!defined('e_NOCACHE'))
|
|||||||
$e107 = e107::getInstance();
|
$e107 = e107::getInstance();
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
|
$tp = e107::getParser();
|
||||||
|
|
||||||
if (varset($e107_popup) != 1)
|
if (varset($e107_popup) != 1)
|
||||||
{
|
{
|
||||||
|
@@ -2046,37 +2046,15 @@ class e_menu_layout
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
e107::set('css_enabled',false);
|
e107::set('css_enabled',false);
|
||||||
e107::set('js_enabled',false);
|
e107::set('js_enabled',false);
|
||||||
|
|
||||||
$themeFileContent = file_get_contents($file);
|
|
||||||
|
|
||||||
$srch = array('<?php','?>');
|
|
||||||
|
|
||||||
$themeFileContent = preg_replace('/\(\s?THEME\s?\./', '( e_THEME. "'.$theme.'/" .', str_replace($srch, '', $themeFileContent));
|
|
||||||
|
|
||||||
$themeFileContent = str_replace('tablestyle', $tp->filter($theme, 'wd')."_tablestyle",$themeFileContent); // rename function to avoid conflicts while parsing.
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
@eval($themeFileContent);
|
|
||||||
}
|
|
||||||
catch (ParseError $e)
|
|
||||||
{
|
|
||||||
echo "<div class='alert alert-danger'>Couldn't parse theme.php: ". $e->getMessage()." </div>";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// @eval($themeFileContent);
|
|
||||||
|
|
||||||
e107::set('css_enabled',true);
|
|
||||||
e107::set('js_enabled',true);
|
|
||||||
|
|
||||||
$head = array();
|
|
||||||
$foot = array();
|
|
||||||
|
|
||||||
// new v2.2.2 HTML layout support.
|
// new v2.2.2 HTML layout support.
|
||||||
if(empty($LAYOUT) && is_dir($path."layouts"))
|
if(is_dir($path."layouts"))
|
||||||
{
|
{
|
||||||
$lyt = scandir($path."layouts");
|
$lyt = scandir($path."layouts");
|
||||||
$LAYOUT = array();
|
$LAYOUT = array();
|
||||||
@@ -2098,6 +2076,37 @@ class e_menu_layout
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else // prior to v2.2.2
|
||||||
|
{
|
||||||
|
|
||||||
|
$themeFileContent = file_get_contents($file);
|
||||||
|
|
||||||
|
$srch = array('<?php','?>');
|
||||||
|
|
||||||
|
$themeFileContent = preg_replace('/\(\s?THEME\s?\./', '( e_THEME. "'.$theme.'/" .', str_replace($srch, '', $themeFileContent));
|
||||||
|
|
||||||
|
$themeFileContent = str_replace('tablestyle', $tp->filter($theme, 'wd')."_tablestyle",$themeFileContent); // rename function to avoid conflicts while parsing.
|
||||||
|
|
||||||
|
$themeFileContent = str_replace("class ".$theme."_theme", "class ".$theme."__theme", $themeFileContent); // rename class to avoid conflicts while parsing.
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
@eval($themeFileContent);
|
||||||
|
}
|
||||||
|
catch (ParseError $e)
|
||||||
|
{
|
||||||
|
echo "<div class='alert alert-danger'>Couldn't parse theme.php: ". $e->getMessage()." </div>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
e107::set('css_enabled',true);
|
||||||
|
e107::set('js_enabled',true);
|
||||||
|
|
||||||
|
$head = array();
|
||||||
|
$foot = array();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(isset($LAYOUT) && (isset($HEADER) || isset($FOOTER)))
|
if(isset($LAYOUT) && (isset($HEADER) || isset($FOOTER)))
|
||||||
|
Reference in New Issue
Block a user