You are here

function _menu_node_invoke in Menu Node API 7

Same name and namespace in other branches
  1. 6 menu_node.module \_menu_node_invoke()

Wrapper function for module hooks.

Parameters

$node: The node being saved.

$link: The menu link being saved.

$hook: The hook to invoke ('insert', 'update', or 'delete').

4 calls to _menu_node_invoke()
menu_node_node_update in ./menu_node.module
Implements hook_node_update().
menu_node_record_delete_by_link in ./menu_node.module
Delete a record from {menu_node} by mlid and run hook_menu_node_record_delete().
menu_node_record_delete_by_node in ./menu_node.module
Delete a record from {menu_node} by nid and run hook_menu_node_record_delete().
menu_node_record_save in ./menu_node.module
Save records to the {menu_node} table.

File

./menu_node.module, line 326
Menu Node API Manages relationships between the {node} and {menu_links} table.

Code

function _menu_node_invoke($node, $link, $hook) {

  // It is possible that this function will try to fire for both the node and menu
  // hooks. So we static cache the nid and only fire once per link per node
  // operation. Note that mlid is the primary key of our table.
  static $ids;
  if (isset($ids[$hook][$node->nid][$link->mlid])) {
    return;
  }
  $ids[$hook][$node->nid][$link->mlid] = TRUE;
  module_invoke_all('menu_node_invoke_' . $hook, $link, $node);
}