function _nodehierarchy_get_node_menu_links in Node Hierarchy 6.2
Same name and namespace in other branches
- 6.3 nodehierarchy.module \_nodehierarchy_get_node_menu_links()
- 7.2 nodehierarchy.module \_nodehierarchy_get_node_menu_links()
Get all the menu links for the given node.
6 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_get_node_ancestor_menu_links in ./
nodehierarchy.module - Get the menu links of each of a node's ancestors.
File
- ./
nodehierarchy.module, line 1162 - 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;
}