From 322af72d07cdf66d9ee80f222bf3b4771fd657c0 Mon Sep 17 00:00:00 2001 From: e107steved Date: Tue, 6 Mar 2007 19:59:36 +0000 Subject: [PATCH] Bugtracker #3833 - missing global --- e107_admin/menus.php | 92 ++++++++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 34 deletions(-) diff --git a/e107_admin/menus.php b/e107_admin/menus.php index 63ad7afea..267c005cb 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -11,8 +11,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/menus.php,v $ -| $Revision: 1.3 $ -| $Date: 2007-02-10 13:36:20 $ +| $Revision: 1.4 $ +| $Date: 2007-03-06 19:59:27 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -33,35 +33,45 @@ if($_POST) { $menus_equery = explode('.', e_QUERY); -if (isset($_POST['custom_select'])) { +if (isset($_POST['custom_select'])) +{ $menus_equery[1] = $_POST['custom_select']; //header("location:".e_SELF."?".$_POST['custom_select']); //exit; -} else if (!isset($menus_equery[1])) { +} + else if (!isset($menus_equery[1])) +{ $menus_equery[1] = ''; } -if ($menus_equery[1] == '' || $menus_equery[1] == 'default_layout') { + +if ($menus_equery[1] == '' || $menus_equery[1] == 'default_layout') +{ $menus_header = $HEADER; $menus_footer = $FOOTER; } -else if ($menus_equery[1] == 'custom_layout') { +else if ($menus_equery[1] == 'custom_layout') +{ $menus_header = $CUSTOMHEADER ? $CUSTOMHEADER : $HEADER; $menus_footer = $CUSTOMFOOTER ? $CUSTOMFOOTER : $FOOTER; } -else if ($menus_equery[1] == 'newsheader_layout') { +else if ($menus_equery[1] == 'newsheader_layout') +{ $menus_header = $NEWSHEADER ? $NEWSHEADER : $HEADER; $menus_footer = $FOOTER; -} else { +} +else +{ $menus_header = $CUSTOMHEADER[$menus_equery[1]] ? $CUSTOMHEADER[$menus_equery[1]] : $HEADER; $menus_footer = $CUSTOMFOOTER[$menus_equery[1]] ? $CUSTOMFOOTER[$menus_equery[1]] : $FOOTER; } + $layouts_str = $HEADER.$FOOTER; if ($NEWSHEADER) { $layouts_str .= $NEWSHEADER; @@ -424,53 +434,67 @@ function parseheader($LAYOUT, $check = FALSE) { } } -function checklayout($str) { - global $pref, $menu_areas, $ns, $PLUGINS_DIRECTORY, $frm, $sc_style, $tp; +function checklayout($str) +{ // Displays a basic representation of the theme + global $pref, $menu_areas, $ns, $PLUGINS_DIRECTORY, $frm, $sc_style, $tp, $menus_equery; - if (strstr($str, "LOGO")) { - echo $tp -> parseTemplate("{LOGO}"); + if (strstr($str, "LOGO")) + { + echo $tp -> parseTemplate("{LOGO}"); } - else if(strstr($str, "SITENAME")) { - echo "
[SiteName]
"; + else if(strstr($str, "SITENAME")) + { + echo "
[SiteName]
"; } - else if (strstr($str, "SITETAG")) { - echo "
[SiteTag]
"; + else if (strstr($str, "SITETAG")) + { + echo "
[SiteTag]
"; } - else if (strstr($str, "SITELINKS")) { - echo "
[SiteLinks]
"; + else if (strstr($str, "SITELINKS")) + { + echo "
[SiteLinks]
"; } - else if (strstr($str, "LANGUAGELINKS")) { - echo "
[Language]
"; } - else if (strstr($str, "CUSTOM")) { - $cust = preg_replace("/\W*\{CUSTOM=(.*?)(\+.*)?\}\W*/si", "\\1", $str); - echo "
[".$cust."]
"; + else if (strstr($str, "LANGUAGELINKS")) + { + echo "
[Language]
"; + } + else if (strstr($str, "CUSTOM")) + { + $cust = preg_replace("/\W*\{CUSTOM=(.*?)(\+.*)?\}\W*/si", "\\1", $str); + echo "
[".$cust."]
"; } // Display embedded Plugin information. - else if (strstr($str, "PLUGIN")){ + else if (strstr($str, "PLUGIN")) + { $plug = preg_replace("/\{PLUGIN=(.*?)\}/si", "\\1", $str); $plug = trim($plug); - if (file_exists((e_PLUGIN."{$plug}/{$plug}_config.php"))){ - $link = e_PLUGIN."{$plug}/{$plug}_config.php"; + if (file_exists((e_PLUGIN."{$plug}/{$plug}_config.php"))) + { + $link = e_PLUGIN."{$plug}/{$plug}_config.php"; } - if(file_exists((e_PLUGIN.$plug."/config.php"))){ - $link = e_PLUGIN.$plug."/config.php"; + if(file_exists((e_PLUGIN.$plug."/config.php"))) + { + $link = e_PLUGIN.$plug."/config.php"; } $plugtext = ($link) ? "(".MENLAN_34.":".MENLAN_16.")" : "(".MENLAN_34.")" ; echo "
"; $ns -> tablerender($plug, $plugtext); } - else if (strstr($str, "MENU")) { + else if (strstr($str, "MENU")) + { $ns = new e107table; $menu = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $str); - if (isset($sc_style['MENU']['pre']) && strpos($str, 'ret') !== false) { - echo $sc_style['MENU']['pre']; + if (isset($sc_style['MENU']['pre']) && strpos($str, 'ret') !== false) + { + echo $sc_style['MENU']['pre']; } echo "
".MENLAN_14." ".$menu."

"; $text = " "; $sql9 = new db; - if ($sql9->db_Count("menus", "(*)", " WHERE menu_location='$menu' ")) { + if ($sql9->db_Count("menus", "(*)", " WHERE menu_location='$menu' ")) + { unset($text); echo $frm->form_open("post", e_SELF."?configure.".$menus_equery[1], "frm_menu_".intval($menu)); @@ -487,12 +511,12 @@ function checklayout($str) { $conf = ''; if (file_exists(e_PLUGIN."{$menu_path}/{$menu_name}_menu_config.php")) { - $conf = "config.{$menu_path}.{$menu_name}_menu_config"; + $conf = "config.{$menu_path}.{$menu_name}_menu_config"; } if($conf == '' && file_exists(e_PLUGIN."{$menu_path}/config.php")) { - $conf = "config.{$menu_path}.config"; + $conf = "config.{$menu_path}.config"; } $text .= "