1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 21:57:51 +02:00

Menu-Manager {MENU} count fix for *_layout.html format.

This commit is contained in:
Cameron
2019-06-17 10:16:27 -07:00
parent dc53fb37a1
commit 6ae0bee2fe
2 changed files with 30 additions and 9 deletions

View File

@@ -1992,8 +1992,8 @@ class e_menu_layout
$CUSTOMHEADER = null;
$CUSTOMFOOTER = null;
$file = e_THEME.$theme."/theme.php";
$path = e_THEME.$theme.'/';
$file = $path."theme.php";
if(!is_readable($file))
{
@@ -2029,9 +2029,28 @@ class e_menu_layout
$head = array();
$foot = array();
if(!isset($LAYOUT))
// new v2.2.2 HTML layout support.
if(empty($LAYOUT) && is_dir($path."layouts"))
{
$LAYOUT = e_theme::loadLayout(THEME_LAYOUT);
$lyt = scandir($path."layouts");
$LAYOUT = array();
foreach($lyt as $lays)
{
if($lays === '.' || $lays === '..')
{
continue;
}
$key = str_replace("_layout.html", '', $lays);
if($lm = e_theme::loadLayout($key, $theme))
{
$LAYOUT = $LAYOUT + $lm;
}
}
}
@@ -2217,12 +2236,10 @@ class e_menu_layout
$text .= "<input type='hidden' id='curLayout' value='".$defLayout."' />";
//TODO FIXME parse the theme file (or store it somewhere) to get the number of menu areas for each layout. ie. $menu_areas below.
$layouts = self::getLayouts();
$tp = e107::getParser();
// $text .= print_a($layouts['menus'],true);
// var_dump($layouts['menus']);
$text .= '

View File

@@ -83,9 +83,12 @@ class e_theme
* @param string $key layout name
* @return array|bool
*/
public static function loadLayout($key)
public static function loadLayout($key=null, $theme = null)
{
$theme = e107::pref('core','sitetheme');
if($theme === null)
{
$theme = e107::pref('core','sitetheme');
}
if(!is_readable(e_THEME.$theme."/layouts/".$key."_layout.html") || !is_readable(e_THEME.$theme."/theme.html"))
{
@@ -104,6 +107,7 @@ class e_theme
return $LAYOUT;
}
/**
* Load library dependencies.
*