From a8ceb7613b808c1b6643e910f96dc7319012bf67 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 27 May 2007 20:31:13 +0000 Subject: - Patch #145058 by pwolanin (and chx): re-parenting and caching for menu links. --- modules/system/system.module | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'modules/system/system.module') diff --git a/modules/system/system.module b/modules/system/system.module index 3820d27ef..b94bc9742 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -144,6 +144,7 @@ function system_menu() { $items['admin/by-task'] = array( 'title' => 'By task', 'page callback' => 'system_main_admin_page', + 'file' => 'system.admin.inc', 'type' => MENU_DEFAULT_LOCAL_TASK, ); $items['admin/by-module'] = array( @@ -392,14 +393,18 @@ function system_user($type, $edit, &$user, $category = NULL) { */ function system_admin_menu_block($item) { $content = array(); - 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)) { + 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 = %d AND ml.menu_name = 'navigation' AND hidden = 0 + ORDER BY m.weight, m.title", $item['mlid']); + while ($item = db_fetch_array($result)) { _menu_link_translate($item); - if (!$item->access) { + if (!$item['access']) { continue; } $content[] = (array)$item; @@ -1670,9 +1675,6 @@ function system_modules_submit($form_values, $form, &$form_state) { } } - // Temporarily disable menu module while it's broken. - unset($form_values['status']['menu']); - // If there where unmet dependencies and they haven't confirmed don't process // the submission yet. Store the form submission data needed later. if ($dependencies) { -- cgit v1.2.3