You are here

function admin_menu_tree_links in Admin 6

Build a hierarchy of $links arrays suitable for theme_links() from a menu tree.

1 call to admin_menu_tree_links()
admin_menu_tree in ./admin.module
Retrieve a hierarchy of links representing select portions of the 'admin' branch of the navigation menu.

File

./admin.module, line 539

Code

function admin_menu_tree_links($tree, &$links, $parent = 'admin', $depth = 0) {

  // Create a single level of links.
  $links[$depth][$parent] = array();
  $l = admin_menu_navigation_links($tree, TRUE);
  if (!empty($l)) {
    $links[$depth][$parent] = $l;
  }

  // Recurse
  foreach ($tree as $item) {
    if (!$item['link']['hidden'] && !empty($item['link']['options']['admin'])) {
      if (!empty($item['below'])) {
        admin_menu_tree_links($item['below'], $links, $item['link']['href'], $depth + 1);
      }
    }
  }
}