You are here

function _nodehierarchy_get_parent_menu in Node Hierarchy 6

Same name and namespace in other branches
  1. 5 nodehierarchy.module \_nodehierarchy_get_parent_menu()

Find the menu ID for parent of the given node.

1 call to _nodehierarchy_get_parent_menu()
_nodehierarchy_set_menu_order in ./nodehierarchy.module
Reorder the child menus of the given parent.

File

./nodehierarchy.module, line 1069

Code

function _nodehierarchy_get_parent_menu($parent, $nid) {

  // If the item has a parent node, get the parent's menu item (if any).
  if ($parent) {
    return _nodehierarchy_get_menu($parent);
  }
  else {
    return db_fetch_array(db_query_range("SELECT plid FROM {menu_links} WHERE link_path = '%s'", "node/{$nid}", 0, 1));
  }
}