Mapa webu

function theme_menu_tree2($pid = 1) {
if ($tree = menu_tree2($pid)) {
return "

    ". $tree ."

";
}
}

function menu_tree2($pid = 1) {
$menu = menu_get_menu();
$output = '';

if (isset($menu['visible'][$pid]) && $menu['visible'][$pid]['children']) {
foreach ($menu['visible'][$pid]['children'] as $mid) {
$type = isset($menu['visible'][$mid]['type']) ? $menu['visible'][$mid]['type'] : NULL;
$children = isset($menu['visible'][$mid]['children']) ? $menu['visible'][$mid]['children'] : NULL;
$output .= theme('menu_item', $mid, menu_in_active_trail($mid) || (true || $type & MENU_EXPANDED) ? theme('menu_tree2', $mid) : '', count($children) == 0);
}
}
return $output;
}

function mapawebu() {
// cache_clear_all();
$root = menu_get_root_menus();
$output = '';
foreach ($root as $pid => $nadpis) {
$output .= '

'.check_plain($nadpis).'

';
$output .= menu_tree2($pid);
}
return $output;

}

echo mapawebu();

?>