function 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.

2 calls to toolbar_get_menu_tree()
toolbar_get_rendered_subtrees in drupal/core/modules/toolbar/toolbar.module
Returns the rendered subtree of each top-level toolbar link.
toolbar_toolbar in drupal/core/modules/toolbar/toolbar.module
Implements hook_toolbar().

File

drupal/core/modules/toolbar/toolbar.module, line 359
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' => 'admin',
    ':module' => 'system',
    ':path' => 'admin',
  ))
    ->fetchAssoc();
  if ($admin_link) {
    $tree = menu_build_tree('admin', array(
      'expanded' => array(
        $admin_link['mlid'],
      ),
      'min_depth' => $admin_link['depth'] + 1,
      'max_depth' => $admin_link['depth'] + 1,
    ));
  }
  return $tree;
}