diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-10-30 21:43:41 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-10-30 21:43:41 +0000 |
commit | 3d1058eb264f5269bfc268e94bb8de0c4aa5dc01 (patch) | |
tree | 47730fa3fde13069833a1261b491ca890f8f1778 /modules/toolbar/toolbar.module | |
parent | d72539f1b5667948b4ccd2021d0c56bb67530600 (diff) | |
download | brdo-3d1058eb264f5269bfc268e94bb8de0c4aa5dc01.tar.gz brdo-3d1058eb264f5269bfc268e94bb8de0c4aa5dc01.tar.bz2 |
- Patch #519046 by catch, pwolanin, sun: clean up toolbar menu code and added TODOs.
Diffstat (limited to 'modules/toolbar/toolbar.module')
-rw-r--r-- | modules/toolbar/toolbar.module | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/toolbar/toolbar.module b/modules/toolbar/toolbar.module index 9003daedc..4868e78e0 100644 --- a/modules/toolbar/toolbar.module +++ b/modules/toolbar/toolbar.module @@ -134,14 +134,12 @@ function toolbar_get_menu_tree() { $tree = array(); $admin_link = db_query("SELECT * FROM {menu_links} WHERE menu_name = 'management' AND module = 'system' AND link_path = 'admin'")->fetchAssoc(); if ($admin_link) { - $tree = menu_tree_all_data('management', $admin_link); + // @todo Use a function like book_menu_subtree_data(). + $tree = menu_tree_all_data('management', $admin_link, $admin_link['depth'] + 1); // The tree will be a sub-tree with the admin link as a single root item. + // @todo It is wrong to assume it's the last. $admin_link = array_pop($tree); $tree = $admin_link['below'] ? $admin_link['below'] : array(); - foreach ($tree as $key => $item) { - // Get rid of subitems to have a leaner data structure. - unset($tree[$key]['below']); - } } return $tree; } |