menu_tree_data

  1. drupal
    1. 6
    2. 7
Versions
6 menu_tree_data($result = NULL, $parents = array(), $depth = 1)
7 menu_tree_data(array $links, array $parents = array(), $depth = 1)

Build the data representing a menu tree.

Parameters

$links An array of links (associative arrays) ordered by p1..p9.

$parents An array of the plid values that represent the path from the current page to the root of the menu tree.

$depth The minimum depth of any link in the $links array.

Return value

See menu_tree_page_data for a description of the data structure.

Related topics

▾ 3 functions call menu_tree_data()

book_menu_subtree_data in drupal/modules/book/book.module
Get the data representing a subtree of the book hierarchy.
menu_overview_form in drupal/modules/menu/menu.admin.inc
Form for editing an entire menu tree at once.
_menu_build_tree in drupal/includes/menu.inc
Build a menu tree.

Code

drupal/includes/menu.inc, line 1473

<?php
function menu_tree_data(array $links, array $parents = array(), $depth = 1) {
  // Reverse the array so we can use the more efficient array_pop() function.
  $links = array_reverse($links);
  return _menu_tree_data($links, $parents, $depth);
}
?>