You are here

function quickbar_menu_tree_links in Quickbar 7

Same name and namespace in other branches
  1. 6 quickbar.module \quickbar_menu_tree_links()
  2. 7.2 quickbar.module \quickbar_menu_tree_links()

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

1 call to quickbar_menu_tree_links()
quickbar_menu_tree in ./quickbar.module
Retrieve a hierarchy of links representing select portions of the menu.

File

./quickbar.module, line 346

Code

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

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

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