Commit c0cb68ab authored by Dries's avatar Dries

- Patch #319356 by recidive: clean up hook_nodeapi_ fucntion signatures and...

- Patch #319356 by recidive: clean up hook_nodeapi_ fucntion signatures and documentation because of previous node API clean-ups.
parent 7c30a1ba
...@@ -72,7 +72,7 @@ function blog_help($path, $arg) { ...@@ -72,7 +72,7 @@ function blog_help($path, $arg) {
/** /**
* Implementation of hook_form(). * Implementation of hook_form().
*/ */
function blog_form(&$node) { function blog_form($node, $form_state) {
global $nid; global $nid;
$type = node_get_types('type', $node); $type = node_get_types('type', $node);
...@@ -84,7 +84,7 @@ function blog_form(&$node) { ...@@ -84,7 +84,7 @@ function blog_form(&$node) {
/** /**
* Implementation of hook_view(). * Implementation of hook_view().
*/ */
function blog_view($node, $teaser = FALSE, $page = FALSE) { function blog_view($node, $teaser, $page) {
if ($page) { if ($page) {
// Breadcrumb navigation. // Breadcrumb navigation.
drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Blogs'), 'blog'), l(t("!name's blog", array('!name' => $node->name)), 'blog/' . $node->uid))); drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Blogs'), 'blog'), l(t("!name's blog", array('!name' => $node->name)), 'blog/' . $node->uid)));
......
...@@ -718,7 +718,7 @@ function book_nodeapi_load($nodes, $types) { ...@@ -718,7 +718,7 @@ function book_nodeapi_load($nodes, $types) {
/** /**
* Implementation of hook_nodeapi_view(). * Implementation of hook_nodeapi_view().
*/ */
function book_nodeapi_view(&$node, $teaser, $page) { function book_nodeapi_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(
...@@ -737,7 +737,7 @@ function book_nodeapi_view(&$node, $teaser, $page) { ...@@ -737,7 +737,7 @@ function book_nodeapi_view(&$node, $teaser, $page) {
/** /**
* Implementation of hook_nodeapi_presave(). * Implementation of hook_nodeapi_presave().
*/ */
function book_nodeapi_presave(&$node, $teaser, $page) { function book_nodeapi_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;
...@@ -751,7 +751,7 @@ function book_nodeapi_presave(&$node, $teaser, $page) { ...@@ -751,7 +751,7 @@ function book_nodeapi_presave(&$node, $teaser, $page) {
/** /**
* Implementation of hook_nodeapi_insert(). * Implementation of hook_nodeapi_insert().
*/ */
function book_nodeapi_insert(&$node, $teaser, $page) { function book_nodeapi_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.
...@@ -766,7 +766,7 @@ function book_nodeapi_insert(&$node, $teaser, $page) { ...@@ -766,7 +766,7 @@ function book_nodeapi_insert(&$node, $teaser, $page) {
/** /**
* Implementation of hook_nodeapi_update(). * Implementation of hook_nodeapi_update().
*/ */
function book_nodeapi_update(&$node, $teaser, $page) { function book_nodeapi_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.
...@@ -781,7 +781,7 @@ function book_nodeapi_update(&$node, $teaser, $page) { ...@@ -781,7 +781,7 @@ function book_nodeapi_update(&$node, $teaser, $page) {
/** /**
* Implementation of hook_nodeapi_delete(). * Implementation of hook_nodeapi_delete().
*/ */
function book_nodeapi_delete(&$node, $teaser, $page) { function book_nodeapi_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.
...@@ -804,7 +804,7 @@ function book_nodeapi_delete(&$node, $teaser, $page) { ...@@ -804,7 +804,7 @@ function book_nodeapi_delete(&$node, $teaser, $page) {
/** /**
* Implementation of hook_nodeapi_prepare(). * Implementation of hook_nodeapi_prepare().
*/ */
function book_nodeapi_prepare(&$node, $teaser, $page) { function book_nodeapi_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();
......
...@@ -610,7 +610,7 @@ function comment_nodeapi_load($nodes, $types) { ...@@ -610,7 +610,7 @@ function comment_nodeapi_load($nodes, $types) {
/** /**
* Implementation of hook_nodeapi_prepare(). * Implementation of hook_nodeapi_prepare().
*/ */
function comment_nodeapi_prepare(&$node, $arg = 0) { function comment_nodeapi_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);
} }
...@@ -619,7 +619,7 @@ function comment_nodeapi_prepare(&$node, $arg = 0) { ...@@ -619,7 +619,7 @@ function comment_nodeapi_prepare(&$node, $arg = 0) {
/** /**
* Implementation of hook_nodeapi_insert(). * Implementation of hook_nodeapi_insert().
*/ */
function comment_nodeapi_insert(&$node, $arg = 0) { function comment_nodeapi_insert($node) {
db_insert('node_comment_statistics') db_insert('node_comment_statistics')
->fields(array( ->fields(array(
'nid' => $node->nid, 'nid' => $node->nid,
...@@ -633,7 +633,7 @@ function comment_nodeapi_insert(&$node, $arg = 0) { ...@@ -633,7 +633,7 @@ function comment_nodeapi_insert(&$node, $arg = 0) {
/** /**
* Implementation of hook_nodeapi_delete(). * Implementation of hook_nodeapi_delete().
*/ */
function comment_nodeapi_delete(&$node, $arg = 0) { function comment_nodeapi_delete($node) {
db_delete('comment') db_delete('comment')
->condition('nid', $node->nid) ->condition('nid', $node->nid)
->execute(); ->execute();
...@@ -645,7 +645,7 @@ function comment_nodeapi_delete(&$node, $arg = 0) { ...@@ -645,7 +645,7 @@ function comment_nodeapi_delete(&$node, $arg = 0) {
/** /**
* Implementation of hook_nodeapi_update_index(). * Implementation of hook_nodeapi_update_index().
*/ */
function comment_nodeapi_update_index(&$node, $arg = 0) { function comment_nodeapi_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) {
...@@ -657,7 +657,7 @@ function comment_nodeapi_update_index(&$node, $arg = 0) { ...@@ -657,7 +657,7 @@ function comment_nodeapi_update_index(&$node, $arg = 0) {
/** /**
* Implementation of hook_nodeapi_search_result(). * Implementation of hook_nodeapi_search_result().
*/ */
function comment_nodeapi_search_result(&$node, $arg = 0) { function comment_nodeapi_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');
} }
...@@ -665,7 +665,7 @@ function comment_nodeapi_search_result(&$node, $arg = 0) { ...@@ -665,7 +665,7 @@ function comment_nodeapi_search_result(&$node, $arg = 0) {
/** /**
* Implementation of hook_nodeapi_rss_item(). * Implementation of hook_nodeapi_rss_item().
*/ */
function comment_nodeapi_rss_item(&$node, $arg = 0) { function comment_nodeapi_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))));
} }
......
...@@ -183,7 +183,7 @@ function _forum_nodeapi_check_node_type($node, $vocabulary) { ...@@ -183,7 +183,7 @@ function _forum_nodeapi_check_node_type($node, $vocabulary) {
/** /**
* Implementation of hook_nodeapi_view(). * Implementation of hook_nodeapi_view().
*/ */
function forum_nodeapi_view(&$node, $teaser, $page) { function forum_nodeapi_view($node, $teaser, $page) {
$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_nodeapi_check_node_type($node, $vocabulary)) {
...@@ -221,7 +221,7 @@ function forum_nodeapi_view(&$node, $teaser, $page) { ...@@ -221,7 +221,7 @@ function forum_nodeapi_view(&$node, $teaser, $page) {
/** /**
* Implementation of hook_nodeapi_prepare(). * Implementation of hook_nodeapi_prepare().
*/ */
function forum_nodeapi_prepare(&$node, $teaser, $page) { function forum_nodeapi_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_nodeapi_check_node_type($node, $vocabulary)) {
...@@ -238,7 +238,7 @@ function forum_nodeapi_prepare(&$node, $teaser, $page) { ...@@ -238,7 +238,7 @@ function forum_nodeapi_prepare(&$node, $teaser, $page) {
* *
* 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, $teaser, $page) { function forum_nodeapi_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_nodeapi_check_node_type($node, $vocabulary)) {
...@@ -264,7 +264,7 @@ function forum_nodeapi_validate(&$node, $teaser, $page) { ...@@ -264,7 +264,7 @@ function forum_nodeapi_validate(&$node, $teaser, $page) {
* *
* 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, $teaser, $page) { function forum_nodeapi_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_nodeapi_check_node_type($node, $vocabulary)) {
...@@ -293,7 +293,7 @@ function forum_nodeapi_presave(&$node, $teaser, $page) { ...@@ -293,7 +293,7 @@ function forum_nodeapi_presave(&$node, $teaser, $page) {
/** /**
* Implementation of hook_nodeapi_update(). * Implementation of hook_nodeapi_update().
*/ */
function forum_nodeapi_update(&$node, $teaser, $page) { function forum_nodeapi_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_nodeapi_check_node_type($node, $vocabulary)) {
...@@ -317,7 +317,7 @@ function forum_nodeapi_update(&$node, $teaser, $page) { ...@@ -317,7 +317,7 @@ function forum_nodeapi_update(&$node, $teaser, $page) {
/** /**
* Implementation of hook_nodeapi_insert(). * Implementation of hook_nodeapi_insert().
*/ */
function forum_nodeapi_insert(&$node, $teaser, $page) { function forum_nodeapi_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_nodeapi_check_node_type($node, $vocabulary)) {
...@@ -330,7 +330,7 @@ function forum_nodeapi_insert(&$node, $teaser, $page) { ...@@ -330,7 +330,7 @@ function forum_nodeapi_insert(&$node, $teaser, $page) {
/** /**
* Implementation of hook_nodeapi_delete(). * Implementation of hook_nodeapi_delete().
*/ */
function forum_nodeapi_delete(&$node, $teaser, $page) { function forum_nodeapi_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_nodeapi_check_node_type($node, $vocabulary)) {
......
This diff is collapsed.
...@@ -120,7 +120,7 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL, $language = '' ...@@ -120,7 +120,7 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL, $language = ''
/** /**
* Implementation of hook_nodeapi_validate(). * Implementation of hook_nodeapi_validate().
*/ */
function path_nodeapi_validate(&$node, $arg) { function path_nodeapi_validate($node, $form) {
if (user_access('create url aliases') || user_access('administer url aliases')) { if (user_access('create url aliases') || user_access('administer url aliases')) {
if (isset($node->path)) { if (isset($node->path)) {
$language = isset($node->language) ? $node->language : ''; $language = isset($node->language) ? $node->language : '';
...@@ -149,7 +149,7 @@ function path_nodeapi_load($nodes, $types) { ...@@ -149,7 +149,7 @@ function path_nodeapi_load($nodes, $types) {
/** /**
* Implementation of hook_nodeapi_insert(). * Implementation of hook_nodeapi_insert().
*/ */
function path_nodeapi_insert(&$node, $arg) { function path_nodeapi_insert($node) {
if (user_access('create url aliases') || user_access('administer url aliases')) { if (user_access('create url aliases') || user_access('administer url aliases')) {
$language = isset($node->language) ? $node->language : ''; $language = isset($node->language) ? $node->language : '';
// Don't try to insert if path is NULL. We may have already set // Don't try to insert if path is NULL. We may have already set
...@@ -163,7 +163,7 @@ function path_nodeapi_insert(&$node, $arg) { ...@@ -163,7 +163,7 @@ function path_nodeapi_insert(&$node, $arg) {
/** /**
* Implementation of hook_nodeapi_update(). * Implementation of hook_nodeapi_update().
*/ */
function path_nodeapi_update(&$node, $arg) { function path_nodeapi_update($node) {
if (user_access('create url aliases') || user_access('administer url aliases')) { if (user_access('create url aliases') || user_access('administer url aliases')) {
$language = isset($node->language) ? $node->language : ''; $language = isset($node->language) ? $node->language : '';
path_set_alias('node/' . $node->nid, isset($node->path) ? $node->path : NULL, isset($node->pid) ? $node->pid : NULL, $language); path_set_alias('node/' . $node->nid, isset($node->path) ? $node->path : NULL, isset($node->pid) ? $node->pid : NULL, $language);
...@@ -173,7 +173,7 @@ function path_nodeapi_update(&$node, $arg) { ...@@ -173,7 +173,7 @@ function path_nodeapi_update(&$node, $arg) {
/** /**
* Implementation of hook_nodeapi_delete(). * Implementation of hook_nodeapi_delete().
*/ */
function path_nodeapi_delete(&$node, $arg) { function path_nodeapi_delete($node) {
if (user_access('create url aliases') || user_access('administer url aliases')) { if (user_access('create url aliases') || user_access('administer url aliases')) {
$language = isset($node->language) ? $node->language : ''; $language = isset($node->language) ? $node->language : '';
$path = 'node/' . $node->nid; $path = 'node/' . $node->nid;
......
...@@ -425,7 +425,7 @@ function poll_node_form_submit(&$form, &$form_state) { ...@@ -425,7 +425,7 @@ function poll_node_form_submit(&$form, &$form_state) {
/** /**
* Implementation of hook_validate(). * Implementation of hook_validate().
*/ */
function poll_validate($node) { function poll_validate($node, $form) {
if (isset($node->title)) { if (isset($node->title)) {
// Check for at least two options and validate amount of votes: // Check for at least two options and validate amount of votes:
$realchoices = 0; $realchoices = 0;
......
...@@ -638,7 +638,7 @@ function search_touch_node($nid) { ...@@ -638,7 +638,7 @@ function search_touch_node($nid) {
/** /**
* Implementation of hook_nodeapi_update_index(). * Implementation of hook_nodeapi_update_index().
*/ */
function search_nodeapi_update_index(&$node, $teaser = NULL, $page = NULL) { function search_nodeapi_update_index($node) {
// Transplant links to a node into the target node. // Transplant links to a node into the target node.
$result = db_query("SELECT caption FROM {search_node_links} WHERE nid = %d", $node->nid); $result = db_query("SELECT caption FROM {search_node_links} WHERE nid = %d", $node->nid);
$output = array(); $output = array();
...@@ -651,7 +651,7 @@ function search_nodeapi_update_index(&$node, $teaser = NULL, $page = NULL) { ...@@ -651,7 +651,7 @@ function search_nodeapi_update_index(&$node, $teaser = NULL, $page = NULL) {
/** /**
* Implementation of hook_nodeapi_update(). * Implementation of hook_nodeapi_update().
*/ */
function search_nodeapi_update(&$node, $teaser = NULL, $page = NULL) { function search_nodeapi_update($node) {
// Reindex the node when it is updated. The node is automatically indexed // Reindex the node when it is updated. The node is automatically indexed
// when it is added, simply by being added to the node table. // when it is added, simply by being added to the node table.
search_touch_node($node->nid); search_touch_node($node->nid);
......
...@@ -325,7 +325,7 @@ function _statistics_format_item($title, $path) { ...@@ -325,7 +325,7 @@ function _statistics_format_item($title, $path) {
/** /**
* Implementation of hook_nodeapi_delete(). * Implementation of hook_nodeapi_delete().
*/ */
function statistics_nodeapi_delete(&$node, $arg = 0) { function statistics_nodeapi_delete($node) {
// clean up statistics table when node is deleted // clean up statistics table when node is deleted
db_query('DELETE FROM {node_counter} WHERE nid = %d', $node->nid); db_query('DELETE FROM {node_counter} WHERE nid = %d', $node->nid);
} }
......
...@@ -1367,7 +1367,7 @@ function taxonomy_nodeapi_load($nodes) { ...@@ -1367,7 +1367,7 @@ function taxonomy_nodeapi_load($nodes) {
/** /**
* Implementation of hook_nodeapi_insert(). * Implementation of hook_nodeapi_insert().
*/ */
function taxonomy_nodeapi_insert($node, $arg = 0) { function taxonomy_nodeapi_insert($node) {
if (!empty($node->taxonomy)) { if (!empty($node->taxonomy)) {
taxonomy_node_save($node, $node->taxonomy); taxonomy_node_save($node, $node->taxonomy);
} }
...@@ -1376,7 +1376,7 @@ function taxonomy_nodeapi_insert($node, $arg = 0) { ...@@ -1376,7 +1376,7 @@ function taxonomy_nodeapi_insert($node, $arg = 0) {
/** /**
* Implementation of hook_nodeapi_update(). * Implementation of hook_nodeapi_update().
*/ */
function taxonomy_nodeapi_update($node, $arg = 0) { function taxonomy_nodeapi_update($node) {
if (!empty($node->taxonomy)) { if (!empty($node->taxonomy)) {
taxonomy_node_save($node, $node->taxonomy); taxonomy_node_save($node, $node->taxonomy);
} }
...@@ -1385,42 +1385,42 @@ function taxonomy_nodeapi_update($node, $arg = 0) { ...@@ -1385,42 +1385,42 @@ function taxonomy_nodeapi_update($node, $arg = 0) {
/** /**
* Implementation of hook_nodeapi_delete(). * Implementation of hook_nodeapi_delete().
*/ */
function taxonomy_nodeapi_delete($node, $arg = 0) { function taxonomy_nodeapi_delete($node) {
taxonomy_node_delete($node); taxonomy_node_delete($node);
} }
/** /**
* Implementation of hook_nodeapi_delete_revision(). * Implementation of hook_nodeapi_delete_revision().
*/ */
function taxonomy_nodeapi_delete_revision($node, $arg = 0) { function taxonomy_nodeapi_delete_revision($node) {
taxonomy_node_delete_revision($node); taxonomy_node_delete_revision($node);
} }
/** /**
* Implementation of hook_nodeapi_validate(). * Implementation of hook_nodeapi_validate().
*/ */
function taxonomy_nodeapi_validate($node, $arg = 0) { function taxonomy_nodeapi_validate($node, $form) {
taxonomy_node_validate($node); taxonomy_node_validate($node);
} }
/** /**
* Implementation of hook_nodeapi_rss_item(). * Implementation of hook_nodeapi_rss_item().
*/ */
function taxonomy_nodeapi_rss_item($node, $arg = 0) { function taxonomy_nodeapi_rss_item($node) {
return taxonomy_rss_item($node); return taxonomy_rss_item($node);
} }
/** /**
* Implementation of hook_nodeapi_update_index(). * Implementation of hook_nodeapi_update_index().
*/ */
function taxonomy_nodeapi_update_index($node, $arg = 0) { function taxonomy_nodeapi_update_index($node) {
return taxonomy_node_update_index($node); return taxonomy_node_update_index($node);
} }
/** /**
* Implementation of hook_nodeapi('update_index'). * Implementation of hook_nodeapi('update_index').
*/ */
function taxonomy_node_update_index(&$node) { function taxonomy_node_update_index($node) {
$output = array(); $output = array();
foreach ($node->taxonomy as $term) { foreach ($node->taxonomy as $term) {
$output[] = $term->name; $output[] = $term->name;
......
...@@ -186,7 +186,7 @@ function translation_link($type, $node = NULL, $teaser = FALSE) { ...@@ -186,7 +186,7 @@ function translation_link($type, $node = NULL, $teaser = FALSE) {
/** /**
* Implementation of hook_nodeapi_prepare(). * Implementation of hook_nodeapi_prepare().
*/ */
function translation_nodeapi_prepare(&$node, $teaser, $page) { function translation_nodeapi_prepare($node) {
// Only act if we are dealing with a content type supporting translations. // Only act if we are dealing with a content type supporting translations.
if (translation_supported_type($node->type)) { if (translation_supported_type($node->type)) {
if (empty($node->nid) && isset($_GET['translation']) && isset($_GET['language']) && if (empty($node->nid) && isset($_GET['translation']) && isset($_GET['language']) &&
...@@ -207,7 +207,7 @@ function translation_nodeapi_prepare(&$node, $teaser, $page) { ...@@ -207,7 +207,7 @@ function translation_nodeapi_prepare(&$node, $teaser, $page) {
/** /**
* Implementation of hook_nodeapi_insert(). * Implementation of hook_nodeapi_insert().
*/ */
function translation_nodeapi_insert(&$node, $teaser, $page) { function translation_nodeapi_insert($node) {
// Only act if we are dealing with a content type supporting translations. // Only act if we are dealing with a content type supporting translations.
if (translation_supported_type($node->type)) { if (translation_supported_type($node->type)) {
if (!empty($node->translation_source)) { if (!empty($node->translation_source)) {
...@@ -228,7 +228,7 @@ function translation_nodeapi_insert(&$node, $teaser, $page) { ...@@ -228,7 +228,7 @@ function translation_nodeapi_insert(&$node, $teaser, $page) {
/** /**
* Implementation of hook_nodeapi_update(). * Implementation of hook_nodeapi_update().
*/ */
function translation_nodeapi_update(&$node, $teaser, $page) { function translation_nodeapi_update($node) {
// Only act if we are dealing with a content type supporting translations. // Only act if we are dealing with a content type supporting translations.
if (translation_supported_type($node->type)) { if (translation_supported_type($node->type)) {
if (isset($node->translation) && $node->translation && !empty($node->language) && $node->tnid) { if (isset($node->translation) && $node->translation && !empty($node->language) && $node->tnid) {
...@@ -245,7 +245,7 @@ function translation_nodeapi_update(&$node, $teaser, $page) { ...@@ -245,7 +245,7 @@ function translation_nodeapi_update(&$node, $teaser, $page) {
/** /**
* Implementation of hook_nodeapi_delete(). * Implementation of hook_nodeapi_delete().
*/ */
function translation_nodeapi_delete(&$node, $teaser, $page) { function translation_nodeapi_delete($node) {
// Only act if we are dealing with a content type supporting translations. // Only act if we are dealing with a content type supporting translations.
if (translation_supported_type($node->type)) { if (translation_supported_type($node->type)) {
translation_remove_from_set($node); translation_remove_from_set($node);
......
...@@ -204,7 +204,7 @@ function _trigger_normalize_node_context($type, $node) { ...@@ -204,7 +204,7 @@ function _trigger_normalize_node_context($type, $node) {
* *
* @TODO: Take advantage of the new API and reorganise/remove this function. * @TODO: Take advantage of the new API and reorganise/remove this function.
*/ */
function _trigger_nodeapi(&$node, $op, $a3, $a4) { function _trigger_nodeapi($node, $op, $a3 = NULL, $a4 = NULL) {
// Keep objects for reuse so that changes actions make to objects can persist. // Keep objects for reuse so that changes actions make to objects can persist.
static $objects; static $objects;
// Prevent recursion by tracking which operations have already been called. // Prevent recursion by tracking which operations have already been called.
...@@ -245,36 +245,36 @@ function _trigger_nodeapi(&$node, $op, $a3, $a4) { ...@@ -245,36 +245,36 @@ function _trigger_nodeapi(&$node, $op, $a3, $a4) {
/** /**
* Implementation of hook_nodeapi_view(). * Implementation of hook_nodeapi_view().
*/ */
function trigger_nodeapi_view(&$node, $a3, $a4) { function trigger_nodeapi_view($node, $teaser, $page) {
_trigger_nodeapi($node, 'view', $a3, $a4); _trigger_nodeapi($node, 'view', $teaser, $page);
} }
/** /**
* Implementation of hook_nodeapi_update(). * Implementation of hook_nodeapi_update().
*/ */
function trigger_nodeapi_update(&$node, $a3, $a4) { function trigger_nodeapi_update($node) {
_trigger_nodeapi($node, 'update', $a3, $a4); _trigger_nodeapi($node, 'update');
} }
/** /**
* Implementation of hook_nodeapi_presave(). * Implementation of hook_nodeapi_presave().
*/ */
function trigger_nodeapi_presave(&$node, $a3, $a4) { function trigger_nodeapi_presave($node) {
_trigger_nodeapi($node, 'presave', $a3, $a4); _trigger_nodeapi($node, 'presave');
} }
/** /**
* Implementation of hook_nodeapi_insert(). * Implementation of hook_nodeapi_insert().
*/ */
function trigger_nodeapi_insert(&$node, $a3, $a4) { function trigger_nodeapi_insert($node) {
_trigger_nodeapi($node, 'insert', $a3, $a4); _trigger_nodeapi($node, 'insert');
} }
/** /**
* Implementation of hook_nodeapi_delete(). * Implementation of hook_nodeapi_delete().
*/ */
function trigger_nodeapi_delete(&$node, $a3, $a4) { function trigger_nodeapi_delete($node) {
_trigger_nodeapi($node, 'delete', $a3, $a4); _trigger_nodeapi($node, 'delete');
}