From a1537c3e287090609c0392b620f6c05e345c17d8 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 12 Jun 2008 20:49:39 +0000 Subject: - Patch #266596 by pwolanin: menu system performance improvement. --- includes/menu.inc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'includes') diff --git a/includes/menu.inc b/includes/menu.inc index 35faf77dd..2444d122e 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -622,8 +622,11 @@ function _menu_translate(&$router_item, $map, $to_arg = FALSE) { $router_item['href'] = implode('/', $link_map); $router_item['options'] = array(); _menu_check_access($router_item, $map); - - _menu_item_localize($router_item, $map); + + // For performance, don't localize an item the user can't access. + if ($router_item['access']) { + _menu_item_localize($router_item, $map); + } return $map; } @@ -701,8 +704,10 @@ function _menu_link_translate(&$item) { } _menu_check_access($item, $map); } - - _menu_item_localize($item, $map, TRUE); + // For performance, don't localize a link the user can't access. + if ($item['access']) { + _menu_item_localize($item, $map, TRUE); + } } // Allow other customizations - e.g. adding a page-specific query string to the -- cgit v1.2.3