All pastes #535308 Raw Edit

Untitled

public php v1 · immutable
·published 2007-06-04 01:50 UTC
rendered paste body
function menu_menu_link_alter(&$item, $menu) {  $result = db_query("SELECT * FROM {menu_links} WHERE link_path = router_path AND link_path = '%s' AND customized = 1", $item['router_path']);  $candidate = db_num_rows($result);  $present = FALSE;  while ($link = db_fetch_objects($result)) {    if ($link['menu_name'] == $item['menu_name']) {      $item = $link;      $present = TRUE;    }  }  if ($candidate && !$present) {    $item = FALSE;  }}