Commit ddc2604d authored by webchick's avatar webchick

#383066 by David Strauss: Rename hook_nodeapi_X to hook_node_X.

parent ad84a926
...@@ -119,7 +119,7 @@ function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a ...@@ -119,7 +119,7 @@ function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a
* 'description' => t('Save node'), * 'description' => t('Save node'),
* 'configurable' => FALSE, * 'configurable' => FALSE,
* 'hooks' => array( * 'hooks' => array(
* 'nodeapi' => array('delete', 'insert', 'update', 'view'), * 'node' => array('delete', 'insert', 'update', 'view'),
* 'comment' => array('delete', 'insert', 'update', 'view'), * 'comment' => array('delete', 'insert', 'update', 'view'),
* ) * )
* ) * )
...@@ -147,7 +147,7 @@ function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a ...@@ -147,7 +147,7 @@ function actions_do($action_ids, $object = NULL, $context = NULL, $a1 = NULL, $a
* 'description' => t('Publish post'), * 'description' => t('Publish post'),
* 'configurable' => FALSE, * 'configurable' => FALSE,
* 'hooks' => array( * 'hooks' => array(
* 'nodeapi' => array('presave', 'insert', 'update', 'view'), * 'node' => array('presave', 'insert', 'update', 'view'),
* 'comment' => array('delete', 'insert', 'update', 'view'), * 'comment' => array('delete', 'insert', 'update', 'view'),
* ), * ),
* ); * );
......
...@@ -94,9 +94,9 @@ function blog_view($node, $teaser) { ...@@ -94,9 +94,9 @@ function blog_view($node, $teaser) {
} }
/** /**
* Implementation of hook_nodeapi_view. * Implementation of hook_node_view.
*/ */
function blog_nodeapi_view($node, $teaser = FALSE) { function blog_node_view($node, $teaser = FALSE) {
if ($node->type == 'blog') { if ($node->type == 'blog') {
if (arg(0) != 'blog' || arg(1) != $node->uid) { if (arg(0) != 'blog' || arg(1) != $node->uid) {
$links['blog_usernames_blog'] = array( $links['blog_usernames_blog'] = array(
......
...@@ -224,7 +224,7 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte ...@@ -224,7 +224,7 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
$edit['date'] = format_date(REQUEST_TIME, 'custom', 'Y-m-d H:i:s O'); $edit['date'] = format_date(REQUEST_TIME, 'custom', 'Y-m-d H:i:s O');
} }
node_invoke_nodeapi($edit, 'blogapi_new'); node_invoke_node($edit, 'blogapi_new');
$valid = blogapi_status_error_check($edit, $publish); $valid = blogapi_status_error_check($edit, $publish);
if ($valid !== TRUE) { if ($valid !== TRUE) {
...@@ -282,7 +282,7 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont ...@@ -282,7 +282,7 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
$node->body = $content; $node->body = $content;
} }
node_invoke_nodeapi($node, 'blogapi_edit'); node_invoke_node($node, 'blogapi_edit');
$valid = blogapi_status_error_check($node, $original_status); $valid = blogapi_status_error_check($node, $original_status);
if ($valid !== TRUE) { if ($valid !== TRUE) {
......
...@@ -63,7 +63,7 @@ function book_perm() { ...@@ -63,7 +63,7 @@ function book_perm() {
/** /**
* Inject links into $node as needed. * Inject links into $node as needed.
*/ */
function book_nodeapi_view_link($node, $teaser, $page) { function book_node_view_link($node, $teaser, $page) {
$links = array(); $links = array();
if (isset($node->book['depth'])) { if (isset($node->book['depth'])) {
...@@ -720,9 +720,9 @@ function book_build_active_trail($book_link) { ...@@ -720,9 +720,9 @@ function book_build_active_trail($book_link) {
} }
/** /**
* Implementation of hook_nodeapi_load(). * Implementation of hook_node_load().
*/ */
function book_nodeapi_load($nodes, $types) { function book_node_load($nodes, $types) {
$result = db_query("SELECT * FROM {book} b INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE b.nid IN (:nids)", array(':nids' => array_keys($nodes)), array('fetch' => PDO::FETCH_ASSOC)); $result = db_query("SELECT * FROM {book} b INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE b.nid IN (:nids)", array(':nids' => array_keys($nodes)), array('fetch' => PDO::FETCH_ASSOC));
foreach ($result as $record) { foreach ($result as $record) {
$nodes[$record['nid']]->book = $record; $nodes[$record['nid']]->book = $record;
...@@ -733,9 +733,9 @@ function book_nodeapi_load($nodes, $types) { ...@@ -733,9 +733,9 @@ function book_nodeapi_load($nodes, $types) {
} }
/** /**
* Implementation of hook_nodeapi_view(). * Implementation of hook_node_view().
*/ */
function book_nodeapi_view($node, $teaser, $page) { function book_node_view($node, $teaser, $page) {
if (!$teaser) { if (!$teaser) {
if (!empty($node->book['bid']) && $node->build_mode == NODE_BUILD_NORMAL) { if (!empty($node->book['bid']) && $node->build_mode == NODE_BUILD_NORMAL) {
$node->content['book_navigation'] = array( $node->content['book_navigation'] = array(
...@@ -750,13 +750,13 @@ function book_nodeapi_view($node, $teaser, $page) { ...@@ -750,13 +750,13 @@ function book_nodeapi_view($node, $teaser, $page) {
} }
} }
book_nodeapi_view_link($node, $teaser, $page); book_node_view_link($node, $teaser, $page);
} }
/** /**
* Implementation of hook_nodeapi_presave(). * Implementation of hook_node_presave().
*/ */
function book_nodeapi_presave($node) { function book_node_presave($node) {
// Always save a revision for non-administrators. // Always save a revision for non-administrators.
if (!empty($node->book['bid']) && !user_access('administer nodes')) { if (!empty($node->book['bid']) && !user_access('administer nodes')) {
$node->revision = 1; $node->revision = 1;
...@@ -772,9 +772,9 @@ function book_nodeapi_presave($node) { ...@@ -772,9 +772,9 @@ function book_nodeapi_presave($node) {
} }
/** /**
* Implementation of hook_nodeapi_insert(). * Implementation of hook_node_insert().
*/ */
function book_nodeapi_insert($node) { function book_node_insert($node) {
if (!empty($node->book['bid'])) { if (!empty($node->book['bid'])) {
if ($node->book['bid'] == 'new') { if ($node->book['bid'] == 'new') {
// New nodes that are their own book. // New nodes that are their own book.
...@@ -787,9 +787,9 @@ function book_nodeapi_insert($node) { ...@@ -787,9 +787,9 @@ function book_nodeapi_insert($node) {
} }
/** /**
* Implementation of hook_nodeapi_update(). * Implementation of hook_node_update().
*/ */
function book_nodeapi_update($node) { function book_node_update($node) {
if (!empty($node->book['bid'])) { if (!empty($node->book['bid'])) {
if ($node->book['bid'] == 'new') { if ($node->book['bid'] == 'new') {
// New nodes that are their own book. // New nodes that are their own book.
...@@ -802,9 +802,9 @@ function book_nodeapi_update($node) { ...@@ -802,9 +802,9 @@ function book_nodeapi_update($node) {
} }
/** /**
* Implementation of hook_nodeapi_delete(). * Implementation of hook_node_delete().
*/ */
function book_nodeapi_delete($node) { function book_node_delete($node) {
if (!empty($node->book['bid'])) { if (!empty($node->book['bid'])) {
if ($node->nid == $node->book['bid']) { if ($node->nid == $node->book['bid']) {
// Handle deletion of a top-level post. // Handle deletion of a top-level post.
...@@ -825,9 +825,9 @@ function book_nodeapi_delete($node) { ...@@ -825,9 +825,9 @@ function book_nodeapi_delete($node) {
} }
/** /**
* Implementation of hook_nodeapi_prepare(). * Implementation of hook_node_prepare().
*/ */
function book_nodeapi_prepare($node) { function book_node_prepare($node) {
// Prepare defaults for the add/edit form. // Prepare defaults for the add/edit form.
if (empty($node->book) && (user_access('add content to books') || user_access('administer book outlines'))) { if (empty($node->book) && (user_access('add content to books') || user_access('administer book outlines'))) {
$node->book = array(); $node->book = array();
......
...@@ -414,9 +414,9 @@ function theme_comment_block() { ...@@ -414,9 +414,9 @@ function theme_comment_block() {
} }
/** /**
* An implementation of hook_nodeapi_view(). * An implementation of hook_node_view().
*/ */
function comment_nodeapi_view($node, $teaser) { function comment_node_view($node, $teaser) {
$links = array(); $links = array();
if ($node->comment) { if ($node->comment) {
...@@ -592,9 +592,9 @@ function comment_form_alter(&$form, $form_state, $form_id) { ...@@ -592,9 +592,9 @@ function comment_form_alter(&$form, $form_state, $form_id) {
} }
/** /**
* Implementation of hook_nodeapi_load(). * Implementation of hook_node_load().
*/ */
function comment_nodeapi_load($nodes, $types) { function comment_node_load($nodes, $types) {
$comments_enabled = array(); $comments_enabled = array();
// Check if comments are enabled for each node. If comments are disabled, // Check if comments are enabled for each node. If comments are disabled,
...@@ -623,18 +623,18 @@ function comment_nodeapi_load($nodes, $types) { ...@@ -623,18 +623,18 @@ function comment_nodeapi_load($nodes, $types) {
} }
/** /**
* Implementation of hook_nodeapi_prepare(). * Implementation of hook_node_prepare().
*/ */
function comment_nodeapi_prepare($node) { function comment_node_prepare($node) {
if (!isset($node->comment)) { if (!isset($node->comment)) {
$node->comment = variable_get("comment_$node->type", COMMENT_NODE_READ_WRITE); $node->comment = variable_get("comment_$node->type", COMMENT_NODE_READ_WRITE);
} }
} }
/** /**
* Implementation of hook_nodeapi_insert(). * Implementation of hook_node_insert().
*/ */
function comment_nodeapi_insert($node) { function comment_node_insert($node) {
db_insert('node_comment_statistics') db_insert('node_comment_statistics')
->fields(array( ->fields(array(
'nid' => $node->nid, 'nid' => $node->nid,
...@@ -646,9 +646,9 @@ function comment_nodeapi_insert($node) { ...@@ -646,9 +646,9 @@ function comment_nodeapi_insert($node) {
} }
/** /**
* Implementation of hook_nodeapi_delete(). * Implementation of hook_node_delete().
*/ */
function comment_nodeapi_delete($node) { function comment_node_delete($node) {
db_delete('comment') db_delete('comment')
->condition('nid', $node->nid) ->condition('nid', $node->nid)
->execute(); ->execute();
...@@ -658,9 +658,9 @@ function comment_nodeapi_delete($node) { ...@@ -658,9 +658,9 @@ function comment_nodeapi_delete($node) {
} }
/** /**
* Implementation of hook_nodeapi_update_index(). * Implementation of hook_node_update_index().
*/ */
function comment_nodeapi_update_index($node) { function comment_node_update_index($node) {
$text = ''; $text = '';
$comments = db_query('SELECT subject, comment, format FROM {comment} WHERE nid = :nid AND status = :status', array(':nid' => $node->nid, ':status' => COMMENT_PUBLISHED)); $comments = db_query('SELECT subject, comment, format FROM {comment} WHERE nid = :nid AND status = :status', array(':nid' => $node->nid, ':status' => COMMENT_PUBLISHED));
foreach ($comments as $comment) { foreach ($comments as $comment) {
...@@ -678,17 +678,17 @@ function comment_update_index() { ...@@ -678,17 +678,17 @@ function comment_update_index() {
} }
/** /**
* Implementation of hook_nodeapi_search_result(). * Implementation of hook_node_search_result().
*/ */
function comment_nodeapi_search_result($node) { function comment_node_search_result($node) {
$comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField(); $comments = db_query('SELECT comment_count FROM {node_comment_statistics} WHERE nid = :nid', array('nid' => $node->nid))->fetchField();
return format_plural($comments, '1 comment', '@count comments'); return format_plural($comments, '1 comment', '@count comments');
} }
/** /**
* Implementation of hook_nodeapi_rss_item(). * Implementation of hook_node_rss_item().
*/ */
function comment_nodeapi_rss_item($node) { function comment_node_rss_item($node) {
if ($node->comment != COMMENT_NODE_DISABLED) { if ($node->comment != COMMENT_NODE_DISABLED) {
return array(array('key' => 'comments', 'value' => url('node/' . $node->nid, array('fragment' => 'comments', 'absolute' => TRUE)))); return array(array('key' => 'comments', 'value' => url('node/' . $node->nid, array('fragment' => 'comments', 'absolute' => TRUE))));
} }
......
...@@ -512,7 +512,7 @@ function _field_attach_preprocess($obj_type, &$object) { ...@@ -512,7 +512,7 @@ function _field_attach_preprocess($obj_type, &$object) {
} }
/** /**
* Implementation of hook_nodeapi_prepare_translation. * Implementation of hook_node_prepare_translation.
* *
* TODO D7: We do not yet know if this really belongs in Field API. * TODO D7: We do not yet know if this really belongs in Field API.
*/ */
......
...@@ -251,7 +251,7 @@ function field_attach_preprocess($obj_type, &$object) { ...@@ -251,7 +251,7 @@ function field_attach_preprocess($obj_type, &$object) {
} }
/** /**
* Implementation of hook_nodeapi_prepare_translation. * Implementation of hook_node_prepare_translation.
* *
* TODO D7: We do not yet know if this really belongs in Field API. * TODO D7: We do not yet know if this really belongs in Field API.
* *
......
...@@ -69,7 +69,7 @@ function field_default_submit($obj_type, &$object, $field, $instance, &$items, $ ...@@ -69,7 +69,7 @@ function field_default_submit($obj_type, &$object, $field, $instance, &$items, $
* '#field_name' => 'field_name', * '#field_name' => 'field_name',
* '#object' => $object, * '#object' => $object,
* '#object_type' => $obj_type, * '#object_type' => $obj_type,
* // Value of the $teaser param of hook_nodeapi('view'). * // Value of the $teaser param of hook_node('view').
* '#teaser' => $teaser, * '#teaser' => $teaser,
* 'items' => * 'items' =>
* 0 => array( * 0 => array(
......
...@@ -461,7 +461,7 @@ function field_format($obj_type, $object, $field, $item, $formatter_name = NULL, ...@@ -461,7 +461,7 @@ function field_format($obj_type, $object, $field, $item, $formatter_name = NULL,
* The object containing the field to display. Must at least contain the id key, * The object containing the field to display. Must at least contain the id key,
* revision key (if applicable), bundle key, and the field data. * revision key (if applicable), bundle key, and the field data.
* @param $teaser * @param $teaser
* Similar to hook_nodeapi('view') * Similar to hook_node('view')
* @return * @return
* The themed output for the field. * The themed output for the field.
*/ */
......
...@@ -156,14 +156,14 @@ function forum_init() { ...@@ -156,14 +156,14 @@ function forum_init() {
} }
/** /**
* _forum_nodeapi_check_node_type * _forum_node_check_node_type
* *
* @param mixed $node * @param mixed $node
* @param mixed $vocabulary * @param mixed $vocabulary
* @access protected * @access protected
* @return bool * @return bool
*/ */
function _forum_nodeapi_check_node_type($node, $vocabulary) { function _forum_node_check_node_type($node, $vocabulary) {
// We are going to return if $node->type is not one of the node // We are going to return if $node->type is not one of the node
// types assigned to the forum vocabulary. If forum_nav_vocabulary // types assigned to the forum vocabulary. If forum_nav_vocabulary
// is undefined or the vocabulary does not exist, it clearly cannot // is undefined or the vocabulary does not exist, it clearly cannot
...@@ -181,12 +181,12 @@ function _forum_nodeapi_check_node_type($node, $vocabulary) { ...@@ -181,12 +181,12 @@ function _forum_nodeapi_check_node_type($node, $vocabulary) {
} }
/** /**
* Implementation of hook_nodeapi_view(). * Implementation of hook_node_view().
*/ */
function forum_nodeapi_view($node, $teaser) { function forum_node_view($node, $teaser) {
$vid = variable_get('forum_nav_vocabulary', ''); $vid = variable_get('forum_nav_vocabulary', '');
$vocabulary = taxonomy_vocabulary_load($vid); $vocabulary = taxonomy_vocabulary_load($vid);
if (_forum_nodeapi_check_node_type($node, $vocabulary)) { if (_forum_node_check_node_type($node, $vocabulary)) {
if ((bool)menu_get_object() && taxonomy_node_get_terms_by_vocabulary($node, $vid) && $tree = taxonomy_get_tree($vid)) { if ((bool)menu_get_object() && taxonomy_node_get_terms_by_vocabulary($node, $vid) && $tree = taxonomy_get_tree($vid)) {
// Get the forum terms from the (cached) tree // Get the forum terms from the (cached) tree
foreach ($tree as $term) { foreach ($tree as $term) {
...@@ -219,12 +219,12 @@ function forum_nodeapi_view($node, $teaser) { ...@@ -219,12 +219,12 @@ function forum_nodeapi_view($node, $teaser) {
} }
/** /**
* Implementation of hook_nodeapi_prepare(). * Implementation of hook_node_prepare().
*/ */
function forum_nodeapi_prepare($node) { function forum_node_prepare($node) {
$vid = variable_get('forum_nav_vocabulary', ''); $vid = variable_get('forum_nav_vocabulary', '');
$vocabulary = taxonomy_vocabulary_load($vid); $vocabulary = taxonomy_vocabulary_load($vid);
if (_forum_nodeapi_check_node_type($node, $vocabulary)) { if (_forum_node_check_node_type($node, $vocabulary)) {
if (empty($node->nid)) { if (empty($node->nid)) {
// New topic // New topic
$node->taxonomy[arg(3)] = (object) array( $node->taxonomy[arg(3)] = (object) array(
...@@ -236,14 +236,14 @@ function forum_nodeapi_prepare($node) { ...@@ -236,14 +236,14 @@ function forum_nodeapi_prepare($node) {
} }
/** /**
* Implementation of hook_nodeapi_validate(). * Implementation of hook_node_validate().
* *
* Check in particular that only a "leaf" term in the associated taxonomy. * Check in particular that only a "leaf" term in the associated taxonomy.
*/ */
function forum_nodeapi_validate($node, $form) { function forum_node_validate($node, $form) {
$vid = variable_get('forum_nav_vocabulary', ''); $vid = variable_get('forum_nav_vocabulary', '');
$vocabulary = taxonomy_vocabulary_load($vid); $vocabulary = taxonomy_vocabulary_load($vid);
if (_forum_nodeapi_check_node_type($node, $vocabulary)) { if (_forum_node_check_node_type($node, $vocabulary)) {
// vocabulary is selected, not a "container" term. // vocabulary is selected, not a "container" term.
if ($node->taxonomy) { if ($node->taxonomy) {
// Extract the node's proper topic ID. // Extract the node's proper topic ID.
...@@ -262,14 +262,14 @@ function forum_nodeapi_validate($node, $form) { ...@@ -262,14 +262,14 @@ function forum_nodeapi_validate($node, $form) {
} }
/** /**
* Implementation of hook_nodeapi_presave(). * Implementation of hook_node_presave().
* *
* Assign forum taxonomy when adding a topic from within a forum. * Assign forum taxonomy when adding a topic from within a forum.
*/ */
function forum_nodeapi_presave($node) { function forum_node_presave($node) {
$vid = variable_get('forum_nav_vocabulary', ''); $vid = variable_get('forum_nav_vocabulary', '');
$vocabulary = taxonomy_vocabulary_load($vid); $vocabulary = taxonomy_vocabulary_load($vid);
if (_forum_nodeapi_check_node_type($node, $vocabulary)) { if (_forum_node_check_node_type($node, $vocabulary)) {
// Make sure all fields are set properly: // Make sure all fields are set properly:
$node->icon = !empty($node->icon) ? $node->icon : ''; $node->icon = !empty($node->icon) ? $node->icon : '';
...@@ -293,12 +293,12 @@ function forum_nodeapi_presave($node) { ...@@ -293,12 +293,12 @@ function forum_nodeapi_presave($node) {
} }
/** /**
* Implementation of hook_nodeapi_update(). * Implementation of hook_node_update().
*/ */
function forum_nodeapi_update($node) { function forum_node_update($node) {
$vid = variable_get('forum_nav_vocabulary', ''); $vid = variable_get('forum_nav_vocabulary', '');
$vocabulary = taxonomy_vocabulary_load($vid); $vocabulary = taxonomy_vocabulary_load($vid);
if (_forum_nodeapi_check_node_type($node, $vocabulary)) { if (_forum_node_check_node_type($node, $vocabulary)) {
if (empty($node->revision) && db_result(db_query('SELECT tid FROM {forum} WHERE nid=%d', $node->nid))) { if (empty($node->revision) && db_result(db_query('SELECT tid FROM {forum} WHERE nid=%d', $node->nid))) {
if (!empty($node->tid)) { if (!empty($node->tid)) {
db_query('UPDATE {forum} SET tid = %d WHERE vid = %d', $node->tid, $node->vid); db_query('UPDATE {forum} SET tid = %d WHERE vid = %d', $node->tid, $node->vid);
...@@ -317,12 +317,12 @@ function forum_nodeapi_update($node) { ...@@ -317,12 +317,12 @@ function forum_nodeapi_update($node) {
} }
/** /**
* Implementation of hook_nodeapi_insert(). * Implementation of hook_node_insert().
*/ */
function forum_nodeapi_insert($node) { function forum_node_insert($node) {
$vid = variable_get('forum_nav_vocabulary', ''); $vid = variable_get('forum_nav_vocabulary', '');
$vocabulary = taxonomy_vocabulary_load($vid); $vocabulary = taxonomy_vocabulary_load($vid);
if (_forum_nodeapi_check_node_type($node, $vocabulary)) { if (_forum_node_check_node_type($node, $vocabulary)) {
if (!empty($node->tid)) { if (!empty($node->tid)) {
db_query('INSERT INTO {forum} (tid, vid, nid) VALUES (%d, %d, %d)', $node->tid, $node->vid, $node->nid); db_query('INSERT INTO {forum} (tid, vid, nid) VALUES (%d, %d, %d)', $node->tid, $node->vid, $node->nid);
} }
...@@ -330,20 +330,20 @@ function forum_nodeapi_insert($node) { ...@@ -330,20 +330,20 @@ function forum_nodeapi_insert($node) {
} }
/** /**
* Implementation of hook_nodeapi_delete(). * Implementation of hook_node_delete().
*/ */
function forum_nodeapi_delete($node) { function forum_node_delete($node) {
$vid = variable_get('forum_nav_vocabulary', ''); $vid = variable_get('forum_nav_vocabulary', '');
$vocabulary = taxonomy_vocabulary_load($vid); $vocabulary = taxonomy_vocabulary_load($vid);
if (_forum_nodeapi_check_node_type($node, $vocabulary)) { if (_forum_node_check_node_type($node, $vocabulary)) {
db_query('DELETE FROM {forum} WHERE nid = %d', $node->nid); db_query('DELETE FROM {forum} WHERE nid = %d', $node->nid);
} }
} }
/** /**
* Implementation of hook_nodeapi_load(). * Implementation of hook_node_load().
*/ */
function forum_nodeapi_load($nodes, $types) { function forum_node_load($nodes, $types) {
$vid = variable_get('forum_nav_vocabulary', ''); $vid = variable_get('forum_nav_vocabulary', '');
// If no forum vocabulary is set up, return. // If no forum vocabulary is set up, return.
if ($vid == '') { if ($vid == '') {
......
...@@ -289,9 +289,9 @@ function menu_block_view($delta = '') { ...@@ -289,9 +289,9 @@ function menu_block_view($delta = '') {
} }
/** /**
* Implementation of hook_nodeapi_insert(). * Implementation of hook_node_insert().
*/ */
function menu_nodeapi_insert(&$node) { function menu_node_insert(&$node) {
if (isset($node->menu)) { if (isset($node->menu)) {
$item = &$node->menu; $item = &$node->menu;
if (!empty($item['delete'])) { if (!empty($item['delete'])) {
...@@ -311,9 +311,9 @@ function menu_nodeapi_insert(&$node) { ...@@ -311,9 +311,9 @@ function menu_nodeapi_insert(&$node) {
} }
/** /**
* Implementation of hook_nodeapi_update(). * Implementation of hook_node_update().
*/ */
function menu_nodeapi_update(&$node) { function menu_node_update(&$node) {
if (isset($node->menu)) { if (isset($node->menu)) {
$item = &$node->menu; $item = &$node->menu;
if (!empty($item['delete'])) { if (!empty($item['delete'])) {
...@@ -333,9 +333,9 @@ function menu_nodeapi_update(&$node) { ...@@ -333,9 +333,9 @@ function menu_nodeapi_update(&$node) {
} }
/** /**
* Implementation of hook_nodeapi_delete(). * Implementation of hook_node_delete().
*/ */
function menu_nodeapi_delete(&$node) { function menu_node_delete(&$node) {
// Delete all menu module links that point to this node. // Delete all menu module links that point to this node.
$result = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu'", array(':path' => 'node/'. $node->nid)); $result = db_query("SELECT mlid FROM {menu_links} WHERE link_path = :path AND module = 'menu'", array(':path' => 'node/'. $node->nid));
while ($m = db_fetch_array($result)) { while ($m = db_fetch_array($result)) {
...@@ -344,9 +344,9 @@ function menu_nodeapi_delete(&$node) { ...@@ -344,9 +344,9 @@ function menu_nodeapi_delete(&$node) {
} }
/** /**
* Implementation of hook_nodeapi_prepare(). * Implementation of hook_node_prepare().
*/ */
function menu_nodeapi_prepare(&$node) { function menu_node_prepare(&$node) {
if (empty($node->menu)) { if (empty($node->menu)) {
// Prepare the node for the edit form so that $node->menu always exists. // Prepare the node for the edit form so that $node->menu always exists.
$menu_name = variable_get('menu_default_node_menu', 'main-menu'); $menu_name = variable_get('menu_default_node_menu', 'main-menu');
......
...@@ -169,7 +169,7 @@ function hook_node_operations() { ...@@ -169,7 +169,7 @@ function hook_node_operations() {
* @return * @return
* None. * None.
*/ */
function hook_nodeapi_alter($node, $teaser) { function hook_node_alter($node, $teaser) {
}