1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 06:07:32 +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; $CUSTOMHEADER = null;
$CUSTOMFOOTER = null; $CUSTOMFOOTER = null;
$path = e_THEME.$theme.'/';
$file = e_THEME.$theme."/theme.php"; $file = $path."theme.php";
if(!is_readable($file)) if(!is_readable($file))
{ {
@@ -2029,9 +2029,28 @@ class e_menu_layout
$head = array(); $head = array();
$foot = 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."' />"; $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(); $layouts = self::getLayouts();
$tp = e107::getParser(); $tp = e107::getParser();
// $text .= print_a($layouts['menus'],true); // var_dump($layouts['menus']);
$text .= ' $text .= '

View File

@@ -83,9 +83,12 @@ class e_theme
* @param string $key layout name * @param string $key layout name
* @return array|bool * @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")) 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; return $LAYOUT;
} }
/** /**
* Load library dependencies. * Load library dependencies.
* *