diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-07 04:58:45 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-07 04:58:45 +0000 |
commit | aafa9f8bf4a2c37fd782923cb8b4813b31b3ca48 (patch) | |
tree | 5c9ba29fa13d70130efdae0e744760eb37439e5d /modules | |
parent | e5b1d1bab4303fb225a909abfc7ff55859610a09 (diff) | |
download | brdo-aafa9f8bf4a2c37fd782923cb8b4813b31b3ca48.tar.gz brdo-aafa9f8bf4a2c37fd782923cb8b4813b31b3ca48.tar.bz2 |
#928744 by bleen18, David_Rothstein: Fixed Dashboard has two admin pages called 'dashboard'.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/system/system.module | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index ce9cdf6d3..57c3c7240 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2841,6 +2841,7 @@ function system_get_module_admin_tasks($module, $info) { } $admin_tasks = array(); + $titles = array(); if ($menu = module_invoke($module, 'menu')) { foreach ($menu as $path => $item) { if (isset($links[$path])) { @@ -2851,6 +2852,25 @@ function system_get_module_admin_tasks($module, $info) { $task['description'] = $task['localized_options']['attributes']['title']; unset($task['localized_options']['attributes']['title']); } + + // Check the admin tasks for duplicate names. If one is found, + // append the parent menu item's title to differentiate. + $duplicate_path = array_search($task['title'], $titles); + if ($duplicate_path !== FALSE) { + if ($parent = menu_link_load($task['plid'])) { + // Append the parent item's title to this task's title. + $task['title'] = t('@original_title (@parent_title)', array('@original_title' => $task['title'], '@parent_title' => $parent['title'])); + } + if ($parent = menu_link_load($admin_tasks[$duplicate_path]['plid'])) { + // Append the parent item's title to the duplicated task's title. + // We use $links[$duplicate_path] in case there are triplicates. + $admin_tasks[$duplicate_path]['title'] = t('@original_title (@parent_title)', array('@original_title' => $links[$duplicate_path]['title'], '@parent_title' => $parent['title'])); + } + } + else { + $titles[$path] = $task['title']; + } + $admin_tasks[$path] = $task; } } |