You are here

function admin_menu_tree_output in Administration menu 6

Returns a rendered menu tree.

Parameters

$tree: A data structure representing the tree as returned from menu_tree_data.

Return value

string The complete, rendered administration menu.

1 call to admin_menu_tree_output()
admin_menu_footer in ./admin_menu.module
Implementation of hook_footer().

File

./admin_menu.module, line 160
Renders a menu tree for administrative purposes as a dropdown menu at the top of the window.

Code

function admin_menu_tree_output($tree) {
  $output = '';
  foreach ($tree as $data) {
    $extra_class = isset($data['link']['localized_options']['extra class']) ? $data['link']['localized_options']['extra class'] : NULL;
    $link = admin_menu_item_link($data['link']);
    if ($data['below']) {
      $output .= theme_admin_menu_item($link, $data['link']['has_children'], admin_menu_tree_output($data['below']), $data['link']['in_active_trail'], $extra_class);
    }
    else {
      $output .= theme_admin_menu_item($link, $data['link']['has_children'], '', $data['link']['in_active_trail'], $extra_class);
    }
  }
  return $output ? "\n<ul>" . $output . '</ul>' : '';
}