function menu_get_items_beginning_with

7.x menu.inc menu_get_items_beginning_with($menu_root)
6.x menu.inc menu_get_items_beginning_with($menu_root)
4.x menu.inc menu_get_items_beginning_with($menu_root)
5.x menu.inc menu_get_items_beginning_with($menu_root)

Return menu_items whose path begins with the menu_root. Ex: "tools" would return tools/fun and tools/here/there

1 call to menu_get_items_beginning_with()
fp_render_menu_block in includes/theme.inc
Render a "menu" block of menu items which are all rooted at the menu_root. So if the menu root is tools, it might return items whose paths look like: tools/fun tools/here/there So long as the menu type is "MENU_TYPE_NORMAL_ITEM". …

File

includes/menu.inc, line 165

Code

function menu_get_items_beginning_with($menu_root) {
  $rtn = array();

  $res = db_query("SELECT path FROM menu_router WHERE path LIKE ? 
                    ORDER BY weight, title", $menu_root . "%");
  while ($cur = db_fetch_array($res)) {
    $path = $cur ["path"];
    $item = menu_get_item($path);
    if ($item) {
      $rtn [] = $item;
    }
  }


  return $rtn;
}