You are here

function theme_admin_menu_tree in Administration menu 5

Same name and namespace in other branches
  1. 5.3 admin_menu.module \theme_admin_menu_tree()
  2. 5.2 admin_menu.module \theme_admin_menu_tree()

Generate the HTML for a menu tree.

Parameters

$pid: The parent id of the menu.

1 theme call to theme_admin_menu_tree()
admin_menu_get_menu in ./admin_menu.inc
Retrieves, sclices and returns the menu tree below /admin.

File

./admin_menu.inc, line 260

Code

function theme_admin_menu_tree(&$menu, $pid = 1) {
  $output = '';
  if (isset($menu[$pid]) && $menu[$pid]['children']) {
    foreach ($menu[$pid]['children'] as $mid) {
      $type = isset($menu[$mid]['type']) ? $menu[$mid]['type'] : null;
      $children = isset($menu[$mid]['children']) ? $menu[$mid]['children'] : null;
      $output .= theme('admin_menu_item', $menu, $mid, theme('admin_menu_tree', $menu, $mid), count($children) == 0);
    }
  }
  return $output ? "<ul>" . $output . "</ul>" : '';
}