You are here

function _site_map_menu_tree in Site map 5

1 call to _site_map_menu_tree()
_site_map_menus in ./site_map.module
Render menus

File

./site_map.module, line 413
Original author: Nic Ivy Now maintained by by Fredrik Jonsson fredrik at combonet dot se

Code

function _site_map_menu_tree($pid = 1, $menu = NULL) {

  // based on functions theme_menu_tree and menu_tree
  if (isset($menu['visible'][$pid]) && $menu['visible'][$pid]['children']) {
    foreach ($menu['visible'][$pid]['children'] as $mid) {
      $children = isset($menu['visible'][$mid]['children']) ? $menu['visible'][$mid]['children'] : NULL;
      $menu_tree .= theme('menu_item', $mid, _site_map_menu_tree($mid, $menu), count($children) == 0);
    }
  }
  if ($menu_tree) {
    $output = '<ul class="tree">' . $menu_tree . '</ul>';
  }
  return $output;
}