diff --git a/e107_handlers/menu_class.php b/e107_handlers/menu_class.php index 3775fb417..b22a9dd87 100644 --- a/e107_handlers/menu_class.php +++ b/e107_handlers/menu_class.php @@ -10,9 +10,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/menu_class.php,v $ -| $Revision: 1.1 $ -| $Date: 2009-07-16 02:55:19 $ -| $Author: e107coders $ +| $Revision: 1.2 $ +| $Date: 2009-07-16 19:19:07 $ +| $Author: e107steved $ +----------------------------------------------------------------------------+ */ if (!defined('e107_INIT')) { exit; } @@ -349,37 +349,36 @@ class menuManager{ $fileList = $efile->get_files(e_PLUGIN,"_menu\.php$",'standard',2); foreach($fileList as $file) { - list($parent_dir) = explode('/',str_replace(e_PLUGIN,"",$file['path'])); - $file['path'] = str_replace(e_PLUGIN,"",$file['path']); - $file['fname'] = str_replace(".php","",$file['fname']); - $valid_menu = FALSE; - $existing_menu = $sql->db_Count("menus", "(*)", "WHERE menu_name='{$file['fname']}'"); - if (file_exists(e_PLUGIN.$parent_dir."/plugin.xml") || - file_exists(e_PLUGIN.$parent_dir."/plugin.php")) - { - // include(e_PLUGIN.$parent_dir."/plugin.php"); - if (isset($pref['plug_installed'][$parent_dir])) - // if ($sql->db_Select("plugin", "*", "plugin_path='".$eplug_folder."' AND plugin_installflag='1' ")) - { // Its a 'new style' plugin with a plugin.php file, or an even newer one with plugin.xml file - only include if plugin installed - $valid_menu = TRUE; // Whether new or existing, include in list + list($parent_dir) = explode('/',str_replace(e_PLUGIN,"",$file['path'])); + $file['path'] = str_replace(e_PLUGIN,"",$file['path']); + $file['fname'] = str_replace(".php","",$file['fname']); + $valid_menu = FALSE; + $existing_menu = $sql->db_Count("menus", "(*)", "WHERE menu_name='{$file['fname']}'"); + if (file_exists(e_PLUGIN.$parent_dir.'/plugin.xml') || file_exists(e_PLUGIN.$parent_dir.'/plugin.php')) + { + if (plugInstalled($parent_dir)) + { // Its a 'new style' plugin with a plugin.php file, or an even newer one with plugin.xml file - only include if plugin installed + $valid_menu = TRUE; // Whether new or existing, include in list +// echo "Include {$parent_dir}:{$file['fname']}
"; + } } - } - else - { // Just add the menu anyway - $valid_menu = TRUE; - } - if ($valid_menu) - { - $menustr .= "&".str_replace(".php", "", $file['fname']); - if (!$existing_menu) - { // New menu to add to list - if($sql->db_Insert("menus", " 0, '{$file['fname']}', 0, 0, 0, '' ,'{$file['path']}', ''")) - { + else + { // Just add the menu anyway + $valid_menu = TRUE; +// echo "Default Include {$parent_dir}:{$file['fname']}
"; + } + if ($valid_menu) + { + $menustr .= "&".str_replace(".php", "", $file['fname']); + if (!$existing_menu) + { // New menu to add to list + if($sql->db_Insert("menus", " 0, '{$file['fname']}', 0, 0, 0, '' ,'{$file['path']}', ''")) + { // Could do admin logging here - but probably not needed - $message .= "".MENLAN_10." - ".$file['fname']."
"; - } + $message .= "".MENLAN_10." - ".$file['fname']."
"; + } + } } - } } //Reorder all menus into 1...x order @@ -696,7 +695,7 @@ class menuManager{ $text .= "".MENLAN_36."......".MENLAN_37.""; $text .= ""; - $sql->db_Select("menus", "menu_name, menu_id, menu_pages", "1 GROUP BY menu_name ORDER BY menu_name ASC"); + $sql->db_Select("menus", "menu_name, menu_id, menu_pages, menu_path", "1 GROUP BY menu_name ORDER BY menu_name ASC"); if(!$this->dragDrop) { @@ -721,7 +720,7 @@ class menuManager{ else { $row['menu_name'] = preg_replace("#_menu$#i", "", $row['menu_name']); - if($pnum = $this->checkMenuPreset($menuPreset,$row['menu_name']."_menu")) + if($pnum = $this->checkMenuPreset($menuPreset,$row['menu_name'].'_menu')) { $pdeta = MENLAN_39." {$pnum}"; } @@ -729,8 +728,9 @@ class menuManager{ if(!$this->dragDrop) { + $menuInf = (strlen($row['menu_path']) > 1) ? ' ('.substr($row['menu_path'],0,-1).')' : ''; $text .= " - ".$row['menu_name']." + ".$row['menu_name'].$menuInf." ".$pdeta."  \n"; } @@ -738,7 +738,7 @@ class menuManager{ { $text .= "
dbLayout."' style='border:1px outset black;text-align:left;color:black'> -
".$row['menu_name']." $pdeta
+
".$row['menu_name']." {$pdeta}
"; $text .= $this->menuRenderMenu($row,$menu_count); $text .= "
\n";