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

Fix for custom menus and better filtering on available menus.

This commit is contained in:
Cameron
2013-05-10 00:13:32 -07:00
parent d1780270eb
commit b61b3cd4bd

View File

@@ -383,7 +383,13 @@ if($_SERVER['E_DEV_MENU'] == 'true')
$text .= "<li id='".$row['page_id']."' class='draggable regularMenu' style='cursor:move'>"; $text .= "<li id='".$row['page_id']."' class='draggable regularMenu' style='cursor:move'>";
// $text .= $row['menu_name']; // $text .= $row['menu_name'];
$text .= e_layout::renderMenuOptions($row); $defaults = array(
'name' => $row['menu_name'],
'path' => $row['page_id'],
'class' => '0'
);
$text .= e_layout::renderMenuOptions($defaults,'layout','area',$c);
$text .= "</li>"; $text .= "</li>";
} }
@@ -784,9 +790,23 @@ class e_layout
foreach($files as $file) foreach($files as $file)
{ {
$valid_menu = false;
if (file_exists($file['path'].'/plugin.xml') || file_exists($file['path'].'/plugin.php'))
{
if (e107::isInstalled($parent_dir))
{
$valid_menu = TRUE; // Whether new or existing, include in list
}
}
else // Just add the menu anyway
{
$valid_menu = TRUE;
}
$path = trim(str_replace(e_PLUGIN,"",$file['path']),"/"); $path = trim(str_replace(e_PLUGIN,"",$file['path']),"/");
// if(e107::isInstalled($path) ) if($valid_menu)
{ {
$fname = str_replace(".php","",$file['fname']); $fname = str_replace(".php","",$file['fname']);
$data[$fname] = $path; $data[$fname] = $path;