Remove node_invoke_all().

From: Damien Tournoud <damien@tournoud.net>


---
 blogapi/blogapi.module         |    4 ++--
 book/book.module               |    8 ++++----
 node/node.module               |   18 +++++++++---------
 node/node.pages.inc            |    4 ++--
 search/search.api.php          |    6 +++---
 statistics/statistics.module   |    2 +-
 translation/translation.module |    2 +-
 trigger/trigger.module         |    4 ++--
 upload/upload.module           |    2 +-
 9 files changed, 25 insertions(+), 25 deletions(-)

diff --git modules/blogapi/blogapi.module modules/blogapi/blogapi.module
index c2b0d45..503f988 100644
--- modules/blogapi/blogapi.module
+++ modules/blogapi/blogapi.module
@@ -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');
   }
 
-  node_invoke_node($edit, 'blogapi_new');
+  module_invoke_all('node_blogapi_new', $edit);
 
   $valid = blogapi_status_error_check($edit, $publish);
   if ($valid !== TRUE) {
@@ -282,7 +282,7 @@ function blogapi_blogger_edit_post($appkey, $postid, $username, $password, $cont
     $node->body = $content;
   }
 
-  node_invoke_node($node, 'blogapi_edit');
+  module_invoke_all('node_blogapi_edit', $node);
 
   $valid = blogapi_status_error_check($node, $original_status);
   if ($valid !== TRUE) {
diff --git modules/book/book.module modules/book/book.module
index cc17ad7..8a70619 100644
--- modules/book/book.module
+++ modules/book/book.module
@@ -63,7 +63,7 @@ function book_perm() {
 /**
  * Inject links into $node as needed.
  */
-function book_node_view_link($node, $teaser, $page) {
+function book_node_view_link($node, $teaser) {
   $links = array();
 
   if (isset($node->book['depth'])) {
@@ -736,7 +736,7 @@ function book_node_load($nodes, $types) {
 /**
  * Implementation of hook_node_view().
  */
-function book_node_view($node, $teaser, $page) {
+function book_node_view($node, $teaser) {
   if (!$teaser) {
     if (!empty($node->book['bid']) && $node->build_mode == NODE_BUILD_NORMAL) {
       $node->content['book_navigation'] = array(
@@ -744,14 +744,14 @@ function book_node_view($node, $teaser, $page) {
         '#weight' => 100,
       );
 
-      if ($page) {
+      if ((bool)menu_get_object()) {
         menu_set_active_trail(book_build_active_trail($node->book));
         menu_set_active_menu_name($node->book['menu_name']);
       }
     }
   }
 
-  book_node_view_link($node, $teaser, $page);
+  book_node_view_link($node, $teaser);
 }
 
 /**
diff --git modules/node/node.module modules/node/node.module
index 4b3fc20..cbaba5a 100644
--- modules/node/node.module
+++ modules/node/node.module
@@ -1015,7 +1015,7 @@ function node_validate($node, $form = array()) {
 
   // Do node-type-specific validation checks.
   node_invoke($node, 'validate', $form);
-  node_invoke_node($node, 'validate', $form);
+  module_invoke_all('node_validate', $node, $form);
 }
 
 /**
@@ -1067,7 +1067,7 @@ function node_submit($node) {
 function node_save(&$node) {
   field_attach_presave('node', $node);
   // Let modules modify the node before it is saved to the database.
-  node_invoke_node($node, 'presave');
+  module_invoke_all('node_presave', $node);
   global $user;
 
   $node->is_new = FALSE;
@@ -1196,7 +1196,7 @@ function node_delete($nid) {
 
     // Call the node-specific callback (if any):
     node_invoke($node, 'delete');
-    node_invoke_node($node, 'delete');
+    module_invoke_all('node_delete', $node);
 
     // Clear the page and block caches.
     cache_clear_all();
@@ -1297,7 +1297,7 @@ function node_build_content($node, $teaser = FALSE) {
   $node->content += field_attach_view('node', $node, $teaser);
 
   // Allow modules to make their own additions to the node.
-  node_invoke_node($node, 'view', $teaser);
+  module_invoke_all('node_view', $node, $teaser);
 
   // Allow modules to modify the structured node.
   drupal_alter('node_build', $node, $teaser);
@@ -1529,7 +1529,7 @@ function node_search($op = 'search', $keys = NULL) {
         // Fetch terms for snippet.
         $node->body .= module_invoke('taxonomy', 'node', $node, 'update_index');
 
-        $extra = node_invoke_node($node, 'search_result');
+        $extra = module_invoke_all('node_search_result', $node);
 
         $results[] = array(
           'link' => url('node/' . $item->sid, array('absolute' => TRUE)),
@@ -1988,7 +1988,7 @@ function node_feed($nids = FALSE, $channel = array()) {
       }
 
       // Allow modules to change $node->content before the node is rendered.
-      node_invoke_node($item, 'view', $teaser, FALSE);
+      module_invoke_all('node_view', $item, $teaser);
 
       // Set the proper node property, then unset unused $node property so that a
       // bad theme can not open a security hole.
@@ -2003,11 +2003,11 @@ function node_feed($nids = FALSE, $channel = array()) {
       }
     
       // Allow modules to modify the fully-built node.
-      node_invoke_node($item, 'alter', $teaser, FALSE);
+      module_invoke_all('node_alter', $item, $teaser, FALSE);
     }
 
     // Allow modules to add additional item fields and/or modify $item
-    $extra = node_invoke_node($item, 'rss_item');
+    $extra = module_invoke_all('node_rss_item', $item);
     $extra = array_merge($extra, array(array('key' => 'pubDate', 'value' => gmdate('r', $item->created)), array('key' => 'dc:creator', 'value' => $item->name), array('key' => 'guid', 'value' => $item->nid . ' at ' . $base_url, 'attributes' => array('isPermaLink' => 'false'))));
     foreach ($extra as $element) {
       if (isset($element['namespace'])) {
@@ -2163,7 +2163,7 @@ function _node_index_node($node) {
   $text = '<h1>' . check_plain($node->title) . '</h1>' . $node->body;
 
   // Fetch extra data normally not visible
-  $extra = node_invoke_node($node, 'update_index');
+  $extra = module_invoke_all('node_update_index', $node);
   foreach ($extra as $t) {
     $text .= $t;
   }
diff --git modules/node/node.pages.inc modules/node/node.pages.inc
index 6dfc14e..4449556 100644
--- modules/node/node.pages.inc
+++ modules/node/node.pages.inc
@@ -98,7 +98,7 @@ function node_object_prepare(&$node) {
   $node->revision = in_array('revision', $node_options);
 
   node_invoke($node, 'prepare');
-  node_invoke_node($node, 'prepare');
+  module_invoke_all('node_prepare', $node);
 }
 
 /**
@@ -606,7 +606,7 @@ function node_revision_delete_confirm_submit($form, &$form_state) {
     ->condition('nid', $node_revision->nid)
     ->condition('vid', $node_revision->vid)
     ->execute();
-  node_invoke_node($node_revision, 'delete_revision');
+  module_invoke_all('node_delete_revision', $node_revision);
   watchdog('content', '@type: deleted %title revision %revision.', array('@type' => $node_revision->type, '%title' => $node_revision->title, '%revision' => $node_revision->vid));
   drupal_set_message(t('Revision from %revision-date of @type %title has been deleted.', array('%revision-date' => format_date($node_revision->revision_timestamp), '@type' => node_get_types('name', $node_revision), '%title' => $node_revision->title)));
   $form_state['redirect'] = 'node/' . $node_revision->nid;
diff --git modules/search/search.api.php modules/search/search.api.php
index 85f9dc4..fb58d57 100644
--- modules/search/search.api.php
+++ modules/search/search.api.php
@@ -177,7 +177,7 @@ function hook_search($op = 'search', $keys = null) {
         // Fetch terms for snippet.
         $node->body .= module_invoke('taxonomy', 'node', $node, 'update_index');
 
-        $extra = node_invoke_node($node, 'search_result');
+        $extra = module_invoke_all('node_search_result', $node);
 
         $results[] = array(
           'link' => url('node/' . $item->sid, array('absolute' => TRUE)),
@@ -265,12 +265,12 @@ function hook_update_index() {
       $node = node_prepare($node, false);
     }
     // Allow modules to change $node->body before viewing.
-    node_invoke_node($node, 'view', false, false);
+    module_invoke_all('node_view', $node, false, false);
 
     $text = '<h1>' . drupal_specialchars($node->title) . '</h1>' . $node->body;
 
     // Fetch extra data normally not visible
-    $extra = node_invoke_node($node, 'update_index');
+    $extra = module_invoke_all('node_update_index', $node);
     foreach ($extra as $t) {
       $text .= $t;
     }
diff --git modules/statistics/statistics.module modules/statistics/statistics.module
index 3e998d5..fe27d8a 100644
--- modules/statistics/statistics.module
+++ modules/statistics/statistics.module
@@ -103,7 +103,7 @@ function statistics_perm() {
 /**
  * Implementation of hook_node_view().
  */
-function statistics_node_view($node, $teaser, $page) {
+function statistics_node_view($node, $teaser) {
   global $id;
   $links = array();
 
diff --git modules/translation/translation.module modules/translation/translation.module
index 15bb0a6..7b32c55 100644
--- modules/translation/translation.module
+++ modules/translation/translation.module
@@ -215,7 +215,7 @@ function translation_node_prepare($node) {
       $node->title = $node->translation_source->title;
       $node->body = $node->translation_source->body;
       // Let every module add custom translated fields.
-      node_invoke_node($node, 'prepare_translation');
+      module_invoke_all('node_prepare_translation', $node);
     }
   }
 }
diff --git modules/trigger/trigger.module modules/trigger/trigger.module
index 695c2f6..e3d7a4a 100644
--- modules/trigger/trigger.module
+++ modules/trigger/trigger.module
@@ -244,8 +244,8 @@ function _trigger_node($node, $op, $a3 = NULL, $a4 = NULL) {
 /**
  * Implementation of hook_node_view().
  */
-function trigger_node_view($node, $teaser, $page) {
-  _trigger_node($node, 'view', $teaser, $page);
+function trigger_node_view($node, $teaser) {
+  _trigger_node($node, 'view', $teaser);
 }
 
 /**
diff --git modules/upload/upload.module modules/upload/upload.module
index 0123f17..cfe298d 100644
--- modules/upload/upload.module
+++ modules/upload/upload.module
@@ -340,7 +340,7 @@ function upload_node_load($nodes, $types) {
 /**
  * Implementation of hook_node_view().
  */
-function upload_node_view($node, $teaser, $page) {
+function upload_node_view($node, $teaser) {
   if (isset($node->files) && user_access('view uploaded files')) {
     // Add the attachments list to node body with a heavy
     // weight to ensure they're below other elements.
