diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-03-14 02:28:05 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-03-14 02:28:05 +0000 |
commit | 1811d659f26a78d781b42f2579ce93893cf74774 (patch) | |
tree | 608f11f1ba84fa9de8a55d78b687d471f16e40fa | |
parent | b77475baf5eee88f7ca08adaf53c7c5eda6aca58 (diff) | |
download | brdo-1811d659f26a78d781b42f2579ce93893cf74774.tar.gz brdo-1811d659f26a78d781b42f2579ce93893cf74774.tar.bz2 |
#372914 by chx: Fix link titles when using a non-t() callback.
-rw-r--r-- | includes/menu.inc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/includes/menu.inc b/includes/menu.inc index 816b535ef..cff3ef5d8 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -536,9 +536,13 @@ function _menu_check_access(&$item, $map) { function _menu_item_localize(&$item, $map, $link_translate = FALSE) { $callback = $item['title_callback']; $item['localized_options'] = $item['options']; - // If we are not doing link translation or if the title matches the - // link title of its router item, localize it. - if (!$link_translate || (!empty($item['title']) && ($item['title'] == $item['link_title']))) { + // If we are translating the title of a menu link, and its title is the same + // as the corresponding router item, then we can use the title information + // from the router. If it's customized, then we need to use the link title + // itself; can't localize. + // If we are translating a router item (tabs, page, breadcrumb), then we + // can always use the information from the router item. + if (!$link_translate || ($item['title'] == $item['link_title'])) { // t() is a special case. Since it is used very close to all the time, // we handle it directly instead of using indirect, slower methods. if ($callback == 't') { |