function menu_build_tree

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 menu.inc menu_build_tree($menu_name, array $parameters = array())
cle7 menu.inc menu_build_tree($menu_name, array $parameters = array())
elmsmedia7 menu.inc menu_build_tree($menu_name, array $parameters = array())
icor7 menu.inc menu_build_tree($menu_name, array $parameters = array())
meedjum_blog7 menu.inc menu_build_tree($menu_name, array $parameters = array())
mooc7 menu.inc menu_build_tree($menu_name, array $parameters = array())

Builds a menu tree, translates links, and checks access.

Parameters

$menu_name: The name of the menu.

$parameters: (optional) An associative array of build parameters. Possible keys:

  • expanded: An array of parent link ids to return only menu links that are children of one of the plids in this list. If empty, the whole menu tree is built, unless 'only_active_trail' is TRUE.
  • active_trail: An array of mlids, representing the coordinates of the currently active menu link.
  • only_active_trail: Whether to only return links that are in the active trail. This option is ignored, if 'expanded' is non-empty. Internally used for breadcrumbs.
  • min_depth: The minimum depth of menu links in the resulting tree. Defaults to 1, which is the default to build a whole tree for a menu (excluding menu container itself).
  • max_depth: The maximum depth of menu links in the resulting tree.
  • conditions: An associative array of custom database select query condition key/value pairs; see _menu_build_tree() for the actual query.

Return value

A fully built menu tree.

Related topics

5 calls to menu_build_tree()
admin_menu_admin_menu_output_build in sites/all/modules/ulmus/admin_menu/admin_menu.module
Implements hook_admin_menu_output_build().
admin_menu_links_icon in sites/all/modules/ulmus/admin_menu/admin_menu.inc
Build icon menu links; mostly containing maintenance helpers.
menu_tree_all_data in includes/menu.inc
Gets the data structure representing a named menu tree.
menu_tree_page_data in includes/menu.inc
Gets the data structure for a named menu tree, based on the current page.
toolbar_get_menu_tree in modules/toolbar/toolbar.module
Gets only the top level items below the 'admin' path.

File

includes/menu.inc, line 1351
API for the Drupal menu system.

Code

function menu_build_tree($menu_name, array $parameters = array()) {
  // Build the menu tree.
  $data = _menu_build_tree($menu_name, $parameters);
  // Check access for the current user to each item in the tree.
  menu_tree_check_access($data['tree'], $data['node_links']);
  return $data['tree'];
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.