You are here

function menutree_display in MenuTree 6

Same name and namespace in other branches
  1. 5 menutree.module \menutree_display()

Display a fully-expanded version of the menu specified on the path

Parameters

$menu: The menu to display.

$title_display: How to handle the display of the title. This is a bitmask that can take multiple values.

2 calls to menutree_display()
menutree_display_all in ./menutree.pages.inc
Menu callback; Display a fully-expanded version of all flagged menus.
menutree_display_page in ./menutree.pages.inc
Menu callback; Display a menu tree for a single specified menu.

File

./menutree.pages.inc, line 57
User-facing page callbacks for the menutree module.

Code

function menutree_display($menu, $title_display = MENUTREE_TITLE_PAGE) {
  $output = '';

  // The title could be displayed in various ways.
  $title = variable_get('menutree_title_' . $menu['menu_name'], '');
  if (!$title) {
    $title = $menu['title'];
  }
  $title = check_plain($title);
  if ($title_display & MENUTREE_TITLE_PAGE) {
    drupal_set_title($title);
  }

  // Output custom intro text.
  $intro = variable_get('menutree_intro_text_' . $menu['menu_name'], '');
  $description = '';
  if (!empty($intro)) {
    $description = check_markup($intro, FILTER_FORMAT_DEFAULT, FALSE);
  }
  $tree = menu_tree_output(menu_tree_all_data($menu['menu_name']));
  return theme('menutree_page', $title, $description, $tree);
}