parent) { $result = db_query("SELECT * FROM menu WHERE name = '%s' ORDER BY weight, name", $item->parent); if ($item = db_fetch_object($result)) { $path[] = $item; } } } $trail = array_reverse($path); } return $trail; } function menu_in_trail($item) { $trail = menu_trail(); foreach ($trail as $menu) { if ($menu->link == $item->link) { return 1; } } return 0; } function menu_item($item) { /* ** If you want to theme your links, or if you want to replace them ** by an image, this would be the function to customize. */ if (stristr(request_uri(), $item->link) == $item->link) { return t($item->name); } else if ($item->title) { return "link\" title=\"". t($item->title) ."\">". t($item->name) .""; } else { return "link\">". t($item->name) .""; } } function menu_path() { $path = menu_trail(); $links = array(); foreach ($path as $item) { $links[] = menu_item($item); } return implode(" > ", $links); } function menu_menu_row($parent = "") { $links = array(); $result = db_query("SELECT * FROM menu WHERE parent = '%s' ORDER BY weight, name", $parent); while ($menu = db_fetch_object($result)) { $links[] = menu_item($menu); } return $links; } function menu_menu() { $path = menu_trail(); if ($path) { $item = array_pop($path); $output = implode(" · ", menu_menu_row($item->name)); } return $output; } function menu_help() { $path = menu_trail(); if ($path) { $item = array_pop($path); $output = $item->help; } return $output; } function menu_tree($parent = "", $all = 1) { if ($all) { $result = db_query("SELECT * FROM menu WHERE parent = '%s' ORDER BY weight, name", $parent); } if (db_num_rows($result)) { $output = "