summaryrefslogtreecommitdiff
path: root/modules/system/system.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system/system.module')
-rw-r--r--modules/system/system.module17
1 files changed, 12 insertions, 5 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index 87d82ebfb..73509726f 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -477,21 +477,28 @@ 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']));
+ $item += db_fetch_array(db_query("SELECT mlid, menu_name FROM {menu_links} ml WHERE ml.router_path = '%s' AND module = 'system'", $item['path']));
}
$result = db_query("
- SELECT *
+ SELECT m.*, ml.*
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']);
+ WHERE ml.plid = %d AND ml.menu_name = '%s' AND hidden = 0", $item['mlid'], $item['menu_name']);
while ($item = db_fetch_array($result)) {
_menu_link_translate($item);
if (!$item['access']) {
continue;
}
- $content[] = (array)$item;
+ // The link 'description' either derived from the hook_menu 'description' or
+ // entered by the user via menu module is saved as the title attribute.
+ if (!empty($item['options']['attributes']['title'])) {
+ $item['description'] = $item['options']['attributes']['title'];
+ }
+ // Prepare for sorting as in function _menu_tree_check_access().
+ // The weight is offset so it is always positive, with a uniform 5-digits.
+ $content[(50000 + $item['weight']) .' '. $item['title'] .' '. $item['mlid']] = $item;
}
+ ksort($content);
return $content;
}