diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-09-01 14:41:21 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-09-01 14:41:21 +0000 |
commit | dd3bb47dac80d79e52276da6d32761962b094f91 (patch) | |
tree | a2b9929f3595b8c555c502552d63e0174be160f2 /modules/system/system.module | |
parent | 14692ac3a3954763e185ae5554f7753a83373656 (diff) | |
download | brdo-dd3bb47dac80d79e52276da6d32761962b094f91.tar.gz brdo-dd3bb47dac80d79e52276da6d32761962b094f91.tar.bz2 |
#159527 by chx, webernet and pwolanin: fix system admin menus if admin menu was moved from the default location
Diffstat (limited to 'modules/system/system.module')
-rw-r--r-- | modules/system/system.module | 17 |
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; } |