1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

Support for {MENUAREA} - testing needed.

This commit is contained in:
Cameron
2019-08-22 13:18:09 -07:00
parent c3b3b0077c
commit 68e4fd7d03

View File

@@ -1420,11 +1420,11 @@ class e_menuManager {
{ {
if($check) if($check)
{ {
if(strstr($tmp[$c], "{MENU=")) if(strpos($tmp[$c], "{MENU=")!==false || strpos($tmp[$c], "{MENUAREA=")!==false)
{ {
$matches = array(); $matches = array();
// Match all menu areas, menu number is limited to tinyint(3) // Match all menu areas, menu number is limited to tinyint(3)
preg_match_all("/\{MENU=([\d]{1,3})(:[\w\d]*)?\}/", $tmp[$c], $matches); preg_match_all("/\{(?:MENU|MENUAREA)=([\d]{1,3})(:[\w\d]*)?\}/", $tmp[$c], $matches);
$this->menuSetCode($matches, $str); $this->menuSetCode($matches, $str);
} }
} }
@@ -1613,13 +1613,13 @@ class e_menuManager {
{ {
$matches = array(); $matches = array();
if(preg_match_all("/\{MENU=([\d]{1,3})(:[\w\d]*)?\}/", $str, $matches)) if(preg_match_all("/\{(?:MENU|MENUAREA)=([\d]{1,3})(:[\w\d]*)?\}/", $str, $matches)) //
{ {
$menuText = ""; $menuText = "";
foreach($matches[1] as $menu) foreach($matches[1] as $menu)
{ {
$menu = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $str); $menu = preg_replace("/\{(?:MENU|MENUAREA)=(.*?)(:.*?)?\}/si", "\\1", $str);
if(isset($sc_style['MENU']['pre']) && strpos($str, 'ret') !== false) if(isset($sc_style['MENU']['pre']) && strpos($str, 'ret') !== false)
{ {
$menuText .= $sc_style['MENU']['pre']; $menuText .= $sc_style['MENU']['pre'];
@@ -2202,7 +2202,7 @@ class e_menu_layout
private static function countMenus($template, $name) private static function countMenus($template, $name)
{ {
if(preg_match_all("/\{MENU=([\d]{1,3})(:[\w\d]*)?\}/", $template, $matches)) if(preg_match_all("/\{(?:MENU|MENUAREA)=([\d]{1,3})(:[\w\d]*)?\}/", $template, $matches))
{ {
sort($matches[1]); sort($matches[1]);
return $matches[1]; return $matches[1];