1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

Make menu display work

This commit is contained in:
e107steved
2008-06-24 20:53:07 +00:00
parent e312bd359a
commit 4b5d70576f

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_admin/menus.php,v $ | $Source: /cvs_backup/e107_0.8/e107_admin/menus.php,v $
| $Revision: 1.6 $ | $Revision: 1.7 $
| $Date: 2007-11-18 03:05:06 $ | $Date: 2008-06-24 20:53:07 $
| $Author: mcfly_e107 $ | $Author: e107steved $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
require_once("../class2.php"); require_once("../class2.php");
@@ -29,7 +29,7 @@ $frm = new form;
if($_POST) if($_POST)
{ {
print_a($_POST); // print_a($_POST);
// exit; // exit;
$e107cache->clear("menus_"); $e107cache->clear("menus_");
} }
@@ -444,26 +444,39 @@ else
} }
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
function parseheader($LAYOUT, $check = FALSE) { function parseheader($LAYOUT, $check = FALSE)
$tmp = explode("\n", $LAYOUT); {
for ($c = 0; $c < count($tmp); $c++) { // $tmp = explode("\n", $LAYOUT);
if (preg_match("/[\{|\}]/", $tmp[$c])) { // Split up using the same function as the shortcode handler
if ($check) { $tmp = preg_split('#(\{\S[^\x02]*?\S\})#', $LAYOUT, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
if (strstr($tmp[$c], "{MENU=")) { for ($c = 0; $c < count($tmp); $c++)
$str[] = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $tmp[$c]); {
} if (preg_match("/[\{|\}]/", $tmp[$c]))
} else { {
checklayout($tmp[$c]); if ($check)
} {
} else { if (strstr($tmp[$c], "{MENU="))
if (!$check) { {
echo $tmp[$c]; $str[] = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $tmp[$c]);
}
} }
}
else
{
checklayout($tmp[$c]);
}
}
else
{
if (!$check)
{
echo $tmp[$c];
}
} }
if ($check) { }
return $str; if ($check)
} {
return $str;
}
} }
function checklayout($str) function checklayout($str)