menu_node_get_links

Versions
menu_node
menu_node_get_links($nid, $router = FALSE)

Get the relevant menu links for a node.

Parameters

$nid The node id.

$router Boolean flag indicating whether to attach the menu router item to the $item object. If set to TRUE, the router will be set as $item->menu_router.

Return value

An array of complete menu_link objects or an empy array on failure.

Code

./menu_node.module, line 69

<?php
function menu_node_get_links($nid, $router = FALSE) {
  $result = db_query("SELECT * FROM {menu_links} WHERE link_path = '%s'", 'node/'. $nid);
  $items = array();
  while ($data = db_fetch_object($result)) {
    if ($router) {
      $data->menu_router = menu_get_item('node/'. $nid);
    }
    $items[$data->mlid] = $data;
  }
  return $items;
}
?>

Contact

  • agentrickard [at] gmail [dot] com

Donations

My Amazon.com Wish List