theme_admin_menu_tree

Versions
5
theme_admin_menu_tree($pid = 1)

Generate the HTML for a menu tree.

Parameters

int $pid The menu item id to use for the administration menu.

Return value

string The complete, rendered administration menu.

▾ 2 functions call theme_admin_menu_tree()

admin_menu_footer in contributions/admin_menu/admin_menu.module
Implementation of hook_footer().
theme_admin_menu_tree in contributions/admin_menu/admin_menu.module
Generate the HTML for a menu tree.

Code

contributions/admin_menu/admin_menu.module, line 197

<?php
function theme_admin_menu_tree($pid = 1) {
  $_admin_menu = admin_menu_get_menu();
  $output = '';
  
  if (isset($_admin_menu[$pid]) && $_admin_menu[$pid]['children']) {
    // Since we allow other modules to add items to admin menu, we need to sort
    // all items (again).
    usort($_admin_menu[$pid]['children'], '_admin_menu_sort');
    foreach ($_admin_menu[$pid]['children'] as $mid) {
      $children = isset($_admin_menu[$mid]['children']) ? $_admin_menu[$mid]['children'] : NULL;
      $output .= theme_admin_menu_item($mid, theme_admin_menu_tree($mid), count($children) == 0);
    }
  }
  return $output ? "\n<ul>". $output .'</ul>' : '';
}
?>

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.