You are here

function _nodehierarchy_get_node_menu_links in Node Hierarchy 6.3

Same name and namespace in other branches
  1. 6.2 nodehierarchy.module \_nodehierarchy_get_node_menu_links()
  2. 7.2 nodehierarchy.module \_nodehierarchy_get_node_menu_links()

Get all the menu links for the given node.

7 calls to _nodehierarchy_get_node_menu_links()
nodehierarchy_get_node_parent in ./nodehierarchy.module
Get the primary parent node for the given node.
nodehierarchy_get_node_parents in ./nodehierarchy.module
Get the parent nodes for the given node.
nodehierarchy_get_node_parent_nids in ./nodehierarchy.module
Get the parent nodes for the given node.
nodehierarchy_load_node in ./nodehierarchy.module
Load a node's menu links when the node is loaded.
nodehierarchy_update_6200 in ./nodehierarchy.install
Update from the 5.x or 6.x-1.x branches.

... See full list

File

./nodehierarchy.module, line 1321
A module to make nodes hierarchical.

Code

function _nodehierarchy_get_node_menu_links($nid, $limit = NULL) {
  $limit_clause = $limit ? ' LIMIT ' . $limit : '';
  $result = db_query("SELECT parent.nid as pnid, ml.* FROM {menu_links} ml LEFT JOIN {nodehierarchy_menu_links} parent on parent.mlid = ml.plid WHERE module = 'nodehierarchy' AND link_path = 'node/%d' ORDER BY mlid" . $limit_clause, $nid);
  $out = array();
  while ($item = db_fetch_array($result)) {
    $out[] = _nodehierarchy_prepare_menu_link($item);
  }
  return $out;
}