From a243145d3fef5996394518a2a3a9f8254ed2202a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 16 May 2007 13:45:17 +0000 Subject: - Patch #137767 by chx and pwolanin: multiple menu support. --- modules/system/system.module | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'modules/system/system.module') diff --git a/modules/system/system.module b/modules/system/system.module index fc884d076..4ba52e8c3 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -399,11 +399,11 @@ function system_main_admin_page($arg = NULL) { if (system_status(TRUE)) { drupal_set_message(t('One or more problems were detected with your Drupal installation. Check the status report for more information.', array('@status' => url('admin/logs/status'))), 'error'); } - - $map = arg(NULL); - $result = db_query("SELECT * FROM {menu} WHERE path LIKE 'admin/%%' AND depth = 2 AND visible = 1 AND path != 'admin/help' ORDER BY mleft"); + $result = db_query("SELECT * FROM {menu_links} ml INNER JOIN {menu_router} m ON ml.router_path = m.path + WHERE ml.href like 'admin/%' AND ml.href != 'admin/help' AND ml.depth = 2 AND ml.menu_name = 'navigation' + ORDER BY p1 ASC, p2 ASC, p3 ASC"); while ($item = db_fetch_object($result)) { - _menu_translate($item, $map, MENU_RENDER_LINK); + _menu_link_translate($item); if (!$item->access) { continue; } @@ -423,11 +423,14 @@ function system_main_admin_page($arg = NULL) { * Provide a single block on the administration overview page. */ function system_admin_menu_block($item) { - $map = arg(NULL); $content = array(); - $result = db_query('SELECT * FROM {menu} WHERE depth = %d AND %d < mleft AND mright < %d AND visible = 1 ORDER BY mleft', $item->depth + 1, $item->mleft, $item->mright); + if (!isset($item->mlid)) { + $item->mlid = db_result(db_query("SELECT mlid FROM {menu_links} ml WHERE ml.router_path = '%s' AND menu_name = 'navigation'", $item->path)); + } + $result = db_query("SELECT * FROM {menu_links} ml INNER JOIN {menu_router} m ON ml.router_path = m.path + WHERE ml.plid = '%s' AND ml.menu_name = 'navigation' ORDER BY m.weight, m.title", $item->mlid); while ($item = db_fetch_object($result)) { - _menu_translate($item, $map, MENU_RENDER_LINK); + _menu_link_translate($item); if (!$item->access) { continue; } @@ -1657,6 +1660,8 @@ function system_modules_submit($form_values, $form, &$form_state) { $dependencies = NULL; } + // Temporarily disable menu module while it's broken. + unset($form_values['status']['menu']); $enable_modules = array(); $disable_modules = array(); foreach ($form_values['status'] as $key => $choice) { @@ -1700,8 +1705,8 @@ function system_modules_submit($form_values, $form, &$form_state) { if ($old_module_list != $current_module_list) { drupal_rebuild_theme_registry(); - menu_rebuild(); node_types_rebuild(); + menu_rebuild(); drupal_set_message(t('The configuration options have been saved.')); } @@ -2494,14 +2499,14 @@ function theme_admin_block_content($content) { $item['attributes'] = array(); } $item['attributes'] += array('title' => $item['description']); - $output .= '
  • '. l($item['title'], $item['path'], $item) .'
  • '; + $output .= '
  • '. l($item['title'], $item['href'], $item['options']) .'
  • '; } $output .= ''; } else { $output = '
    '; foreach ($content as $item) { - $output .= '
    '. l($item['title'], $item['path'], $item) .'
    '; + $output .= '
    '. l($item['title'], $item['href'], $item['options']) .'
    '; $output .= '
    '. $item['description'] .'
    '; } $output .= '
    '; -- cgit v1.2.3