toolbar_get_menu_tree
function toolbar_get_menu_tree
toolbar_get_menu_tree()
Gets only the top level items below the 'admin' path.
Return value
An array containing a menu tree of top level items below the 'admin' path.
File
- modules/toolbar/toolbar.module, line 284
- Administration toolbar for quick access to top level administration items.
Code
function toolbar_get_menu_tree() { $tree = array(); $admin_link = db_query('SELECT * FROM {menu_links} WHERE menu_name = :menu_name AND module = :module AND link_path = :path', array(':menu_name' => 'management', ':module' => 'system', ':path' => 'admin'))->fetchAssoc(); if ($admin_link) { $tree = menu_build_tree('management', array( 'expanded' => array($admin_link['mlid']), 'min_depth' => $admin_link['depth'] + 1, 'max_depth' => $admin_link['depth'] + 1, )); } return $tree; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!toolbar!toolbar.module/function/toolbar_get_menu_tree/7.x