Index: modules/aggregator/aggregator.block.inc
===================================================================
RCS file: modules/aggregator/aggregator.block.inc
diff -N modules/aggregator/aggregator.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/aggregator/aggregator.block.inc	12 Nov 2009 22:37:12 -0000
@@ -0,0 +1,93 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Aggregator module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function aggregator_block_info() {
+  $block = array();
+  $result = db_query('SELECT cid, title FROM {aggregator_category} ORDER BY title');
+  foreach ($result as $category) {
+    $block['category-' . $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title));
+  }
+  $result = db_query('SELECT fid, title FROM {aggregator_feed} WHERE block <> 0 ORDER BY fid');
+  foreach ($result as $feed) {
+    $block['feed-' . $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title));
+  }
+  return $block;
+}
+
+/**
+ * Implement hook_block_configure().
+ */
+function aggregator_block_configure($delta = '') {
+  list($type, $id) = explode('-', $delta);
+  if ($type == 'category') {
+    $value = db_query('SELECT block FROM {aggregator_category} WHERE cid = :cid', array(':cid' => $id))->fetchField();
+    $form['block'] = array(
+      '#type' => 'select',
+      '#title' => t('Number of news items in block'),
+      '#default_value' => $value,
+      '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20))
+    );
+    return $form;
+  }
+}
+
+/**
+ * Implement hook_block_save().
+ */
+function aggregator_block_save($delta = '', $edit = array()) {
+  list($type, $id) = explode('-', $delta);
+  if ($type == 'category') {
+    db_update('aggregator_category')
+      ->fields(array('block' => $edit['block']))
+      ->condition('cid', $id)
+      ->execute();
+  }
+}
+
+/**
+ * Implement hook_block_view().
+ *
+ * Generates blocks for the latest news items in each category and feed.
+ */
+function aggregator_block_view($delta = '') {
+  if (user_access('access news feeds')) {
+    $block = array();
+    list($type, $id) = explode('-', $delta);
+    switch ($type) {
+      case 'feed':
+        if ($feed = db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE block <> 0 AND fid = :fid', array(':fid' => $id))->fetchObject()) {
+          $block['subject'] = check_plain($feed->title);
+          $result = db_query_range("SELECT * FROM {aggregator_item} WHERE fid = :fid ORDER BY timestamp DESC, iid DESC", 0, $feed->block, array(':fid' => $id));
+          $read_more = theme('more_link', array('url' => url('aggregator/sources/' . $feed->fid), 'title' => t("View this feed's recent news.")));
+        }
+        break;
+
+      case 'category':
+        if ($category = db_query('SELECT cid, title, block FROM {aggregator_category} WHERE cid = :cid', array(':cid' => $id))->fetchObject()) {
+          $block['subject'] = check_plain($category->title);
+          $result = db_query_range('SELECT i.* FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON ci.iid = i.iid WHERE ci.cid = :cid ORDER BY i.timestamp DESC, i.iid DESC', 0, $category->block, array(':cid' => $category->cid));
+          $read_more = theme('more_link', array('url' => url('aggregator/categories/' . $category->cid), 'title' => t("View this category's recent news.")));
+        }
+        break;
+    }
+    $items = array();
+    foreach ($result as $item) {
+      $items[] = theme('aggregator_block_item', array('item' => $item));
+    }
+
+    // Only display the block if there are items to show.
+    if (count($items) > 0) {
+      $block['content'] = theme('item_list', array('items' => $items)) . $read_more;
+    }
+    return $block;
+  }
+}
+
Index: modules/aggregator/aggregator.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.info,v
retrieving revision 1.12
diff -u -p -r1.12 aggregator.info
--- modules/aggregator/aggregator.info	8 Jun 2009 09:23:50 -0000	1.12
+++ modules/aggregator/aggregator.info	12 Nov 2009 22:37:12 -0000
@@ -12,3 +12,4 @@ files[] = aggregator.parser.inc
 files[] = aggregator.processor.inc
 files[] = aggregator.install
 files[] = aggregator.test
+files[] = aggregator.block.inc
Index: modules/aggregator/aggregator.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v
retrieving revision 1.428
diff -u -p -r1.428 aggregator.module
--- modules/aggregator/aggregator.module	1 Nov 2009 17:50:45 -0000	1.428
+++ modules/aggregator/aggregator.module	12 Nov 2009 22:37:12 -0000
@@ -12,6 +12,20 @@
 define('AGGREGATOR_CLEAR_NEVER', 0);
 
 /**
+ * Implements hook_hook_info().
+ */
+function aggregator_hook_info() {
+  $hooks['aggregator_fetch_info'] = array('group' => 'aggregator');
+  $hooks['aggregator_fetch'] = array('group' => 'aggregator');
+  $hooks['aggregator_parse_info'] = array('group' => 'aggregator');
+  $hooks['aggregator_parse'] = array('group' => 'aggregator');
+  $hooks['aggregator_process_info'] = array('group' => 'aggregator');
+  $hooks['aggregator_process'] = array('group' => 'aggregator');
+  $hooks['aggregator_remove'] = array('group' => 'aggregator');
+  return $hooks;
+}
+
+/**
  * Implement hook_help().
  */
 function aggregator_help($path, $arg) {
@@ -331,91 +345,6 @@ function aggregator_cron_queue_info() {
 }
 
 /**
- * Implement hook_block_info().
- */
-function aggregator_block_info() {
-  $block = array();
-  $result = db_query('SELECT cid, title FROM {aggregator_category} ORDER BY title');
-  foreach ($result as $category) {
-    $block['category-' . $category->cid]['info'] = t('!title category latest items', array('!title' => $category->title));
-  }
-  $result = db_query('SELECT fid, title FROM {aggregator_feed} WHERE block <> 0 ORDER BY fid');
-  foreach ($result as $feed) {
-    $block['feed-' . $feed->fid]['info'] = t('!title feed latest items', array('!title' => $feed->title));
-  }
-  return $block;
-}
-
-/**
- * Implement hook_block_configure().
- */
-function aggregator_block_configure($delta = '') {
-  list($type, $id) = explode('-', $delta);
-  if ($type == 'category') {
-    $value = db_query('SELECT block FROM {aggregator_category} WHERE cid = :cid', array(':cid' => $id))->fetchField();
-    $form['block'] = array(
-      '#type' => 'select',
-      '#title' => t('Number of news items in block'),
-      '#default_value' => $value,
-      '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20))
-    );
-    return $form;
-  }
-}
-
-/**
- * Implement hook_block_save().
- */
-function aggregator_block_save($delta = '', $edit = array()) {
-  list($type, $id) = explode('-', $delta);
-  if ($type == 'category') {
-    db_update('aggregator_category')
-      ->fields(array('block' => $edit['block']))
-      ->condition('cid', $id)
-      ->execute();
-  }
-}
-
-/**
- * Implement hook_block_view().
- *
- * Generates blocks for the latest news items in each category and feed.
- */
-function aggregator_block_view($delta = '') {
-  if (user_access('access news feeds')) {
-    $block = array();
-    list($type, $id) = explode('-', $delta);
-    switch ($type) {
-      case 'feed':
-        if ($feed = db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE block <> 0 AND fid = :fid', array(':fid' => $id))->fetchObject()) {
-          $block['subject'] = check_plain($feed->title);
-          $result = db_query_range("SELECT * FROM {aggregator_item} WHERE fid = :fid ORDER BY timestamp DESC, iid DESC", 0, $feed->block, array(':fid' => $id));
-          $read_more = theme('more_link', array('url' => url('aggregator/sources/' . $feed->fid), 'title' => t("View this feed's recent news.")));
-        }
-        break;
-
-      case 'category':
-        if ($category = db_query('SELECT cid, title, block FROM {aggregator_category} WHERE cid = :cid', array(':cid' => $id))->fetchObject()) {
-          $block['subject'] = check_plain($category->title);
-          $result = db_query_range('SELECT i.* FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON ci.iid = i.iid WHERE ci.cid = :cid ORDER BY i.timestamp DESC, i.iid DESC', 0, $category->block, array(':cid' => $category->cid));
-          $read_more = theme('more_link', array('url' => url('aggregator/categories/' . $category->cid), 'title' => t("View this category's recent news.")));
-        }
-        break;
-    }
-    $items = array();
-    foreach ($result as $item) {
-      $items[] = theme('aggregator_block_item', array('item' => $item));
-    }
-
-    // Only display the block if there are items to show.
-    if (count($items) > 0) {
-      $block['content'] = theme('item_list', array('items' => $items)) . $read_more;
-    }
-    return $block;
-  }
-}
-
-/**
  * Add/edit/delete aggregator categories.
  *
  * @param $edit
Index: modules/block/block.block.inc
===================================================================
RCS file: modules/block/block.block.inc
diff -N modules/block/block.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/block/block.block.inc	12 Nov 2009 22:37:10 -0000
@@ -0,0 +1,165 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Block module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function block_block_info() {
+  $blocks = array();
+
+  $result = db_query('SELECT bid, info FROM {block_custom} ORDER BY info');
+  foreach ($result as $block) {
+    $blocks[$block->bid]['info'] = $block->info;
+    // Not worth caching.
+    $blocks[$block->bid]['cache'] = DRUPAL_NO_CACHE;
+  }
+  return $blocks;
+}
+
+/**
+ * Implement hook_block_info_alter().
+ *
+ * Check the page, user role, content type and user specific visibilty settings.
+ * Remove the block if the visibility conditions are not met.
+ */
+function block_block_info_alter(&$blocks) {
+  global $user, $theme_key;
+
+  // Build an array of roles for each block.
+  $block_roles = array();
+  $result = db_query('SELECT module, delta, rid FROM {block_role}');
+  foreach ($result as $record) {
+    $block_roles[$record->module][$record->delta][] = $record->rid;
+  }
+
+  // Build an array of node types for each block.
+  $block_node_types = array();
+  $result = db_query('SELECT module, delta, type FROM {block_node_type}');
+  foreach ($result as $record) {
+    $block_node_types[$record->module][$record->delta][] = $record->type;
+  }
+
+  foreach ($blocks as $key => $block) {
+    if ($block->theme != $theme_key || $block->status != 1) {
+      // This block was added by a contrib module, leave it in the list.
+      continue;
+    }
+
+    // If a block has no roles associated, it is displayed for every role.
+    // For blocks with roles associated, if none of the user's roles matches
+    // the settings from this block, remove it from the block list.
+    if (isset($block_roles[$block->module][$block->delta]) && !array_intersect($block_roles[$block->module][$block->delta], array_keys($user->roles))) {
+      // No match.
+      unset($blocks[$key]);
+      continue;
+    }
+
+    // If a block has no node types associated, it is displayed for every type.
+    // For blocks with node types associated, if the node type does not match
+    // the settings from this block, remove it from the block list.
+    if (isset($block_node_types[$block->module][$block->delta])) {
+      $node = menu_get_object();
+      if (!empty($node)) {
+        // This is a node or node edit page.
+        if (!in_array($node->type, $block_node_types[$block->module][$block->delta])) {
+          // This block should not be displayed for this node type.
+          unset($blocks[$key]);
+          continue;
+        }
+      }
+      elseif (arg(0) == 'node' && arg(1) == 'add' && in_array(arg(2), array_keys(node_type_get_types()))) {
+        // This is a node creation page
+        if (!in_array(arg(2), $block_node_types[$block->module][$block->delta])) {
+          // This block should not be displayed for this node type.
+          unset($blocks[$key]);
+          continue;
+        }
+      }
+      else {
+        // This is not a node page, remove the block.
+        unset($blocks[$key]);
+        continue;
+      }
+    }
+
+    // Use the user's block visibility setting, if necessary.
+    if ($block->custom != 0) {
+      if ($user->uid && isset($user->block[$block->module][$block->delta])) {
+        $enabled = $user->block[$block->module][$block->delta];
+      }
+      else {
+        $enabled = ($block->custom == 1);
+      }
+    }
+    else {
+      $enabled = TRUE;
+    }
+    if (!$enabled) {
+      unset($blocks[$key]);
+      continue;
+    }
+
+    // Match path if necessary.
+    if ($block->pages) {
+      if ($block->visibility < 2) {
+        $path = drupal_get_path_alias($_GET['q']);
+        // Compare with the internal and path alias (if any).
+        $page_match = drupal_match_path($path, $block->pages);
+        if ($path != $_GET['q']) {
+          $page_match = $page_match || drupal_match_path($_GET['q'], $block->pages);
+        }
+        // When $block->visibility has a value of 0, the block is displayed on
+        // all pages except those listed in $block->pages. When set to 1, it
+        // is displayed only on those pages listed in $block->pages.
+        $page_match = !($block->visibility xor $page_match);
+      }
+      elseif (module_exists('php')) {
+        $page_match = php_eval($block->pages);
+      }
+      else {
+        $page_match = FALSE;
+      }
+    }
+    else {
+      $page_match = TRUE;
+    }
+    if (!$page_match) {
+      unset($blocks[$key]);
+    }
+  }
+}
+
+/**
+ * Implement hook_block_configure().
+ */
+function block_block_configure($delta = 0) {
+  $custom_block = array('format' => filter_default_format());
+  if ($delta) {
+    $custom_block = block_custom_block_get($delta);
+  }
+  return block_custom_block_form($custom_block);
+}
+
+/**
+ * Implement hook_block_save().
+ */
+function block_block_save($delta = 0, $edit = array()) {
+  block_custom_block_save($edit, $delta);
+}
+
+/**
+ * Implement hook_block_view().
+ *
+ * Generates the administrator-defined blocks for display.
+ */
+function block_block_view($delta = 0, $edit = array()) {
+  $block = db_query('SELECT body, format FROM {block_custom} WHERE bid = :bid', array(':bid' => $delta))->fetchObject();
+  $data['content'] = check_markup($block->body, $block->format, '', TRUE);
+  return $data;
+}
+
Index: modules/block/block.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.info,v
retrieving revision 1.14
diff -u -p -r1.14 block.info
--- modules/block/block.info	28 Aug 2009 19:44:05 -0000	1.14
+++ modules/block/block.info	12 Nov 2009 22:37:10 -0000
@@ -9,3 +9,4 @@ files[] = block.module
 files[] = block.admin.inc
 files[] = block.install
 files[] = block.test
+files[] = block.block.inc
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.398
diff -u -p -r1.398 block.module
--- modules/block/block.module	11 Nov 2009 08:52:27 -0000	1.398
+++ modules/block/block.module	12 Nov 2009 22:37:10 -0000
@@ -12,6 +12,19 @@
 define('BLOCK_REGION_NONE', -1);
 
 /**
+ * Implements hook_hook_info().
+ */
+function block_hook_info() {
+  $hooks['block_info'] = array('group' => 'block');
+  $hooks['block_info_alter'] = array('group' => 'block');
+  $hooks['block_configure'] = array('group' => 'block');
+  $hooks['block_save'] = array('group' => 'block');
+  $hooks['block_view'] = array('group' => 'block');
+  $hooks['block_view_alter'] = array('group' => 'block');
+  return $hooks;
+}
+
+/**
  * Implement hook_help().
  */
 function block_help($path, $arg) {
@@ -166,50 +179,6 @@ function _block_custom_theme($theme = NU
 }
 
 /**
- * Implement hook_block_info().
- */
-function block_block_info() {
-  $blocks = array();
-
-  $result = db_query('SELECT bid, info FROM {block_custom} ORDER BY info');
-  foreach ($result as $block) {
-    $blocks[$block->bid]['info'] = $block->info;
-    // Not worth caching.
-    $blocks[$block->bid]['cache'] = DRUPAL_NO_CACHE;
-  }
-  return $blocks;
-}
-
-/**
- * Implement hook_block_configure().
- */
-function block_block_configure($delta = 0) {
-  $custom_block = array('format' => filter_default_format());
-  if ($delta) {
-    $custom_block = block_custom_block_get($delta);
-  }
-  return block_custom_block_form($custom_block);
-}
-
-/**
- * Implement hook_block_save().
- */
-function block_block_save($delta = 0, $edit = array()) {
-  block_custom_block_save($edit, $delta);
-}
-
-/**
- * Implement hook_block_view().
- *
- * Generates the administrator-defined blocks for display.
- */
-function block_block_view($delta = 0, $edit = array()) {
-  $block = db_query('SELECT body, format FROM {block_custom} WHERE bid = :bid', array(':bid' => $delta))->fetchObject();
-  $data['content'] = check_markup($block->body, $block->format, '', TRUE);
-  return $data;
-}
-
-/**
  * Implement hook_page_build().
  *
  * Render blocks into their regions.
@@ -649,119 +618,6 @@ function _block_load_blocks() {
 }
 
 /**
- * Implement hook_block_info_alter().
- *
- * Check the page, user role, content type and user specific visibilty settings.
- * Remove the block if the visibility conditions are not met.
- */
-function block_block_info_alter(&$blocks) {
-  global $user, $theme_key;
-
-  // Build an array of roles for each block.
-  $block_roles = array();
-  $result = db_query('SELECT module, delta, rid FROM {block_role}');
-  foreach ($result as $record) {
-    $block_roles[$record->module][$record->delta][] = $record->rid;
-  }
-
-  // Build an array of node types for each block.
-  $block_node_types = array();
-  $result = db_query('SELECT module, delta, type FROM {block_node_type}');
-  foreach ($result as $record) {
-    $block_node_types[$record->module][$record->delta][] = $record->type;
-  }
-
-  foreach ($blocks as $key => $block) {
-    if ($block->theme != $theme_key || $block->status != 1) {
-      // This block was added by a contrib module, leave it in the list.
-      continue;
-    }
-
-    // If a block has no roles associated, it is displayed for every role.
-    // For blocks with roles associated, if none of the user's roles matches
-    // the settings from this block, remove it from the block list.
-    if (isset($block_roles[$block->module][$block->delta]) && !array_intersect($block_roles[$block->module][$block->delta], array_keys($user->roles))) {
-      // No match.
-      unset($blocks[$key]);
-      continue;
-    }
-
-    // If a block has no node types associated, it is displayed for every type.
-    // For blocks with node types associated, if the node type does not match
-    // the settings from this block, remove it from the block list.
-    if (isset($block_node_types[$block->module][$block->delta])) {
-      $node = menu_get_object();
-      if (!empty($node)) {
-        // This is a node or node edit page.
-        if (!in_array($node->type, $block_node_types[$block->module][$block->delta])) {
-          // This block should not be displayed for this node type.
-          unset($blocks[$key]);
-          continue;
-        }
-      }
-      elseif (arg(0) == 'node' && arg(1) == 'add' && in_array(arg(2), array_keys(node_type_get_types()))) {
-        // This is a node creation page
-        if (!in_array(arg(2), $block_node_types[$block->module][$block->delta])) {
-          // This block should not be displayed for this node type.
-          unset($blocks[$key]);
-          continue;
-        }
-      }
-      else {
-        // This is not a node page, remove the block.
-        unset($blocks[$key]);
-        continue;
-      }
-    }
-
-    // Use the user's block visibility setting, if necessary.
-    if ($block->custom != 0) {
-      if ($user->uid && isset($user->block[$block->module][$block->delta])) {
-        $enabled = $user->block[$block->module][$block->delta];
-      }
-      else {
-        $enabled = ($block->custom == 1);
-      }
-    }
-    else {
-      $enabled = TRUE;
-    }
-    if (!$enabled) {
-      unset($blocks[$key]);
-      continue;
-    }
-
-    // Match path if necessary.
-    if ($block->pages) {
-      if ($block->visibility < 2) {
-        $path = drupal_get_path_alias($_GET['q']);
-        // Compare with the internal and path alias (if any).
-        $page_match = drupal_match_path($path, $block->pages);
-        if ($path != $_GET['q']) {
-          $page_match = $page_match || drupal_match_path($_GET['q'], $block->pages);
-        }
-        // When $block->visibility has a value of 0, the block is displayed on
-        // all pages except those listed in $block->pages. When set to 1, it
-        // is displayed only on those pages listed in $block->pages.
-        $page_match = !($block->visibility xor $page_match);
-      }
-      elseif (module_exists('php')) {
-        $page_match = php_eval($block->pages);
-      }
-      else {
-        $page_match = FALSE;
-      }
-    }
-    else {
-      $page_match = TRUE;
-    }
-    if (!$page_match) {
-      unset($blocks[$key]);
-    }
-  }
-}
-
-/**
  * Render the content and subject for a set of blocks.
  *
  * @param $region_blocks
Index: modules/blog/blog.block.inc
===================================================================
RCS file: modules/blog/blog.block.inc
diff -N modules/blog/blog.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/blog/blog.block.inc	12 Nov 2009 22:37:09 -0000
@@ -0,0 +1,43 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Blog module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function blog_block_info() {
+  $block['recent']['info'] = t('Recent blog posts');
+  return $block;
+}
+
+/**
+ * Implement hook_block_view().
+ *
+ * Displays the most recent 10 blog titles.
+ */
+function blog_block_view($delta = '') {
+  global $user;
+
+  if (user_access('access content')) {
+    $result = db_select('node', 'n')
+      ->fields('n', array('nid', 'title', 'created'))
+      ->condition('type', 'blog')
+      ->condition('status', 1)
+      ->orderBy('created', 'DESC')
+      ->range(0, 10)
+      ->addTag('node_access')
+      ->execute();
+
+    if ($node_title_list = node_title_list($result)) {
+      $block['content'] = $node_title_list;
+      $block['content'] .= theme('more_link', array('url' => url('blog'), 'title' => t('Read the latest blog entries.')));
+      $block['subject'] = t('Recent blog posts');
+      return $block;
+    }
+  }
+}
+
Index: modules/blog/blog.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.info,v
retrieving revision 1.11
diff -u -p -r1.11 blog.info
--- modules/blog/blog.info	8 Jun 2009 09:23:51 -0000	1.11
+++ modules/blog/blog.info	12 Nov 2009 22:37:09 -0000
@@ -8,3 +8,4 @@ core = 7.x
 files[] = blog.module
 files[] = blog.pages.inc
 files[] = blog.test
+files[] = blog.block.inc
Index: modules/blog/blog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.module,v
retrieving revision 1.341
diff -u -p -r1.341 blog.module
--- modules/blog/blog.module	8 Nov 2009 10:02:41 -0000	1.341
+++ modules/blog/blog.module	12 Nov 2009 22:37:09 -0000
@@ -150,41 +150,6 @@ function _blog_post_exists($account) {
 }
 
 /**
- * Implement hook_block_info().
- */
-function blog_block_info() {
-  $block['recent']['info'] = t('Recent blog posts');
-  return $block;
-}
-
-/**
- * Implement hook_block_view().
- *
- * Displays the most recent 10 blog titles.
- */
-function blog_block_view($delta = '') {
-  global $user;
-
-  if (user_access('access content')) {
-    $result = db_select('node', 'n')
-      ->fields('n', array('nid', 'title', 'created'))
-      ->condition('type', 'blog')
-      ->condition('status', 1)
-      ->orderBy('created', 'DESC')
-      ->range(0, 10)
-      ->addTag('node_access')
-      ->execute();
-
-    if ($node_title_list = node_title_list($result)) {
-      $block['content'] = $node_title_list;
-      $block['content'] .= theme('more_link', array('url' => url('blog'), 'title' => t('Read the latest blog entries.')));
-      $block['subject'] = t('Recent blog posts');
-      return $block;
-    }
-  }
-}
-
-/**
  * Implements hook_rdf_mapping().
  */
 function blog_rdf_mapping() {
Index: modules/book/book.block.inc
===================================================================
RCS file: modules/book/book.block.inc
diff -N modules/book/book.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/book/book.block.inc	12 Nov 2009 22:37:07 -0000
@@ -0,0 +1,101 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Book module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function book_block_info() {
+  $block = array();
+  $block['navigation']['info'] = t('Book navigation');
+  $block['navigation']['cache'] = DRUPAL_CACHE_PER_PAGE | DRUPAL_CACHE_PER_ROLE;
+
+  return $block;
+}
+
+/**
+ * Implement hook_block_configure().
+ */
+function book_block_configure($delta = '') {
+  $block = array();
+  $options = array(
+    'all pages' => t('Show block on all pages'),
+    'book pages' => t('Show block only on book pages'),
+  );
+  $form['book_block_mode'] = array(
+    '#type' => 'radios',
+    '#title' => t('Book navigation block display'),
+    '#options' => $options,
+    '#default_value' => variable_get('book_block_mode', 'all pages'),
+    '#description' => t("If <em>Show block on all pages</em> is selected, the block will contain the automatically generated menus for all of the site's books. If <em>Show block only on book pages</em> is selected, the block will contain only the one menu corresponding to the current page's book. In this case, if the current page is not in a book, no block will be displayed. The <em>Page specific visibility settings</em> or other visibility settings can be used in addition to selectively display this block."),
+    );
+
+  return $form;
+}
+
+/**
+ * Implement hook_block_save().
+ */
+function book_block_save($delta = '', $edit = array()) {
+  $block = array();
+  variable_set('book_block_mode', $edit['book_block_mode']);
+}
+
+/**
+ * Implement hook_block_view().
+ *
+ * Displays the book table of contents in a block when the current page is a
+ * single-node view of a book node.
+ */
+function book_block_view($delta = '') {
+  $block = array();
+  $current_bid = 0;
+  if ($node = menu_get_object()) {
+    $current_bid = empty($node->book['bid']) ? 0 : $node->book['bid'];
+  }
+
+  if (variable_get('book_block_mode', 'all pages') == 'all pages') {
+    $block['subject'] = t('Book navigation');
+    $book_menus = array();
+    $pseudo_tree = array(0 => array('below' => FALSE));
+    foreach (book_get_books() as $book_id => $book) {
+      if ($book['bid'] == $current_bid) {
+        // If the current page is a node associated with a book, the menu
+        // needs to be retrieved.
+        $book_menus[$book_id] = menu_tree_output(menu_tree_all_data($node->book['menu_name'], $node->book));
+      }
+      else {
+        // Since we know we will only display a link to the top node, there
+        // is no reason to run an additional menu tree query for each book.
+        $book['in_active_trail'] = FALSE;
+        $pseudo_tree[0]['link'] = $book;
+        $book_menus[$book_id] = menu_tree_output($pseudo_tree);
+      }
+    }
+    $book_menus['#theme'] = 'book_all_books_block';
+    $block['content'] = $book_menus;
+  }
+  elseif ($current_bid) {
+    // Only display this block when the user is browsing a book.
+    $select = db_select('node');
+    $select->addField('node', 'title');
+    $select->condition('nid', $node->book['bid']);
+    $select->addTag('node_access');
+    $title = $select->execute()->fetchField();
+    // Only show the block if the user has view access for the top-level node.
+    if ($title) {
+      $tree = menu_tree_all_data($node->book['menu_name'], $node->book);
+      // There should only be one element at the top level.
+      $data = array_shift($tree);
+      $block['subject'] = theme('book_title_link', array('link' => $data['link']));
+      $block['content'] = ($data['below']) ? menu_tree_output($data['below']) : '';
+    }
+  }
+
+  return $block;
+}
+
Index: modules/book/book.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.info,v
retrieving revision 1.12
diff -u -p -r1.12 book.info
--- modules/book/book.info	8 Jun 2009 09:23:51 -0000	1.12
+++ modules/book/book.info	12 Nov 2009 22:37:07 -0000
@@ -10,3 +10,4 @@ files[] = book.admin.inc
 files[] = book.pages.inc
 files[] = book.install
 files[] = book.test
+files[] = book.block.inc
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.524
diff -u -p -r1.524 book.module
--- modules/book/book.module	8 Nov 2009 10:02:41 -0000	1.524
+++ modules/book/book.module	12 Nov 2009 22:37:07 -0000
@@ -209,99 +209,6 @@ function book_field_build_modes($obj_typ
 }
 
 /**
- * Implement hook_block_info().
- */
-function book_block_info() {
-  $block = array();
-  $block['navigation']['info'] = t('Book navigation');
-  $block['navigation']['cache'] = DRUPAL_CACHE_PER_PAGE | DRUPAL_CACHE_PER_ROLE;
-
-  return $block;
-}
-
-/**
- * Implement hook_block_view().
- *
- * Displays the book table of contents in a block when the current page is a
- * single-node view of a book node.
- */
-function book_block_view($delta = '') {
-  $block = array();
-  $current_bid = 0;
-  if ($node = menu_get_object()) {
-    $current_bid = empty($node->book['bid']) ? 0 : $node->book['bid'];
-  }
-
-  if (variable_get('book_block_mode', 'all pages') == 'all pages') {
-    $block['subject'] = t('Book navigation');
-    $book_menus = array();
-    $pseudo_tree = array(0 => array('below' => FALSE));
-    foreach (book_get_books() as $book_id => $book) {
-      if ($book['bid'] == $current_bid) {
-        // If the current page is a node associated with a book, the menu
-        // needs to be retrieved.
-        $book_menus[$book_id] = menu_tree_output(menu_tree_all_data($node->book['menu_name'], $node->book));
-      }
-      else {
-        // Since we know we will only display a link to the top node, there
-        // is no reason to run an additional menu tree query for each book.
-        $book['in_active_trail'] = FALSE;
-        $pseudo_tree[0]['link'] = $book;
-        $book_menus[$book_id] = menu_tree_output($pseudo_tree);
-      }
-    }
-    $book_menus['#theme'] = 'book_all_books_block';
-    $block['content'] = $book_menus;
-  }
-  elseif ($current_bid) {
-    // Only display this block when the user is browsing a book.
-    $select = db_select('node');
-    $select->addField('node', 'title');
-    $select->condition('nid', $node->book['bid']);
-    $select->addTag('node_access');
-    $title = $select->execute()->fetchField();
-    // Only show the block if the user has view access for the top-level node.
-    if ($title) {
-      $tree = menu_tree_all_data($node->book['menu_name'], $node->book);
-      // There should only be one element at the top level.
-      $data = array_shift($tree);
-      $block['subject'] = theme('book_title_link', array('link' => $data['link']));
-      $block['content'] = ($data['below']) ? menu_tree_output($data['below']) : '';
-    }
-  }
-
-  return $block;
-}
-
-/**
- * Implement hook_block_configure().
- */
-function book_block_configure($delta = '') {
-  $block = array();
-  $options = array(
-    'all pages' => t('Show block on all pages'),
-    'book pages' => t('Show block only on book pages'),
-  );
-  $form['book_block_mode'] = array(
-    '#type' => 'radios',
-    '#title' => t('Book navigation block display'),
-    '#options' => $options,
-    '#default_value' => variable_get('book_block_mode', 'all pages'),
-    '#description' => t("If <em>Show block on all pages</em> is selected, the block will contain the automatically generated menus for all of the site's books. If <em>Show block only on book pages</em> is selected, the block will contain only the one menu corresponding to the current page's book. In this case, if the current page is not in a book, no block will be displayed. The <em>Page specific visibility settings</em> or other visibility settings can be used in addition to selectively display this block."),
-    );
-
-  return $form;
-}
-
-/**
- * Implement hook_block_save().
- */
-function book_block_save($delta = '', $edit = array()) {
-  $block = array();
-  variable_set('book_block_mode', $edit['book_block_mode']);
-}
-
-/**
  * Generate the HTML output for a link to a book title when used as a block title.
  *
  * @ingroup themeable
Index: modules/comment/comment.block.inc
===================================================================
RCS file: modules/comment/comment.block.inc
diff -N modules/comment/comment.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/comment/comment.block.inc	12 Nov 2009 22:36:59 -0000
@@ -0,0 +1,52 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Comment module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function comment_block_info() {
+  $blocks['recent']['info'] = t('Recent comments');
+
+  return $blocks;
+}
+
+/**
+ * Implement hook_block_configure().
+ */
+function comment_block_configure($delta = '') {
+  $form['comment_block_count'] = array(
+    '#type' => 'select',
+    '#title' => t('Number of recent comments'),
+    '#default_value' => variable_get('comment_block_count', 10),
+    '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30)),
+  );
+
+  return $form;
+}
+
+/**
+ * Implement hook_block_save().
+ */
+function comment_block_save($delta = '', $edit = array()) {
+  variable_set('comment_block_count', (int)$edit['comment_block_count']);
+}
+
+/**
+ * Implement hook_block_view().
+ *
+ * Generates a block with the most recent comments.
+ */
+function comment_block_view($delta = '') {
+  if (user_access('access comments')) {
+    $block['subject'] = t('Recent comments');
+    $block['content'] = theme('comment_block');
+
+    return $block;
+  }
+}
+
Index: modules/comment/comment.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.info,v
retrieving revision 1.11
diff -u -p -r1.11 comment.info
--- modules/comment/comment.info	19 Aug 2009 20:19:36 -0000	1.11
+++ modules/comment/comment.info	12 Nov 2009 22:37:03 -0000
@@ -11,3 +11,5 @@ files[] = comment.pages.inc
 files[] = comment.install
 files[] = comment.test
 files[] = comment.tokens.inc
+files[] = comment.block.inc
+files[] = comment.search.inc
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.804
diff -u -p -r1.804 comment.module
--- modules/comment/comment.module	12 Nov 2009 06:46:44 -0000	1.804
+++ modules/comment/comment.module	12 Nov 2009 22:37:03 -0000
@@ -71,6 +71,23 @@ define('COMMENT_NODE_CLOSED', 1);
 define('COMMENT_NODE_OPEN', 2);
 
 /**
+ * Implements hook_hook_info().
+ */
+function comment_hook_info() {
+  $hooks['comment_presave'] = array('group' => 'comment');
+  $hooks['comment_insert'] = array('group' => 'comment');
+  $hooks['comment_load'] = array('group' => 'comment');
+  $hooks['comment_update'] = array('group' => 'comment');
+  $hooks['comment_delete'] = array('group' => 'comment');
+  $hooks['comment_view'] = array('group' => 'comment');
+  $hooks['comment_build_alter'] = array('group' => 'comment');
+  $hooks['comment_publish'] = array('group' => 'comment');
+  $hooks['comment_unpublish'] = array('group' => 'comment');
+  $hooks['comment_validate'] = array('group' => 'comment');
+  return $hooks;
+}
+
+/**
  * Implement hook_help().
  */
 function comment_help($path, $arg) {
@@ -291,50 +308,6 @@ function comment_permission() {
 }
 
 /**
- * Implement hook_block_info().
- */
-function comment_block_info() {
-  $blocks['recent']['info'] = t('Recent comments');
-
-  return $blocks;
-}
-
-/**
- * Implement hook_block_configure().
- */
-function comment_block_configure($delta = '') {
-  $form['comment_block_count'] = array(
-    '#type' => 'select',
-    '#title' => t('Number of recent comments'),
-    '#default_value' => variable_get('comment_block_count', 10),
-    '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30)),
-  );
-
-  return $form;
-}
-
-/**
- * Implement hook_block_save().
- */
-function comment_block_save($delta = '', $edit = array()) {
-  variable_set('comment_block_count', (int)$edit['comment_block_count']);
-}
-
-/**
- * Implement hook_block_view().
- *
- * Generates a block with the most recent comments.
- */
-function comment_block_view($delta = '') {
-  if (user_access('access comments')) {
-    $block['subject'] = t('Recent comments');
-    $block['content'] = theme('comment_block');
-
-    return $block;
-  }
-}
-
-/**
  * Redirects comment links to the correct page depending on comment settings.
  *
  * Since comments are paged there is no way to guarantee which page a comment
@@ -1143,31 +1116,6 @@ function comment_node_delete($node) {
 }
 
 /**
- * Implement hook_node_update_index().
- */
-function comment_node_update_index($node) {
-  $text = '';
-  if ($node->comment != COMMENT_NODE_HIDDEN) {
-    $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) {
-      $text .= '<h2>' . check_plain($comment->subject) . '</h2>' . check_markup($comment->comment, $comment->format, '', TRUE);
-    }
-  }
-  return $text;
-}
-
-/**
- * Implement hook_update_index().
- */
-function comment_update_index() {
-  // Store the maximum possible comments per thread (used for ranking by reply count)
-  variable_set('node_cron_comments_scale', 1.0 / max(1, db_query('SELECT MAX(comment_count) FROM {node_comment_statistics}')->fetchField()));
-}
-
-/**
  * Implement hook_node_search_result().
  */
 function comment_node_search_result($node) {
@@ -2461,26 +2409,6 @@ function comment_save_action($comment) {
 }
 
 /**
- * Implement hook_ranking().
- */
-function comment_ranking() {
-  return array(
-    'comments' => array(
-      'title' => t('Number of comments'),
-      'join' => array(
-        'type' => 'LEFT',
-        'table' => 'node_comment_statistics',
-        'alias' => 'node_comment_statistics',
-        'on' => 'node_comment_statistics.nid = i.sid',
-      ),
-      // Inverse law that maps the highest reply count on the site to 1 and 0 to 0.
-      'score' => '2.0 - 2.0 / (1.0 + node_comment_statistics.comment_count * CAST(:scale AS DECIMAL))',
-      'arguments' => array(':scale' => variable_get('node_cron_comments_scale', 0)),
-    ),
-  );
-}
-
-/**
  * Implement hook_menu_alter().
  */
 function comment_menu_alter(&$items) {
Index: modules/comment/comment.search.inc
===================================================================
RCS file: modules/comment/comment.search.inc
diff -N modules/comment/comment.search.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/comment/comment.search.inc	12 Nov 2009 22:37:03 -0000
@@ -0,0 +1,53 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Search hooks for Comment module.
+ */
+
+/**
+ * Implement hook_update_index().
+ */
+function comment_update_index() {
+  // Store the maximum possible comments per thread (used for ranking by reply count)
+  variable_set('node_cron_comments_scale', 1.0 / max(1, db_query('SELECT MAX(comment_count) FROM {node_comment_statistics}')->fetchField()));
+}
+
+/**
+ * Implement hook_node_update_index().
+ */
+function comment_node_update_index($node) {
+  $text = '';
+  if ($node->comment != COMMENT_NODE_HIDDEN) {
+    $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) {
+      $text .= '<h2>' . check_plain($comment->subject) . '</h2>' . check_markup($comment->comment, $comment->format, '', TRUE);
+    }
+  }
+  return $text;
+}
+
+/**
+ * Implement hook_ranking().
+ */
+function comment_ranking() {
+  return array(
+    'comments' => array(
+      'title' => t('Number of comments'),
+      'join' => array(
+        'type' => 'LEFT',
+        'table' => 'node_comment_statistics',
+        'alias' => 'node_comment_statistics',
+        'on' => 'node_comment_statistics.nid = i.sid',
+      ),
+      // Inverse law that maps the highest reply count on the site to 1 and 0 to 0.
+      'score' => '2.0 - 2.0 / (1.0 + node_comment_statistics.comment_count * CAST(:scale AS DECIMAL))',
+      'arguments' => array(':scale' => variable_get('node_cron_comments_scale', 0)),
+    ),
+  );
+}
+
Index: modules/dashboard/dashboard.block.inc
===================================================================
RCS file: modules/dashboard/dashboard.block.inc
diff -N modules/dashboard/dashboard.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/dashboard/dashboard.block.inc	12 Nov 2009 22:36:56 -0000
@@ -0,0 +1,25 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Dashboard module.
+ */
+
+/**
+ * Implement hook_block_info_alter().
+ *
+ * Skip rendering dashboard blocks when not on the dashboard page itself. This
+ * prevents expensive dashboard blocks from causing performance issues on pages
+ * where they will never be displayed.
+ */
+function dashboard_block_info_alter(&$blocks) {
+  if (!dashboard_is_visible()) {
+    foreach ($blocks as $key => $block) {
+      if (in_array($block->region, dashboard_regions())) {
+        unset($blocks[$key]);
+      }
+    }
+  }
+}
+
Index: modules/dashboard/dashboard.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/dashboard/dashboard.info,v
retrieving revision 1.1
diff -u -p -r1.1 dashboard.info
--- modules/dashboard/dashboard.info	13 Oct 2009 13:54:54 -0000	1.1
+++ modules/dashboard/dashboard.info	12 Nov 2009 22:36:56 -0000
@@ -6,3 +6,4 @@ package = Core
 version = VERSION
 files[] = dashboard.module
 dependencies[] = block
+files[] = dashboard.block.inc
Index: modules/dashboard/dashboard.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/dashboard/dashboard.module,v
retrieving revision 1.5
diff -u -p -r1.5 dashboard.module
--- modules/dashboard/dashboard.module	11 Nov 2009 08:52:27 -0000	1.5
+++ modules/dashboard/dashboard.module	12 Nov 2009 22:36:56 -0000
@@ -40,23 +40,6 @@ function dashboard_menu() {
 }
 
 /**
- * Implement hook_block_info_alter().
- *
- * Skip rendering dashboard blocks when not on the dashboard page itself. This
- * prevents expensive dashboard blocks from causing performance issues on pages
- * where they will never be displayed.
- */
-function dashboard_block_info_alter(&$blocks) {
-  if (!dashboard_is_visible()) {
-    foreach ($blocks as $key => $block) {
-      if (in_array($block->region, dashboard_regions())) {
-        unset($blocks[$key]);
-      }
-    }
-  }
-}
-
-/**
  * Implement hook_page_build().
  *
  * Display dashboard blocks in the main content region.
Index: modules/forum/forum.block.inc
===================================================================
RCS file: modules/forum/forum.block.inc
diff -N modules/forum/forum.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/forum/forum.block.inc	12 Nov 2009 22:36:39 -0000
@@ -0,0 +1,82 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Forum module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function forum_block_info() {
+  $blocks['active'] = array(
+    'info' => t('Active forum topics'),
+    'cache' => DRUPAL_CACHE_CUSTOM,
+  );
+  $blocks['new'] = array(
+    'info' => t('New forum topics'),
+    'cache' => DRUPAL_CACHE_CUSTOM,
+  );
+  return $blocks;
+}
+
+/**
+ * Implement hook_block_configure().
+ */
+function forum_block_configure($delta = '') {
+  $form['forum_block_num_' . $delta] = array('#type' => 'select', '#title' => t('Number of topics'), '#default_value' => variable_get('forum_block_num_' . $delta, '5'), '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)));
+  return $form;
+}
+
+/**
+ * Implement hook_block_save().
+ */
+function forum_block_save($delta = '', $edit = array()) {
+  variable_set('forum_block_num_' . $delta, $edit['forum_block_num_' . $delta]);
+}
+
+/**
+ * Implement hook_block_view().
+ *
+ * Generates a block containing the currently active forum topics and the
+ * most recently added forum topics.
+ */
+function forum_block_view($delta = '') {
+  $query = db_select('forum_index', 'f')
+    ->fields('f')
+    ->addTag('node_access');
+  switch ($delta) {
+    case 'active':
+      $title = t('Active forum topics');
+      $query
+        ->orderBy('f.last_comment_timestamp', 'DESC')
+        ->range(0, variable_get('forum_block_num_active', '5'));
+      break;
+
+    case 'new':
+      $title = t('New forum topics');
+      $query
+        ->orderBy('f.created', 'DESC')
+        ->range(0, variable_get('forum_block_num_new', '5'));
+      break;
+  }
+
+  $cache_keys = array_merge(array('forum', $delta), drupal_render_cid_parts());
+  // Cache based on the altered query. Enables us to cache with node access enabled.
+  $query->preExecute();
+  $cache_keys[] = md5(serialize(array((string) $query, $query->getArguments())));
+
+  $block['subject'] = $title;
+  $block['content'] = array(
+     '#access' => user_access('access content'),
+     '#pre_render' => array('forum_block_view_pre_render'),
+     '#cache' => array(
+        'keys' => $cache_keys,
+        'expire' => CACHE_TEMPORARY,
+     ),
+     '#query' => $query,
+  );
+  return $block;
+}
+
Index: modules/forum/forum.comment.inc
===================================================================
RCS file: modules/forum/forum.comment.inc
diff -N modules/forum/forum.comment.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/forum/forum.comment.inc	12 Nov 2009 22:36:40 -0000
@@ -0,0 +1,46 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Comment hooks for Forum module.
+ */
+
+/**
+ * Implement forum_comment_update().
+ *
+ * Comment module doesn't call hook_comment_unpublish() when saving individual
+ * comments so we need to check for those here.
+ */
+function forum_comment_update($comment) {
+  // comment_save() calls hook_comment_publish() for all published comments
+  // so we to handle all other values here.
+  if (!$comment->status) {
+    _forum_update_forum_index($comment->nid);
+  }
+}
+
+/**
+ * Implement forum_comment_delete().
+ */
+function forum_comment_delete($comment) {
+  _forum_update_forum_index($comment->nid);
+}
+
+/**
+ * Implement hook_comment_publish().
+ *
+ * This actually handles the insert and update of published nodes since
+ * comment_save() calls hook_comment_publish() for all published comments.
+ */
+function forum_comment_publish($comment) {
+  _forum_update_forum_index($comment->nid);
+}
+
+/**
+ * Implements forum_comment_unpublish().
+ */
+function forum_comment_unpublish($comment) {
+  _forum_update_forum_index($comment->nid);
+}
+
Index: modules/forum/forum.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.info,v
retrieving revision 1.12
diff -u -p -r1.12 forum.info
--- modules/forum/forum.info	8 Jun 2009 09:23:52 -0000	1.12
+++ modules/forum/forum.info	12 Nov 2009 22:36:40 -0000
@@ -11,3 +11,6 @@ files[] = forum.admin.inc
 files[] = forum.pages.inc
 files[] = forum.install
 files[] = forum.test
+files[] = forum.block.inc
+files[] = forum.comment.inc
+files[] = forum.taxonomy.inc
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.532
diff -u -p -r1.532 forum.module
--- modules/forum/forum.module	8 Nov 2009 19:11:56 -0000	1.532
+++ modules/forum/forum.module	12 Nov 2009 22:36:40 -0000
@@ -369,57 +369,6 @@ function forum_permission() {
 }
 
 /**
- * Implement hook_taxonomy().
- */
-function forum_taxonomy_term_delete($tid) {
-  // For containers, remove the tid from the forum_containers variable.
-  $containers = variable_get('forum_containers', array());
-  $key = array_search($tid, $containers);
-  if ($key !== FALSE) {
-    unset($containers[$key]);
-  }
-  variable_set('forum_containers', $containers);
-}
-
-/**
- * Implement hook_comment_publish().
- *
- * This actually handles the insert and update of published nodes since
- * comment_save() calls hook_comment_publish() for all published comments.
- */
-function forum_comment_publish($comment) {
-  _forum_update_forum_index($comment->nid);
-}
-
-/**
- * Implement forum_comment_update().
- *
- * Comment module doesn't call hook_comment_unpublish() when saving individual
- * comments so we need to check for those here.
- */
-function forum_comment_update($comment) {
-  // comment_save() calls hook_comment_publish() for all published comments
-  // so we to handle all other values here.
-  if (!$comment->status) {
-    _forum_update_forum_index($comment->nid);
-  }
-}
-
-/**
- * Implements forum_comment_unpublish().
- */
-function forum_comment_unpublish($comment) {
-  _forum_update_forum_index($comment->nid);
-}
-
-/**
- * Implement forum_comment_delete().
- */
-function forum_comment_delete($comment) {
-  _forum_update_forum_index($comment->nid);
-}
-
-/**
  * Implement hook_field_storage_pre_insert().
  */
 function forum_field_storage_pre_insert($obj_type, $object, &$skip_fields) {
@@ -509,80 +458,6 @@ function forum_form_alter(&$form, $form_
 }
 
 /**
- * Implement hook_block_info().
- */
-function forum_block_info() {
-  $blocks['active'] = array(
-    'info' => t('Active forum topics'),
-    'cache' => DRUPAL_CACHE_CUSTOM,
-  );
-  $blocks['new'] = array(
-    'info' => t('New forum topics'),
-    'cache' => DRUPAL_CACHE_CUSTOM,
-  );
-  return $blocks;
-}
-
-/**
- * Implement hook_block_configure().
- */
-function forum_block_configure($delta = '') {
-  $form['forum_block_num_' . $delta] = array('#type' => 'select', '#title' => t('Number of topics'), '#default_value' => variable_get('forum_block_num_' . $delta, '5'), '#options' => drupal_map_assoc(array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20)));
-  return $form;
-}
-
-/**
- * Implement hook_block_save().
- */
-function forum_block_save($delta = '', $edit = array()) {
-  variable_set('forum_block_num_' . $delta, $edit['forum_block_num_' . $delta]);
-}
-
-/**
- * Implement hook_block_view().
- *
- * Generates a block containing the currently active forum topics and the
- * most recently added forum topics.
- */
-function forum_block_view($delta = '') {
-  $query = db_select('forum_index', 'f')
-    ->fields('f')
-    ->addTag('node_access');
-  switch ($delta) {
-    case 'active':
-      $title = t('Active forum topics');
-      $query
-        ->orderBy('f.last_comment_timestamp', 'DESC')
-        ->range(0, variable_get('forum_block_num_active', '5'));
-      break;
-
-    case 'new':
-      $title = t('New forum topics');
-      $query
-        ->orderBy('f.created', 'DESC')
-        ->range(0, variable_get('forum_block_num_new', '5'));
-      break;
-  }
-
-  $cache_keys = array_merge(array('forum', $delta), drupal_render_cid_parts());
-  // Cache based on the altered query. Enables us to cache with node access enabled.
-  $query->preExecute();
-  $cache_keys[] = md5(serialize(array((string) $query, $query->getArguments())));
-
-  $block['subject'] = $title;
-  $block['content'] = array(
-     '#access' => user_access('access content'),
-     '#pre_render' => array('forum_block_view_pre_render'),
-     '#cache' => array(
-        'keys' => $cache_keys,
-        'expire' => CACHE_TEMPORARY,
-     ),
-     '#query' => $query,
-  );
-  return $block;
-}
-
-/**
 * A #pre_render callback. Lists nodes based on the element's #query property.
 *
 * @see forum_block_view().
Index: modules/forum/forum.taxonomy.inc
===================================================================
RCS file: modules/forum/forum.taxonomy.inc
diff -N modules/forum/forum.taxonomy.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/forum/forum.taxonomy.inc	12 Nov 2009 22:36:40 -0000
@@ -0,0 +1,21 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Taxonomy hooks for Forum module.
+ */
+
+/**
+ * Implement hook_taxonomy().
+ */
+function forum_taxonomy_term_delete($tid) {
+  // For containers, remove the tid from the forum_containers variable.
+  $containers = variable_get('forum_containers', array());
+  $key = array_search($tid, $containers);
+  if ($key !== FALSE) {
+    unset($containers[$key]);
+  }
+  variable_set('forum_containers', $containers);
+}
+
Index: modules/locale/locale.block.inc
===================================================================
RCS file: modules/locale/locale.block.inc
diff -N modules/locale/locale.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/locale/locale.block.inc	12 Nov 2009 22:36:34 -0000
@@ -0,0 +1,45 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Locale module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function locale_block_info() {
+  include_once DRUPAL_ROOT . '/includes/language.inc';
+  $block = array();
+  $info = language_types_info();
+  foreach (language_types_configurable() as $type) {
+    $block[$type] = array(
+      'info' => t('Language switcher (@type)', array('@type' => $info[$type]['name'])),
+      // Not worth caching.
+      'cache' => DRUPAL_NO_CACHE,
+    );
+  }
+  return $block;
+}
+
+/**
+ * Implement hook_block_view().
+ *
+ * Displays a language switcher. Only show if we have at least two languages.
+ */
+function locale_block_view($type) {
+  if (drupal_multilingual()) {
+    $path = drupal_is_front_page() ? '<front>' : $_GET['q'];
+    $links = language_negotiation_get_switch_links($type, $path);
+
+    if (isset($links->links) && count($links->links > 1)) {
+      $class = "language-switcher-{$links->provider}";
+      $variables = array('links' => $links->links, 'attributes' => array('class' => array($class)));
+      $block['content'] = theme('links', $variables);
+      $block['subject'] = t('Languages');
+      return $block;
+    }
+  }
+}
+
Index: modules/locale/locale.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.info,v
retrieving revision 1.12
diff -u -p -r1.12 locale.info
--- modules/locale/locale.info	16 Oct 2009 02:04:42 -0000	1.12
+++ modules/locale/locale.info	12 Nov 2009 22:36:34 -0000
@@ -8,3 +8,4 @@ files[] = locale.module
 files[] = locale.install
 files[] = locale.field.inc
 files[] = locale.test
+files[] = locale.block.inc
Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.268
diff -u -p -r1.268 locale.module
--- modules/locale/locale.module	10 Nov 2009 17:27:53 -0000	1.268
+++ modules/locale/locale.module	12 Nov 2009 22:36:34 -0000
@@ -859,43 +859,6 @@ function locale_css_alter(&$css) {
 // Language switcher block
 
 /**
- * Implement hook_block_info().
- */
-function locale_block_info() {
-  include_once DRUPAL_ROOT . '/includes/language.inc';
-  $block = array();
-  $info = language_types_info();
-  foreach (language_types_configurable() as $type) {
-    $block[$type] = array(
-      'info' => t('Language switcher (@type)', array('@type' => $info[$type]['name'])),
-      // Not worth caching.
-      'cache' => DRUPAL_NO_CACHE,
-    );
-  }
-  return $block;
-}
-
-/**
- * Implement hook_block_view().
- *
- * Displays a language switcher. Only show if we have at least two languages.
- */
-function locale_block_view($type) {
-  if (drupal_multilingual()) {
-    $path = drupal_is_front_page() ? '<front>' : $_GET['q'];
-    $links = language_negotiation_get_switch_links($type, $path);
-
-    if (isset($links->links) && count($links->links > 1)) {
-      $class = "language-switcher-{$links->provider}";
-      $variables = array('links' => $links->links, 'attributes' => array('class' => array($class)));
-      $block['content'] = theme('links', $variables);
-      $block['subject'] = t('Languages');
-      return $block;
-    }
-  }
-}
-
-/**
  * Theme locale translation filter selector.
  *
  * @ingroup themeable
Index: modules/menu/menu.block.inc
===================================================================
RCS file: modules/menu/menu.block.inc
diff -N modules/menu/menu.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/menu/menu.block.inc	12 Nov 2009 22:36:32 -0000
@@ -0,0 +1,52 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Menu module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function menu_block_info() {
+  $menus = menu_get_menus(FALSE);
+
+  $blocks = array();
+  foreach ($menus as $name => $title) {
+    // Default "Navigation" block is handled by user.module.
+    $blocks[$name]['info'] = check_plain($title);
+    // Menu blocks can't be cached because each menu item can have
+    // a custom access callback. menu.inc manages its own caching.
+    $blocks[$name]['cache'] = DRUPAL_NO_CACHE;
+  }
+  return $blocks;
+}
+
+/**
+ * Implement hook_block_view().
+ */
+function menu_block_view($delta = '') {
+  $menus = menu_get_menus(FALSE);
+  $data['subject'] = check_plain($menus[$delta]);
+  $data['content'] = menu_tree($delta);
+  // Add contextual links for this block.
+  if (!empty($data['content'])) {
+    $data['content']['#contextual_links']['menu'] = array('admin/structure/menu/manage', array($delta));
+  }
+  return $data;
+}
+
+/**
+ * Implement hook_block_view_alter().
+ */
+function menu_block_view_alter(&$data, $block) {
+  // Add contextual links for system menu blocks.
+  if ($block->module == 'system' && !empty($data['content'])) {
+    $system_menus = menu_list_system_menus();
+    if (isset($system_menus[$block->delta])) {
+      $data['content']['#contextual_links']['menu'] = array('admin/structure/menu/manage', array($block->delta));
+    }
+  }
+}
+
Index: modules/menu/menu.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.info,v
retrieving revision 1.9
diff -u -p -r1.9 menu.info
--- modules/menu/menu.info	8 Jun 2009 09:23:52 -0000	1.9
+++ modules/menu/menu.info	12 Nov 2009 22:36:32 -0000
@@ -8,3 +8,4 @@ files[] = menu.module
 files[] = menu.admin.inc
 files[] = menu.install
 files[] = menu.test
+files[] = menu.block.inc
Index: modules/menu/menu.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v
retrieving revision 1.217
diff -u -p -r1.217 menu.module
--- modules/menu/menu.module	8 Nov 2009 10:02:41 -0000	1.217
+++ modules/menu/menu.module	12 Nov 2009 22:36:32 -0000
@@ -405,50 +405,6 @@ function menu_reset_item($item) {
 }
 
 /**
- * Implement hook_block_info().
- */
-function menu_block_info() {
-  $menus = menu_get_menus(FALSE);
-
-  $blocks = array();
-  foreach ($menus as $name => $title) {
-    // Default "Navigation" block is handled by user.module.
-    $blocks[$name]['info'] = check_plain($title);
-    // Menu blocks can't be cached because each menu item can have
-    // a custom access callback. menu.inc manages its own caching.
-    $blocks[$name]['cache'] = DRUPAL_NO_CACHE;
-  }
-  return $blocks;
-}
-
-/**
- * Implement hook_block_view().
- */
-function menu_block_view($delta = '') {
-  $menus = menu_get_menus(FALSE);
-  $data['subject'] = check_plain($menus[$delta]);
-  $data['content'] = menu_tree($delta);
-  // Add contextual links for this block.
-  if (!empty($data['content'])) {
-    $data['content']['#contextual_links']['menu'] = array('admin/structure/menu/manage', array($delta));
-  }
-  return $data;
-}
-
-/**
- * Implement hook_block_view_alter().
- */
-function menu_block_view_alter(&$data, $block) {
-  // Add contextual links for system menu blocks.
-  if ($block->module == 'system' && !empty($data['content'])) {
-    $system_menus = menu_list_system_menus();
-    if (isset($system_menus[$block->delta])) {
-      $data['content']['#contextual_links']['menu'] = array('admin/structure/menu/manage', array($block->delta));
-    }
-  }
-}
-
-/**
  * Implement hook_node_insert().
  */
 function menu_node_insert($node) {
Index: modules/node/node.block.inc
===================================================================
RCS file: modules/node/node.block.inc
diff -N modules/node/node.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/node/node.block.inc	12 Nov 2009 22:36:25 -0000
@@ -0,0 +1,28 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Node module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function node_block_info() {
+  $blocks['syndicate']['info'] = t('Syndicate');
+  // Not worth caching.
+  $blocks['syndicate']['cache'] = DRUPAL_NO_CACHE;
+  return $blocks;
+}
+
+/**
+ * Implement hook_block_view().
+ */
+function node_block_view($delta = '') {
+  $block['subject'] = t('Syndicate');
+  $block['content'] = theme('feed_icon', array('url' => url('rss.xml'), 'title' => t('Syndicate')));
+
+  return $block;
+}
+
Index: modules/node/node.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.info,v
retrieving revision 1.12
diff -u -p -r1.12 node.info
--- modules/node/node.info	19 Aug 2009 20:19:36 -0000	1.12
+++ modules/node/node.info	12 Nov 2009 22:36:30 -0000
@@ -12,3 +12,5 @@ files[] = node.install
 files[] = node.test
 files[] = node.tokens.inc
 required = TRUE
+files[] = node.block.inc
+files[] = node.search.inc
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1166
diff -u -p -r1.1166 node.module
--- modules/node/node.module	8 Nov 2009 10:02:41 -0000	1.1166
+++ modules/node/node.module	12 Nov 2009 22:36:30 -0000
@@ -1444,170 +1444,6 @@ function _node_rankings(SelectQueryExten
 }
 
 /**
- * Implement hook_search_info().
- */
-function node_search_info() {
-  return array(
-    'title' => 'Content',
-    'path' => 'node',
-  );
-}
-
-/**
- * Implement hook_search_access().
- */
-function node_search_access() {
-  return user_access('access content');
-}
-
-/**
- * Implement hook_search_reset().
- */
-function node_search_reset() {
-  db_update('search_dataset')
-    ->fields(array('reindex' => REQUEST_TIME))
-    ->condition('type', 'node')
-    ->execute();
-}
-
-/**
- * Implement hook_search_status().
- */
-function node_search_status() {
-  $total = db_query('SELECT COUNT(*) FROM {node} WHERE status = :status', array(':status' => NODE_PUBLISHED))->fetchField();
-  $remaining = db_query("SELECT COUNT(*) FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE n.status = :status AND d.sid IS NULL OR d.reindex <> 0", array(':status' => NODE_PUBLISHED))->fetchField();
-  return array('remaining' => $remaining, 'total' => $total);
-}
-
-/**
- * Implement hook_search_admin().
- */
-function node_search_admin() {
-  // Output form for defining rank factor weights.
-  $form['content_ranking'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Content ranking'),
-  );
-  $form['content_ranking']['#theme'] = 'node_search_admin';
-  $form['content_ranking']['info'] = array(
-    '#value' => '<em>' . t('The following numbers control which properties the content search should favor when ordering the results. Higher numbers mean more influence, zero means the property is ignored. Changing these numbers does not require the search index to be rebuilt. Changes take effect immediately.') . '</em>'
-  );
-
-  // Note: reversed to reflect that higher number = higher ranking.
-  $options = drupal_map_assoc(range(0, 10));
-  foreach (module_invoke_all('ranking') as $var => $values) {
-    $form['content_ranking']['factors']['node_rank_' . $var] = array(
-      '#title' => $values['title'],
-      '#type' => 'select',
-      '#options' => $options,
-      '#default_value' => variable_get('node_rank_' . $var, 0),
-    );
-  }
-  return $form;
-}
-
-/**
- * Implement hook_search_execute().
- */
-function node_search_execute($keys = NULL) {
-  // Build matching conditions
-  $query = db_select('search_index', 'i', array('target' => 'slave'))->extend('SearchQuery')->extend('PagerDefault');
-  $query->join('node', 'n', 'n.nid = i.sid');
-  $query
-    ->condition('n.status', 1)
-    ->addTag('node_access')
-    ->searchExpression($keys, 'node');
-
-  // Insert special keywords.
-  $query->setOption('type', 'n.type');
-  $query->setOption('language', 'n.language');
-  if ($query->setOption('term', 'tn.nid')) {
-    $query->join('taxonomy_term_node', 'tn', 'n.vid = tn.vid');
-  }
-  // Only continue if the first pass query matches.
-  if (!$query->executeFirstPass()) {
-    return array();
-  }
-
-  // Add the ranking expressions.
-  _node_rankings($query);
-
-  // Add a count query.
-  $inner_query = clone $query;
-  $count_query = db_select($inner_query->fields('i', array('sid')), NULL, array('target' => 'slave'));
-  $count_query->addExpression('COUNT(*)');
-  $query->setCountQuery($count_query);
-  $find = $query
-    ->limit(10)
-    ->execute();
-
-  // Load results.
-  $results = array();
-  foreach ($find as $item) {
-    // Render the node.
-    $node = node_load($item->sid);
-    $build = node_build($node, 'search_result');
-    unset($build['#theme']);
-    $node->rendered = drupal_render($build);
-
-    // Fetch comments for snippet.
-    $node->rendered .= ' ' . module_invoke('comment', 'node_update_index', $node);
-    // Fetch terms for snippet.
-    $node->rendered .= ' ' . module_invoke('taxonomy', 'node_update_index', $node);
-
-    $extra = module_invoke_all('node_search_result', $node);
-
-    $results[] = array(
-      'link' => url('node/' . $item->sid, array('absolute' => TRUE)),
-      'type' => check_plain(node_type_get_name($node)),
-      'title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'],
-      'user' => theme('username', array('account' => $node)),
-      'date' => $node->changed,
-      'node' => $node,
-      'extra' => $extra,
-      'score' => $item->calculated_score,
-      'snippet' => search_excerpt($keys, $node->rendered),
-    );
-  }
-  return $results;
-}
-
-/**
- * Implement hook_ranking().
- */
-function node_ranking() {
-  // Create the ranking array and add the basic ranking options.
-  $ranking = array(
-    'relevance' => array(
-      'title' => t('Keyword relevance'),
-      // Average relevance values hover around 0.15
-      'score' => 'i.relevance',
-    ),
-    'sticky' => array(
-      'title' => t('Content is sticky at top of lists'),
-      // The sticky flag is either 0 or 1, which is automatically normalized.
-      'score' => 'n.sticky',
-    ),
-    'promote' => array(
-      'title' => t('Content is promoted to the front page'),
-      // The promote flag is either 0 or 1, which is automatically normalized.
-      'score' => 'n.promote',
-    ),
-  );
-
-  // Add relevance based on creation or changed date.
-  if ($node_cron_last = variable_get('node_cron_last', 0)) {
-    $ranking['recent'] = array(
-      'title' => t('Recently posted'),
-      // Exponential decay with half-life of 6 months, starting at last indexed node
-      'score' => 'POW(2.0, (GREATEST(n.created, n.changed) - :node_cron_last) * 6.43e-8)',
-      'arguments' => array(':node_cron_last' => $node_cron_last),
-    );
-  }
-  return $ranking;
-}
-
-/**
  * Implement hook_user_cancel().
  */
 function node_user_cancel($edit, $account, $method) {
@@ -1969,26 +1805,6 @@ function node_revision_list($node) {
 }
 
 /**
- * Implement hook_block_info().
- */
-function node_block_info() {
-  $blocks['syndicate']['info'] = t('Syndicate');
-  // Not worth caching.
-  $blocks['syndicate']['cache'] = DRUPAL_NO_CACHE;
-  return $blocks;
-}
-
-/**
- * Implement hook_block_view().
- */
-function node_block_view($delta = '') {
-  $block['subject'] = t('Syndicate');
-  $block['content'] = theme('feed_icon', array('url' => url('rss.xml'), 'title' => t('Syndicate')));
-
-  return $block;
-}
-
-/**
  * A generic function for generating RSS feeds from a set of nodes.
  *
  * @param $nids
@@ -2164,19 +1980,6 @@ function node_page_view($node) {
 }
 
 /**
- * Implement hook_update_index().
- */
-function node_update_index() {
-  $limit = (int)variable_get('search_cron_limit', 100);
-
-  $result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit, array(), array('target' => 'slave'));
-
-  foreach ($result as $node) {
-    _node_index_node($node);
-  }
-}
-
-/**
  * Index a single node.
  *
  * @param $node
Index: modules/node/node.search.inc
===================================================================
RCS file: modules/node/node.search.inc
diff -N modules/node/node.search.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/node/node.search.inc	12 Nov 2009 22:36:30 -0000
@@ -0,0 +1,185 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Search hooks for Node module.
+ */
+
+/**
+ * Implement hook_search_info().
+ */
+function node_search_info() {
+  return array(
+    'title' => 'Content',
+    'path' => 'node',
+  );
+}
+
+/**
+ * Implement hook_search_access().
+ */
+function node_search_access() {
+  return user_access('access content');
+}
+
+/**
+ * Implement hook_search_execute().
+ */
+function node_search_execute($keys = NULL) {
+  // Build matching conditions
+  $query = db_select('search_index', 'i', array('target' => 'slave'))->extend('SearchQuery')->extend('PagerDefault');
+  $query->join('node', 'n', 'n.nid = i.sid');
+  $query
+    ->condition('n.status', 1)
+    ->addTag('node_access')
+    ->searchExpression($keys, 'node');
+
+  // Insert special keywords.
+  $query->setOption('type', 'n.type');
+  $query->setOption('language', 'n.language');
+  if ($query->setOption('term', 'tn.nid')) {
+    $query->join('taxonomy_term_node', 'tn', 'n.vid = tn.vid');
+  }
+  // Only continue if the first pass query matches.
+  if (!$query->executeFirstPass()) {
+    return array();
+  }
+
+  // Add the ranking expressions.
+  _node_rankings($query);
+
+  // Add a count query.
+  $inner_query = clone $query;
+  $count_query = db_select($inner_query->fields('i', array('sid')), NULL, array('target' => 'slave'));
+  $count_query->addExpression('COUNT(*)');
+  $query->setCountQuery($count_query);
+  $find = $query
+    ->limit(10)
+    ->execute();
+
+  // Load results.
+  $results = array();
+  foreach ($find as $item) {
+    // Render the node.
+    $node = node_load($item->sid);
+    $build = node_build($node, 'search_result');
+    unset($build['#theme']);
+    $node->rendered = drupal_render($build);
+
+    // Fetch comments for snippet.
+    $node->rendered .= ' ' . module_invoke('comment', 'node_update_index', $node);
+    // Fetch terms for snippet.
+    $node->rendered .= ' ' . module_invoke('taxonomy', 'node_update_index', $node);
+
+    $extra = module_invoke_all('node_search_result', $node);
+
+    $results[] = array(
+      'link' => url('node/' . $item->sid, array('absolute' => TRUE)),
+      'type' => check_plain(node_type_get_name($node)),
+      'title' => $node->title[FIELD_LANGUAGE_NONE][0]['value'],
+      'user' => theme('username', array('account' => $node)),
+      'date' => $node->changed,
+      'node' => $node,
+      'extra' => $extra,
+      'score' => $item->calculated_score,
+      'snippet' => search_excerpt($keys, $node->rendered),
+    );
+  }
+  return $results;
+}
+
+/**
+ * Implement hook_search_admin().
+ */
+function node_search_admin() {
+  // Output form for defining rank factor weights.
+  $form['content_ranking'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Content ranking'),
+  );
+  $form['content_ranking']['#theme'] = 'node_search_admin';
+  $form['content_ranking']['info'] = array(
+    '#value' => '<em>' . t('The following numbers control which properties the content search should favor when ordering the results. Higher numbers mean more influence, zero means the property is ignored. Changing these numbers does not require the search index to be rebuilt. Changes take effect immediately.') . '</em>'
+  );
+
+  // Note: reversed to reflect that higher number = higher ranking.
+  $options = drupal_map_assoc(range(0, 10));
+  foreach (module_invoke_all('ranking') as $var => $values) {
+    $form['content_ranking']['factors']['node_rank_' . $var] = array(
+      '#title' => $values['title'],
+      '#type' => 'select',
+      '#options' => $options,
+      '#default_value' => variable_get('node_rank_' . $var, 0),
+    );
+  }
+  return $form;
+}
+
+/**
+ * Implement hook_search_status().
+ */
+function node_search_status() {
+  $total = db_query('SELECT COUNT(*) FROM {node} WHERE status = :status', array(':status' => NODE_PUBLISHED))->fetchField();
+  $remaining = db_query("SELECT COUNT(*) FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE n.status = :status AND d.sid IS NULL OR d.reindex <> 0", array(':status' => NODE_PUBLISHED))->fetchField();
+  return array('remaining' => $remaining, 'total' => $total);
+}
+
+/**
+ * Implement hook_search_reset().
+ */
+function node_search_reset() {
+  db_update('search_dataset')
+    ->fields(array('reindex' => REQUEST_TIME))
+    ->condition('type', 'node')
+    ->execute();
+}
+
+/**
+ * Implement hook_update_index().
+ */
+function node_update_index() {
+  $limit = (int)variable_get('search_cron_limit', 100);
+
+  $result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, $limit, array(), array('target' => 'slave'));
+
+  foreach ($result as $node) {
+    _node_index_node($node);
+  }
+}
+
+/**
+ * Implement hook_ranking().
+ */
+function node_ranking() {
+  // Create the ranking array and add the basic ranking options.
+  $ranking = array(
+    'relevance' => array(
+      'title' => t('Keyword relevance'),
+      // Average relevance values hover around 0.15
+      'score' => 'i.relevance',
+    ),
+    'sticky' => array(
+      'title' => t('Content is sticky at top of lists'),
+      // The sticky flag is either 0 or 1, which is automatically normalized.
+      'score' => 'n.sticky',
+    ),
+    'promote' => array(
+      'title' => t('Content is promoted to the front page'),
+      // The promote flag is either 0 or 1, which is automatically normalized.
+      'score' => 'n.promote',
+    ),
+  );
+
+  // Add relevance based on creation or changed date.
+  if ($node_cron_last = variable_get('node_cron_last', 0)) {
+    $ranking['recent'] = array(
+      'title' => t('Recently posted'),
+      // Exponential decay with half-life of 6 months, starting at last indexed node
+      'score' => 'POW(2.0, (GREATEST(n.created, n.changed) - :node_cron_last) * 6.43e-8)',
+      'arguments' => array(':node_cron_last' => $node_cron_last),
+    );
+  }
+  return $ranking;
+}
+
Index: modules/path/path.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.info,v
retrieving revision 1.8
diff -u -p -r1.8 path.info
--- modules/path/path.info	8 Jun 2009 09:23:53 -0000	1.8
+++ modules/path/path.info	12 Nov 2009 22:36:22 -0000
@@ -7,3 +7,4 @@ core = 7.x
 files[] = path.module
 files[] = path.admin.inc
 files[] = path.test
+files[] = path.taxonomy.inc
Index: modules/path/path.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.module,v
retrieving revision 1.175
diff -u -p -r1.175 path.module
--- modules/path/path.module	8 Nov 2009 10:02:41 -0000	1.175
+++ modules/path/path.module	12 Nov 2009 22:36:22 -0000
@@ -258,49 +258,3 @@ function path_form_taxonomy_form_term_al
   }
 }
 
-/**
- * Implement hook_taxonomy_term_insert().
- */
-function path_taxonomy_term_insert($term) {
-  if (isset($term->path)) {
-    $path = $term->path;
-    $path['alias'] = trim($path['alias']);
-    // Only save a non-empty alias.
-    if (!empty($path['alias'])) {
-      // Ensure fields for programmatic executions.
-      $path['source'] = 'taxonomy/term/' . $term->tid;
-      $path['language'] = '';
-      path_save($path);
-    }
-  }
-}
-
-/**
- * Implement hook_taxonomy_term_update().
- */
-function path_taxonomy_term_update($term) {
-  if (isset($term->path)) {
-    $path = $term->path;
-    $path['alias'] = trim($path['alias']);
-    // Delete old alias if user erased it.
-    if (!empty($path['pid']) && empty($path['alias'])) {
-      path_delete($path['pid']);
-    }
-    // Only save a non-empty alias.
-    if (!empty($path['alias'])) {
-      // Ensure fields for programmatic executions.
-      $path['source'] = 'taxonomy/term/' . $term->tid;
-      $path['language'] = '';
-      path_save($path);
-    }
-  }
-}
-
-/**
- * Implement hook_taxonomy_term_delete().
- */
-function path_taxonomy_term_delete($term) {
-  // Delete all aliases associated with this term.
-  path_delete(array('source' => 'taxonomy/term/' . $term->tid));
-}
-
Index: modules/path/path.taxonomy.inc
===================================================================
RCS file: modules/path/path.taxonomy.inc
diff -N modules/path/path.taxonomy.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/path/path.taxonomy.inc	12 Nov 2009 22:36:22 -0000
@@ -0,0 +1,54 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Taxonomy hooks for Path module.
+ */
+
+/**
+ * Implement hook_taxonomy_term_insert().
+ */
+function path_taxonomy_term_insert($term) {
+  if (isset($term->path)) {
+    $path = $term->path;
+    $path['alias'] = trim($path['alias']);
+    // Only save a non-empty alias.
+    if (!empty($path['alias'])) {
+      // Ensure fields for programmatic executions.
+      $path['source'] = 'taxonomy/term/' . $term->tid;
+      $path['language'] = '';
+      path_save($path);
+    }
+  }
+}
+
+/**
+ * Implement hook_taxonomy_term_update().
+ */
+function path_taxonomy_term_update($term) {
+  if (isset($term->path)) {
+    $path = $term->path;
+    $path['alias'] = trim($path['alias']);
+    // Delete old alias if user erased it.
+    if (!empty($path['pid']) && empty($path['alias'])) {
+      path_delete($path['pid']);
+    }
+    // Only save a non-empty alias.
+    if (!empty($path['alias'])) {
+      // Ensure fields for programmatic executions.
+      $path['source'] = 'taxonomy/term/' . $term->tid;
+      $path['language'] = '';
+      path_save($path);
+    }
+  }
+}
+
+/**
+ * Implement hook_taxonomy_term_delete().
+ */
+function path_taxonomy_term_delete($term) {
+  // Delete all aliases associated with this term.
+  path_delete(array('source' => 'taxonomy/term/' . $term->tid));
+}
+
Index: modules/poll/poll.block.inc
===================================================================
RCS file: modules/poll/poll.block.inc
diff -N modules/poll/poll.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/poll/poll.block.inc	12 Nov 2009 22:36:20 -0000
@@ -0,0 +1,48 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Poll module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function poll_block_info() {
+  if (user_access('access content')) {
+    $blocks['recent']['info'] = t('Most recent poll');
+    return $blocks;
+  }
+}
+
+/**
+ * Implement hook_block_view().
+ *
+ * Generates a block containing the latest poll.
+ */
+function poll_block_view($delta = '') {
+  if (user_access('access content')) {
+    // Retrieve the latest poll.
+    $select = db_select('node', 'n');
+    $select->join('poll', 'p', 'p.nid = n.nid');
+    $select->fields('n', array('nid'))
+      ->condition('n.status', 1)
+      ->condition('p.active', 1)
+      ->orderBy('n.created', 'DESC')
+      ->range(0, 1)
+      ->addTag('node_access');
+
+    $record = $select->execute()->fetchObject();
+    if ($record) {
+      $poll = node_load($record->nid);
+      if ($poll->nid) {
+        $poll = poll_block_latest_poll_view($poll);
+        $block['subject'] = t('Poll');
+        $block['content'] = $poll->content;
+        return $block;
+      }
+    }
+  }
+}
+
Index: modules/poll/poll.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.info,v
retrieving revision 1.10
diff -u -p -r1.10 poll.info
--- modules/poll/poll.info	19 Aug 2009 20:19:36 -0000	1.10
+++ modules/poll/poll.info	12 Nov 2009 22:36:20 -0000
@@ -9,3 +9,4 @@ files[] = poll.pages.inc
 files[] = poll.install
 files[] = poll.test
 files[] = poll.tokens.inc
+files[] = poll.block.inc
Index: modules/poll/poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v
retrieving revision 1.323
diff -u -p -r1.323 poll.module
--- modules/poll/poll.module	8 Nov 2009 10:02:41 -0000	1.323
+++ modules/poll/poll.module	12 Nov 2009 22:36:20 -0000
@@ -117,46 +117,6 @@ function _poll_menu_access($node, $perm,
 }
 
 /**
- * Implement hook_block_info().
- */
-function poll_block_info() {
-  if (user_access('access content')) {
-    $blocks['recent']['info'] = t('Most recent poll');
-    return $blocks;
-  }
-}
-
-/**
- * Implement hook_block_view().
- *
- * Generates a block containing the latest poll.
- */
-function poll_block_view($delta = '') {
-  if (user_access('access content')) {
-    // Retrieve the latest poll.
-    $select = db_select('node', 'n');
-    $select->join('poll', 'p', 'p.nid = n.nid');
-    $select->fields('n', array('nid'))
-      ->condition('n.status', 1)
-      ->condition('p.active', 1)
-      ->orderBy('n.created', 'DESC')
-      ->range(0, 1)
-      ->addTag('node_access');
-
-    $record = $select->execute()->fetchObject();
-    if ($record) {
-      $poll = node_load($record->nid);
-      if ($poll->nid) {
-        $poll = poll_block_latest_poll_view($poll);
-        $block['subject'] = t('Poll');
-        $block['content'] = $poll->content;
-        return $block;
-      }
-    }
-  }
-}
-
-/**
  * Implement hook_cron().
  *
  * Closes polls that have exceeded their allowed runtime.
Index: modules/profile/profile.block.inc
===================================================================
RCS file: modules/profile/profile.block.inc
diff -N modules/profile/profile.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/profile/profile.block.inc	12 Nov 2009 22:36:19 -0000
@@ -0,0 +1,76 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Profile module.
+ */
+
+/**
+ * Implement hook_block_configure().
+ */
+function profile_block_configure($delta = '') {
+  // Compile a list of fields to show
+  $fields = array();
+  $result = db_query('SELECT name, title, weight, visibility FROM {profile_field} WHERE visibility IN (:visibility) ORDER BY weight', array(':visibility' => array(PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS)));
+  foreach ($result as $record) {
+    $fields[$record->name] = check_plain($record->title);
+  }
+  $fields['user_profile'] = t('Link to full user profile');
+  $form['profile_block_author_fields'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Profile fields to display'),
+    '#default_value' => variable_get('profile_block_author_fields', array()),
+    '#options' => $fields,
+    '#description' => t('Select which profile fields you wish to display in the block. Only fields designated as public in the <a href="@profile-admin">profile field configuration</a> are available.', array('@profile-admin' => url('admin/config/people/profile'))),
+  );
+  return $form;
+}
+
+/**
+ * Implement hook_block_save().
+ */
+function profile_block_save($delta = '', $edit = array()) {
+  variable_set('profile_block_author_fields', $edit['profile_block_author_fields']);
+}
+
+/**
+ * Implement hook_block_view().
+ */
+function profile_block_view($delta = '') {
+  if (user_access('access user profiles')) {
+    $output = '';
+    if ((arg(0) == 'node') && is_numeric(arg(1)) && (arg(2) == NULL)) {
+      $node = node_load(arg(1));
+      $account = user_load(array('uid' => $node->uid));
+
+      if ($use_fields = variable_get('profile_block_author_fields', array())) {
+        // Compile a list of fields to show.
+        $fields = array();
+        $result = db_query('SELECT name, title, weight, visibility FROM {profile_field} WHERE visibility IN (:visibility) ORDER BY weight', array(':visibility' => array(PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS)));
+        foreach ($result as $record) {
+          // Ensure that field is displayed only if it is among the defined block fields and, if it is private, the user has appropriate permissions.
+          if (isset($use_fields[$record->name]) && $use_fields[$record->name]) {
+            $fields[] = $record;
+          }
+        }
+      }
+
+      if (!empty($fields)) {
+        $profile = _profile_update_user_fields($fields, $account);
+        $output .= theme('profile_block', array('account' => $account, 'fields' => $profile));
+      }
+
+      if (isset($use_fields['user_profile']) && $use_fields['user_profile']) {
+        $output .= '<div>' . l(t('View full user profile'), 'user/' . $account->uid) . '</div>';
+      }
+    }
+
+    if ($output) {
+      $block['subject'] = t('About %name', array('%name' => format_username($account)));
+      $block['content'] = $output;
+      return $block;
+    }
+  }
+}
+
Index: modules/profile/profile.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.info,v
retrieving revision 1.9
diff -u -p -r1.9 profile.info
--- modules/profile/profile.info	8 Jun 2009 09:23:53 -0000	1.9
+++ modules/profile/profile.info	12 Nov 2009 22:36:19 -0000
@@ -9,3 +9,4 @@ files[] = profile.admin.inc
 files[] = profile.pages.inc
 files[] = profile.install
 files[] = profile.test
+files[] = profile.block.inc
Index: modules/profile/profile.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v
retrieving revision 1.281
diff -u -p -r1.281 profile.module
--- modules/profile/profile.module	1 Nov 2009 21:26:44 -0000	1.281
+++ modules/profile/profile.module	12 Nov 2009 22:36:19 -0000
@@ -142,74 +142,6 @@ function profile_menu() {
 }
 
 /**
- * Implement hook_block_configure().
- */
-function profile_block_configure($delta = '') {
-  // Compile a list of fields to show
-  $fields = array();
-  $result = db_query('SELECT name, title, weight, visibility FROM {profile_field} WHERE visibility IN (:visibility) ORDER BY weight', array(':visibility' => array(PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS)));
-  foreach ($result as $record) {
-    $fields[$record->name] = check_plain($record->title);
-  }
-  $fields['user_profile'] = t('Link to full user profile');
-  $form['profile_block_author_fields'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('Profile fields to display'),
-    '#default_value' => variable_get('profile_block_author_fields', array()),
-    '#options' => $fields,
-    '#description' => t('Select which profile fields you wish to display in the block. Only fields designated as public in the <a href="@profile-admin">profile field configuration</a> are available.', array('@profile-admin' => url('admin/config/people/profile'))),
-  );
-  return $form;
-}
-
-/**
- * Implement hook_block_save().
- */
-function profile_block_save($delta = '', $edit = array()) {
-  variable_set('profile_block_author_fields', $edit['profile_block_author_fields']);
-}
-
-/**
- * Implement hook_block_view().
- */
-function profile_block_view($delta = '') {
-  if (user_access('access user profiles')) {
-    $output = '';
-    if ((arg(0) == 'node') && is_numeric(arg(1)) && (arg(2) == NULL)) {
-      $node = node_load(arg(1));
-      $account = user_load(array('uid' => $node->uid));
-
-      if ($use_fields = variable_get('profile_block_author_fields', array())) {
-        // Compile a list of fields to show.
-        $fields = array();
-        $result = db_query('SELECT name, title, weight, visibility FROM {profile_field} WHERE visibility IN (:visibility) ORDER BY weight', array(':visibility' => array(PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS)));
-        foreach ($result as $record) {
-          // Ensure that field is displayed only if it is among the defined block fields and, if it is private, the user has appropriate permissions.
-          if (isset($use_fields[$record->name]) && $use_fields[$record->name]) {
-            $fields[] = $record;
-          }
-        }
-      }
-
-      if (!empty($fields)) {
-        $profile = _profile_update_user_fields($fields, $account);
-        $output .= theme('profile_block', array('account' => $account, 'fields' => $profile));
-      }
-
-      if (isset($use_fields['user_profile']) && $use_fields['user_profile']) {
-        $output .= '<div>' . l(t('View full user profile'), 'user/' . $account->uid) . '</div>';
-      }
-    }
-
-    if ($output) {
-      $block['subject'] = t('About %name', array('%name' => format_username($account)));
-      $block['content'] = $output;
-      return $block;
-    }
-  }
-}
-
-/**
  * Implement hook_user_presave().
  */
 function profile_user_presave(&$edit, $account, $category) {
Index: modules/search/search.block.inc
===================================================================
RCS file: modules/search/search.block.inc
diff -N modules/search/search.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/search/search.block.inc	12 Nov 2009 22:36:15 -0000
@@ -0,0 +1,28 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Search module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function search_block_info() {
+  $blocks['form']['info'] = t('Search form');
+  // Not worth caching.
+  $blocks['form']['cache'] = DRUPAL_NO_CACHE;
+  return $blocks;
+}
+
+/**
+ * Implement hook_block_view().
+ */
+function search_block_view($delta = '') {
+  if (user_access('search content')) {
+    $block['content'] = drupal_get_form('search_block_form');
+    return $block;
+  }
+}
+
Index: modules/search/search.comment.inc
===================================================================
RCS file: modules/search/search.comment.inc
diff -N modules/search/search.comment.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/search/search.comment.inc	12 Nov 2009 22:36:16 -0000
@@ -0,0 +1,48 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Comment hooks for Search module.
+ */
+
+/**
+ * Implement hook_comment_insert().
+ */
+function search_comment_insert($comment) {
+  // Reindex the node when comments are added.
+  search_touch_node($comment->nid);
+}
+
+/**
+ * Implement hook_comment_update().
+ */
+function search_comment_update($comment) {
+  // Reindex the node when comments are changed.
+  search_touch_node($comment->nid);
+}
+
+/**
+ * Implement hook_comment_delete().
+ */
+function search_comment_delete($comment) {
+  // Reindex the node when comments are deleted.
+  search_touch_node($comment->nid);
+}
+
+/**
+ * Implement hook_comment_publish().
+ */
+function search_comment_publish($comment) {
+  // Reindex the node when comments are published.
+  search_touch_node($comment->nid);
+}
+
+/**
+ * Implement hook_comment_unpublish().
+ */
+function search_comment_unpublish($comment) {
+  // Reindex the node when comments are unpublished.
+  search_touch_node($comment->nid);
+}
+
Index: modules/search/search.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.info,v
retrieving revision 1.10
diff -u -p -r1.10 search.info
--- modules/search/search.info	29 Aug 2009 10:46:41 -0000	1.10
+++ modules/search/search.info	12 Nov 2009 22:36:17 -0000
@@ -10,3 +10,6 @@ files[] = search.pages.inc
 files[] = search.install
 files[] = search.test
 files[] = search.extender.inc
+files[] = search.block.inc
+files[] = search.comment.inc
+files[] = search.search.inc
Index: modules/search/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.324
diff -u -p -r1.324 search.module
--- modules/search/search.module	8 Nov 2009 10:02:41 -0000	1.324
+++ modules/search/search.module	12 Nov 2009 22:36:17 -0000
@@ -91,6 +91,24 @@ define('PREG_CLASS_CJK', '\x{3041}-\x{30
 '\x{4e00}-\x{9fbb}\x{f900}-\x{fad9}');
 
 /**
+ * Implements hook_hook_info().
+ */
+function search_hook_info() {
+  $hooks['search_info'] = array('group' => 'search');
+  $hooks['search_page'] = array('group' => 'search');
+  $hooks['search_access'] = array('group' => 'search');
+  $hooks['search_execute'] = array('group' => 'search');
+  $hooks['search_admin'] = array('group' => 'search');
+  $hooks['search_status'] = array('group' => 'search');
+  $hooks['search_reset'] = array('group' => 'search');
+  $hooks['update_index'] = array('group' => 'search');
+  $hooks['node_update_index'] = array('group' => 'search');
+  $hooks['search_preprocess'] = array('group' => 'search');
+  $hooks['ranking'] = array('group' => 'search');
+  return $hooks;
+}
+
+/**
  * Implement hook_help().
  */
 function search_help($path, $arg) {
@@ -158,26 +176,6 @@ function search_permission() {
 }
 
 /**
- * Implement hook_block_info().
- */
-function search_block_info() {
-  $blocks['form']['info'] = t('Search form');
-  // Not worth caching.
-  $blocks['form']['cache'] = DRUPAL_NO_CACHE;
-  return $blocks;
-}
-
-/**
- * Implement hook_block_view().
- */
-function search_block_view($delta = '') {
-  if (user_access('search content')) {
-    $block['content'] = drupal_get_form('search_block_form');
-    return $block;
-  }
-}
-
-/**
  * Implement hook_menu().
  */
 function search_menu() {
@@ -712,21 +710,6 @@ function search_touch_node($nid) {
 }
 
 /**
- * Implement hook_node_update_index().
- */
-function search_node_update_index($node) {
-  // Transplant links to a node into the target node.
-  $result = db_query("SELECT caption FROM {search_node_links} WHERE nid = :nid", array(':nid' => $node->nid), array('target' => 'slave'));
-  $output = array();
-  foreach ($result as $link) {
-    $output[] = $link->caption;
-  }
-  if (count($output)) {
-    return '<a>(' . implode(', ', $output) . ')</a>';
-  }
-}
-
-/**
  * Implement hook_node_update().
  */
 function search_node_update($node) {
@@ -736,46 +719,6 @@ function search_node_update($node) {
 }
 
 /**
- * Implement hook_comment_insert().
- */
-function search_comment_insert($comment) {
-  // Reindex the node when comments are added.
-  search_touch_node($comment->nid);
-}
-
-/**
- * Implement hook_comment_update().
- */
-function search_comment_update($comment) {
-  // Reindex the node when comments are changed.
-  search_touch_node($comment->nid);
-}
-
-/**
- * Implement hook_comment_delete().
- */
-function search_comment_delete($comment) {
-  // Reindex the node when comments are deleted.
-  search_touch_node($comment->nid);
-}
-
-/**
- * Implement hook_comment_publish().
- */
-function search_comment_publish($comment) {
-  // Reindex the node when comments are published.
-  search_touch_node($comment->nid);
-}
-
-/**
- * Implement hook_comment_unpublish().
- */
-function search_comment_unpublish($comment) {
-  // Reindex the node when comments are unpublished.
-  search_touch_node($comment->nid);
-}
-
-/**
  * Extract a module-specific search option from a search query. e.g. 'type:book'
  */
 function search_expression_extract($keys, $option) {
Index: modules/search/search.search.inc
===================================================================
RCS file: modules/search/search.search.inc
diff -N modules/search/search.search.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/search/search.search.inc	12 Nov 2009 22:36:17 -0000
@@ -0,0 +1,23 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Search hooks for Search module.
+ */
+
+/**
+ * Implement hook_node_update_index().
+ */
+function search_node_update_index($node) {
+  // Transplant links to a node into the target node.
+  $result = db_query("SELECT caption FROM {search_node_links} WHERE nid = :nid", array(':nid' => $node->nid), array('target' => 'slave'));
+  $output = array();
+  foreach ($result as $link) {
+    $output[] = $link->caption;
+  }
+  if (count($output)) {
+    return '<a>(' . implode(', ', $output) . ')</a>';
+  }
+}
+
Index: modules/shortcut/shortcut.block.inc
===================================================================
RCS file: modules/shortcut/shortcut.block.inc
diff -N modules/shortcut/shortcut.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/shortcut/shortcut.block.inc	12 Nov 2009 22:36:13 -0000
@@ -0,0 +1,31 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Shortcut module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function shortcut_block_info() {
+  $blocks['shortcuts']['info'] = t('Shortcuts');
+  // Shortcut blocks can't be cached because each menu item can have a custom
+  // access callback. menu.inc manages its own caching.
+  $blocks['shortcuts']['cache'] = DRUPAL_NO_CACHE;
+  return $blocks;
+}
+
+/**
+ * Implement hook_block_view().
+ */
+function shortcut_block_view($delta = '') {
+  if ($delta == 'shortcuts') {
+    $shortcut_set = shortcut_current_displayed_set();
+    $data['subject'] = t('@shortcut_set shortcuts', array('@shortcut_set' => $shortcut_set->title));
+    $data['content'] = shortcut_renderable_links($shortcut_set);
+    return $data;
+  }
+}
+
Index: modules/shortcut/shortcut.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.info,v
retrieving revision 1.1
diff -u -p -r1.1 shortcut.info
--- modules/shortcut/shortcut.info	17 Oct 2009 00:51:52 -0000	1.1
+++ modules/shortcut/shortcut.info	12 Nov 2009 22:36:13 -0000
@@ -7,3 +7,4 @@ core = 7.x
 files[] = shortcut.module
 files[] = shortcut.admin.inc
 files[] = shortcut.install
+files[] = shortcut.block.inc
Index: modules/shortcut/shortcut.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.module,v
retrieving revision 1.5
diff -u -p -r1.5 shortcut.module
--- modules/shortcut/shortcut.module	11 Nov 2009 06:56:52 -0000	1.5
+++ modules/shortcut/shortcut.module	12 Nov 2009 22:36:13 -0000
@@ -120,29 +120,6 @@ function shortcut_theme() {
 }
 
 /**
- * Implement hook_block_info().
- */
-function shortcut_block_info() {
-  $blocks['shortcuts']['info'] = t('Shortcuts');
-  // Shortcut blocks can't be cached because each menu item can have a custom
-  // access callback. menu.inc manages its own caching.
-  $blocks['shortcuts']['cache'] = DRUPAL_NO_CACHE;
-  return $blocks;
-}
-
-/**
- * Implement hook_block_view().
- */
-function shortcut_block_view($delta = '') {
-  if ($delta == 'shortcuts') {
-    $shortcut_set = shortcut_current_displayed_set();
-    $data['subject'] = t('@shortcut_set shortcuts', array('@shortcut_set' => $shortcut_set->title));
-    $data['content'] = shortcut_renderable_links($shortcut_set);
-    return $data;
-  }
-}
-
-/**
  * Access callback for editing a shortcut set.
  *
  * @param $shortcut_set
Index: modules/statistics/statistics.block.inc
===================================================================
RCS file: modules/statistics/statistics.block.inc
diff -N modules/statistics/statistics.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/statistics/statistics.block.inc	12 Nov 2009 22:36:12 -0000
@@ -0,0 +1,71 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for Statistics module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function statistics_block_info() {
+  if (variable_get('statistics_count_content_views', 0)) {
+    $blocks['popular']['info'] = t('Popular content');
+    // Too dynamic to cache.
+    $blocks['popular']['cache'] = DRUPAL_NO_CACHE;
+    return $blocks;
+  }
+}
+
+/**
+ * Implement hook_block_configure().
+ */
+function statistics_block_configure($delta = '') {
+  // Popular content block settings
+  $numbers = array('0' => t('Disabled')) + drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 40));
+  $form['statistics_block_top_day_num'] = array('#type' => 'select', '#title' => t("Number of day's top views to display"), '#default_value' => variable_get('statistics_block_top_day_num', 0), '#options' => $numbers, '#description' => t('How many content items to display in "day" list.'));
+  $form['statistics_block_top_all_num'] = array('#type' => 'select', '#title' => t('Number of all time views to display'), '#default_value' => variable_get('statistics_block_top_all_num', 0), '#options' => $numbers, '#description' => t('How many content items to display in "all time" list.'));
+  $form['statistics_block_top_last_num'] = array('#type' => 'select', '#title' => t('Number of most recent views to display'), '#default_value' => variable_get('statistics_block_top_last_num', 0), '#options' => $numbers, '#description' => t('How many content items to display in "recently viewed" list.'));
+  return $form;
+}
+
+/**
+ * Implement hook_block_save().
+ */
+function statistics_block_save($delta = '', $edit = array()) {
+  variable_set('statistics_block_top_day_num', $edit['statistics_block_top_day_num']);
+  variable_set('statistics_block_top_all_num', $edit['statistics_block_top_all_num']);
+  variable_set('statistics_block_top_last_num', $edit['statistics_block_top_last_num']);
+}
+
+/**
+ * Implement hook_block_view().
+ */
+function statistics_block_view($delta = '') {
+  if (user_access('access content')) {
+    $content = array();
+
+    $daytop = variable_get('statistics_block_top_day_num', 0);
+    if ($daytop && ($result = statistics_title_list('daycount', $daytop)) && ($node_title_list = node_title_list($result, t("Today's:")))) {
+      $content[] = $node_title_list;
+    }
+
+    $alltimetop = variable_get('statistics_block_top_all_num', 0);
+    if ($alltimetop && ($result = statistics_title_list('totalcount', $alltimetop)) && ($node_title_list = node_title_list($result, t('All time:')))) {
+      $content[] = $node_title_list;
+    }
+
+    $lasttop = variable_get('statistics_block_top_last_num', 0);
+    if ($lasttop && ($result = statistics_title_list('timestamp', $lasttop)) && ($node_title_list = node_title_list($result, t('Last viewed:')))) {
+      $content[] = $node_title_list;
+    }
+
+    if (count($content)) {
+      $block['content'] = implode('<br />', $content);
+      $block['subject'] = t('Popular content');
+      return $block;
+    }
+  }
+}
+
Index: modules/statistics/statistics.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.info,v
retrieving revision 1.10
diff -u -p -r1.10 statistics.info
--- modules/statistics/statistics.info	19 Aug 2009 20:19:36 -0000	1.10
+++ modules/statistics/statistics.info	12 Nov 2009 22:36:13 -0000
@@ -10,3 +10,5 @@ files[] = statistics.pages.inc
 files[] = statistics.install
 files[] = statistics.test
 files[] = statistics.tokens.inc
+files[] = statistics.block.inc
+files[] = statistics.search.inc
Index: modules/statistics/statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v
retrieving revision 1.324
diff -u -p -r1.324 statistics.module
--- modules/statistics/statistics.module	8 Nov 2009 10:02:41 -0000	1.324
+++ modules/statistics/statistics.module	12 Nov 2009 22:36:13 -0000
@@ -294,69 +294,6 @@ function statistics_get($nid) {
 }
 
 /**
- * Implement hook_block_info().
- */
-function statistics_block_info() {
-  if (variable_get('statistics_count_content_views', 0)) {
-    $blocks['popular']['info'] = t('Popular content');
-    // Too dynamic to cache.
-    $blocks['popular']['cache'] = DRUPAL_NO_CACHE;
-    return $blocks;
-  }
-}
-
-/**
- * Implement hook_block_configure().
- */
-function statistics_block_configure($delta = '') {
-  // Popular content block settings
-  $numbers = array('0' => t('Disabled')) + drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 40));
-  $form['statistics_block_top_day_num'] = array('#type' => 'select', '#title' => t("Number of day's top views to display"), '#default_value' => variable_get('statistics_block_top_day_num', 0), '#options' => $numbers, '#description' => t('How many content items to display in "day" list.'));
-  $form['statistics_block_top_all_num'] = array('#type' => 'select', '#title' => t('Number of all time views to display'), '#default_value' => variable_get('statistics_block_top_all_num', 0), '#options' => $numbers, '#description' => t('How many content items to display in "all time" list.'));
-  $form['statistics_block_top_last_num'] = array('#type' => 'select', '#title' => t('Number of most recent views to display'), '#default_value' => variable_get('statistics_block_top_last_num', 0), '#options' => $numbers, '#description' => t('How many content items to display in "recently viewed" list.'));
-  return $form;
-}
-
-/**
- * Implement hook_block_save().
- */
-function statistics_block_save($delta = '', $edit = array()) {
-  variable_set('statistics_block_top_day_num', $edit['statistics_block_top_day_num']);
-  variable_set('statistics_block_top_all_num', $edit['statistics_block_top_all_num']);
-  variable_set('statistics_block_top_last_num', $edit['statistics_block_top_last_num']);
-}
-
-/**
- * Implement hook_block_view().
- */
-function statistics_block_view($delta = '') {
-  if (user_access('access content')) {
-    $content = array();
-
-    $daytop = variable_get('statistics_block_top_day_num', 0);
-    if ($daytop && ($result = statistics_title_list('daycount', $daytop)) && ($node_title_list = node_title_list($result, t("Today's:")))) {
-      $content[] = $node_title_list;
-    }
-
-    $alltimetop = variable_get('statistics_block_top_all_num', 0);
-    if ($alltimetop && ($result = statistics_title_list('totalcount', $alltimetop)) && ($node_title_list = node_title_list($result, t('All time:')))) {
-      $content[] = $node_title_list;
-    }
-
-    $lasttop = variable_get('statistics_block_top_last_num', 0);
-    if ($lasttop && ($result = statistics_title_list('timestamp', $lasttop)) && ($node_title_list = node_title_list($result, t('Last viewed:')))) {
-      $content[] = $node_title_list;
-    }
-
-    if (count($content)) {
-      $block['content'] = implode('<br />', $content);
-      $block['subject'] = t('Popular content');
-      return $block;
-    }
-  }
-}
-
-/**
  * It is possible to adjust the width of columns generated by the
  * statistics module.
  */
@@ -383,31 +320,3 @@ function statistics_node_delete($node) {
     ->execute();
 }
 
-/**
- * Implement hook_ranking().
- */
-function statistics_ranking() {
-  if (variable_get('statistics_count_content_views', 0)) {
-    return array(
-      'views' => array(
-        'title' => t('Number of views'),
-        'join' => array(
-          'type' => 'LEFT',
-          'table' => 'node_counter',
-          'alias' => 'node_counter',
-          'on' => 'node_counter.nid = i.sid',
-        ),
-        // Inverse law that maps the highest view count on the site to 1 and 0 to 0.
-        'score' => '2.0 - 2.0 / (1.0 + node_counter.totalcount * CAST(:scale AS DECIMAL))',
-        'arguments' => array(':scale' => variable_get('node_cron_views_scale', 0)),
-      ),
-    );
-  }
-}
-
-/**
- * Implement hook_update_index().
- */
-function statistics_update_index() {
-  variable_set('node_cron_views_scale', 1.0 / max(1, db_query('SELECT MAX(totalcount) FROM {node_counter}')->fetchField()));
-}
Index: modules/statistics/statistics.search.inc
===================================================================
RCS file: modules/statistics/statistics.search.inc
diff -N modules/statistics/statistics.search.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/statistics/statistics.search.inc	12 Nov 2009 22:36:13 -0000
@@ -0,0 +1,36 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Search hooks for Statistics module.
+ */
+
+/**
+ * Implement hook_update_index().
+ */
+function statistics_update_index() {
+  variable_set('node_cron_views_scale', 1.0 / max(1, db_query('SELECT MAX(totalcount) FROM {node_counter}')->fetchField()));
+}
+/**
+ * Implement hook_ranking().
+ */
+function statistics_ranking() {
+  if (variable_get('statistics_count_content_views', 0)) {
+    return array(
+      'views' => array(
+        'title' => t('Number of views'),
+        'join' => array(
+          'type' => 'LEFT',
+          'table' => 'node_counter',
+          'alias' => 'node_counter',
+          'on' => 'node_counter.nid = i.sid',
+        ),
+        // Inverse law that maps the highest view count on the site to 1 and 0 to 0.
+        'score' => '2.0 - 2.0 / (1.0 + node_counter.totalcount * CAST(:scale AS DECIMAL))',
+        'arguments' => array(':scale' => variable_get('node_cron_views_scale', 0)),
+      ),
+    );
+  }
+}
+
Index: modules/system/system.block.inc
===================================================================
RCS file: modules/system/system.block.inc
diff -N modules/system/system.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/system/system.block.inc	12 Nov 2009 22:36:03 -0000
@@ -0,0 +1,69 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for System module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function system_block_info() {
+  $blocks['main'] = array(
+    'info' => t('Main page content'),
+     // Cached elsewhere.
+    'cache' => DRUPAL_NO_CACHE,
+  );
+  $blocks['powered-by'] = array(
+    'info' => t('Powered by Drupal'),
+    'weight' => '10',
+    'cache' => DRUPAL_NO_CACHE,
+  );
+  $blocks['help'] = array(
+    'info' => t('System help'),
+    'weight' => '5',
+  );
+  // System-defined menu blocks.
+  foreach (menu_list_system_menus() as $menu_name => $title) {
+    $blocks[$menu_name]['info'] = t($title);
+    // Menu blocks can't be cached because each menu item can have
+    // a custom access callback. menu.inc manages its own caching.
+    $blocks[$menu_name]['cache'] = DRUPAL_NO_CACHE;
+  }
+  return $blocks;
+}
+
+/**
+ * Implement hook_block_view().
+ *
+ * Generate a block with a promotional link to Drupal.org and
+ * all system menu blocks.
+ */
+function system_block_view($delta = '') {
+  $block = array();
+  switch ($delta) {
+    case 'main':
+      $block['subject'] = NULL;
+      $block['content'] = drupal_set_page_content();
+      return $block;
+    case 'powered-by':
+      $block['subject'] = NULL;
+      $block['content'] = theme('system_powered_by');
+      return $block;
+    case 'help':
+      $block['subject'] = NULL;
+      $block['content'] = menu_get_active_help();
+      return $block;
+    default:
+      // All system menu blocks.
+      $system_menus = menu_list_system_menus();
+      if (isset($system_menus[$delta])) {
+        $block['subject'] = t($system_menus[$delta]);
+        $block['content'] = menu_tree($delta);
+        return $block;
+      }
+      break;
+  }
+}
+
Index: modules/system/system.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.info,v
retrieving revision 1.18
diff -u -p -r1.18 system.info
--- modules/system/system.info	15 Oct 2009 21:19:31 -0000	1.18
+++ modules/system/system.info	12 Nov 2009 22:36:03 -0000
@@ -16,3 +16,4 @@ files[] = system.tokens.inc
 files[] = system.updater.inc
 files[] = mail.sending.inc
 required = TRUE
+files[] = system.block.inc
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.840
diff -u -p -r1.840 system.module
--- modules/system/system.module	11 Nov 2009 17:14:59 -0000	1.840
+++ modules/system/system.module	12 Nov 2009 22:36:03 -0000
@@ -1803,67 +1803,6 @@ function system_user_timezone(&$form, &$
 }
 
 /**
- * Implement hook_block_info().
- */
-function system_block_info() {
-  $blocks['main'] = array(
-    'info' => t('Main page content'),
-     // Cached elsewhere.
-    'cache' => DRUPAL_NO_CACHE,
-  );
-  $blocks['powered-by'] = array(
-    'info' => t('Powered by Drupal'),
-    'weight' => '10',
-    'cache' => DRUPAL_NO_CACHE,
-  );
-  $blocks['help'] = array(
-    'info' => t('System help'),
-    'weight' => '5',
-  );
-  // System-defined menu blocks.
-  foreach (menu_list_system_menus() as $menu_name => $title) {
-    $blocks[$menu_name]['info'] = t($title);
-    // Menu blocks can't be cached because each menu item can have
-    // a custom access callback. menu.inc manages its own caching.
-    $blocks[$menu_name]['cache'] = DRUPAL_NO_CACHE;
-  }
-  return $blocks;
-}
-
-/**
- * Implement hook_block_view().
- *
- * Generate a block with a promotional link to Drupal.org and
- * all system menu blocks.
- */
-function system_block_view($delta = '') {
-  $block = array();
-  switch ($delta) {
-    case 'main':
-      $block['subject'] = NULL;
-      $block['content'] = drupal_set_page_content();
-      return $block;
-    case 'powered-by':
-      $block['subject'] = NULL;
-      $block['content'] = theme('system_powered_by');
-      return $block;
-    case 'help':
-      $block['subject'] = NULL;
-      $block['content'] = menu_get_active_help();
-      return $block;
-    default:
-      // All system menu blocks.
-      $system_menus = menu_list_system_menus();
-      if (isset($system_menus[$delta])) {
-        $block['subject'] = t($system_menus[$delta]);
-        $block['content'] = menu_tree($delta);
-        return $block;
-      }
-      break;
-  }
-}
-
-/**
  * Provide a single block on the administration overview page.
  *
  * @param $item
Index: modules/taxonomy/taxonomy.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.info,v
retrieving revision 1.10
diff -u -p -r1.10 taxonomy.info
--- modules/taxonomy/taxonomy.info	19 Aug 2009 20:19:37 -0000	1.10
+++ modules/taxonomy/taxonomy.info	12 Nov 2009 22:36:00 -0000
@@ -10,3 +10,4 @@ files[] = taxonomy.pages.inc
 files[] = taxonomy.install
 files[] = taxonomy.test
 files[] = taxonomy.tokens.inc
+files[] = taxonomy.taxonomy.inc
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.537
diff -u -p -r1.537 taxonomy.module
--- modules/taxonomy/taxonomy.module	11 Nov 2009 17:10:49 -0000	1.537
+++ modules/taxonomy/taxonomy.module	12 Nov 2009 22:36:00 -0000
@@ -7,6 +7,21 @@
  */
 
 /**
+ * Implements hook_hook_info().
+ */
+function taxonomy_hook_info() {
+  $hooks['taxonomy_vocabulary_insert'] = array('group' => 'taxonomy');
+  $hooks['taxonomy_vocabulary_load'] = array('group' => 'taxonomy');
+  $hooks['taxonomy_vocabulary_update'] = array('group' => 'taxonomy');
+  $hooks['taxonomy_vocabulary_delete'] = array('group' => 'taxonomy');
+  $hooks['taxonomy_term_insert'] = array('group' => 'taxonomy');
+  $hooks['taxonomy_term_load'] = array('group' => 'taxonomy');
+  $hooks['taxonomy_term_update'] = array('group' => 'taxonomy');
+  $hooks['taxonomy_term_delete'] = array('group' => 'taxonomy');
+  return $hooks;
+}
+
+/**
  * Implement hook_permission().
  */
 function taxonomy_permission() {
@@ -1432,15 +1447,5 @@ function taxonomy_node_delete($node) {
 }
 
 /**
- * Implement hook_taxonomy_term_delete().
- */
-function taxonomy_taxonomy_term_delete($term) {
-  if (variable_get('taxonomy_maintain_index_table', TRUE)) {
-    // Clean up the {taxonomy_index} table when terms are deleted.
-    db_delete('taxonomy_index')->condition('tid', $term->tid)->execute();
-  }
-}
-
-/**
  * @} End of "defgroup taxonomy indexing"
  */
Index: modules/taxonomy/taxonomy.taxonomy.inc
===================================================================
RCS file: modules/taxonomy/taxonomy.taxonomy.inc
diff -N modules/taxonomy/taxonomy.taxonomy.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/taxonomy/taxonomy.taxonomy.inc	12 Nov 2009 22:36:00 -0000
@@ -0,0 +1,18 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Taxonomy hooks for Taxonomy module.
+ */
+
+/**
+ * Implement hook_taxonomy_term_delete().
+ */
+function taxonomy_taxonomy_term_delete($term) {
+  if (variable_get('taxonomy_maintain_index_table', TRUE)) {
+    // Clean up the {taxonomy_index} table when terms are deleted.
+    db_delete('taxonomy_index')->condition('tid', $term->tid)->execute();
+  }
+}
+
Index: modules/tracker/tracker.comment.inc
===================================================================
RCS file: modules/tracker/tracker.comment.inc
diff -N modules/tracker/tracker.comment.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/tracker/tracker.comment.inc	12 Nov 2009 22:35:58 -0000
@@ -0,0 +1,47 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Comment hooks for Tracker module.
+ */
+
+/**
+ * Implement hook_comment_update().
+ *
+ * Comment module doesn't call hook_comment_unpublish() when saving individual
+ * comments so we need to check for those here.
+ */
+function tracker_comment_update($comment) {
+  $comment = (array) $comment;
+  // comment_save() calls hook_comment_publish() for all published comments
+  // so we to handle all other values here.
+  if ($comment['status'] != COMMENT_PUBLISHED) {
+    _tracker_remove($comment['nid'], $comment['uid'], $comment['timestamp']);
+  }
+}
+
+/**
+ * Implement hook_comment_delete().
+ */
+function tracker_comment_delete($comment) {
+  _tracker_remove($comment->nid, $comment->uid, $comment->changed);
+}
+
+/**
+ * Implement hook_comment_publish().
+ *
+ * This actually handles the insert and update of published nodes since
+ * comment_save() calls hook_comment_publish() for all published comments.
+ */
+function tracker_comment_publish($comment) {
+  _tracker_add($comment->nid, $comment->uid, $comment->changed);
+}
+
+/**
+ * Implement hook_comment_unpublish().
+ */
+function tracker_comment_unpublish($comment) {
+  _tracker_remove($comment->nid, $comment->uid, $comment->changed);
+}
+
Index: modules/tracker/tracker.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/tracker/tracker.info,v
retrieving revision 1.9
diff -u -p -r1.9 tracker.info
--- modules/tracker/tracker.info	8 Jun 2009 09:23:54 -0000	1.9
+++ modules/tracker/tracker.info	12 Nov 2009 22:35:58 -0000
@@ -8,3 +8,4 @@ core = 7.x
 files[] = tracker.module
 files[] = tracker.pages.inc
 files[] = tracker.test
+files[] = tracker.comment.inc
Index: modules/tracker/tracker.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/tracker/tracker.module,v
retrieving revision 1.167
diff -u -p -r1.167 tracker.module
--- modules/tracker/tracker.module	8 Nov 2009 10:02:41 -0000	1.167
+++ modules/tracker/tracker.module	12 Nov 2009 22:35:58 -0000
@@ -177,45 +177,6 @@ function tracker_node_delete($node, $arg
 }
 
 /**
- * Implement hook_comment_update().
- *
- * Comment module doesn't call hook_comment_unpublish() when saving individual
- * comments so we need to check for those here.
- */
-function tracker_comment_update($comment) {
-  $comment = (array) $comment;
-  // comment_save() calls hook_comment_publish() for all published comments
-  // so we to handle all other values here.
-  if ($comment['status'] != COMMENT_PUBLISHED) {
-    _tracker_remove($comment['nid'], $comment['uid'], $comment['timestamp']);
-  }
-}
-
-/**
- * Implement hook_comment_publish().
- *
- * This actually handles the insert and update of published nodes since
- * comment_save() calls hook_comment_publish() for all published comments.
- */
-function tracker_comment_publish($comment) {
-  _tracker_add($comment->nid, $comment->uid, $comment->changed);
-}
-
-/**
- * Implement hook_comment_unpublish().
- */
-function tracker_comment_unpublish($comment) {
-  _tracker_remove($comment->nid, $comment->uid, $comment->changed);
-}
-
-/**
- * Implement hook_comment_delete().
- */
-function tracker_comment_delete($comment) {
-  _tracker_remove($comment->nid, $comment->uid, $comment->changed);
-}
-
-/**
  * Update indexing tables when a node is added, updated or commented on.
  *
  * @param $nid
Index: modules/trigger/trigger.comment.inc
===================================================================
RCS file: modules/trigger/trigger.comment.inc
diff -N modules/trigger/trigger.comment.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/trigger/trigger.comment.inc	12 Nov 2009 22:35:55 -0000
@@ -0,0 +1,43 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Comment hooks for Trigger module.
+ */
+
+/**
+ * Implement hook_comment_presave().
+ */
+function trigger_comment_presave($comment) {
+  _trigger_comment($comment, 'comment_presave');
+}
+
+/**
+ * Implement hook_comment_insert().
+ */
+function trigger_comment_insert($comment) {
+  _trigger_comment($comment, 'comment_insert');
+}
+
+/**
+ * Implement hook_comment_update().
+ */
+function trigger_comment_update($comment) {
+  _trigger_comment($comment, 'comment_update');
+}
+
+/**
+ * Implement hook_comment_delete().
+ */
+function trigger_comment_delete($comment) {
+  _trigger_comment($comment, 'comment_delete');
+}
+
+/**
+ * Implement hook_comment_view().
+ */
+function trigger_comment_view($comment) {
+  _trigger_comment($comment, 'comment_view');
+}
+
Index: modules/trigger/trigger.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.info,v
retrieving revision 1.6
diff -u -p -r1.6 trigger.info
--- modules/trigger/trigger.info	8 Jun 2009 09:23:54 -0000	1.6
+++ modules/trigger/trigger.info	12 Nov 2009 22:35:55 -0000
@@ -8,3 +8,5 @@ files[] = trigger.module
 files[] = trigger.admin.inc
 files[] = trigger.install
 files[] = trigger.test
+files[] = trigger.comment.inc
+files[] = trigger.taxonomy.inc
Index: modules/trigger/trigger.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v
retrieving revision 1.54
diff -u -p -r1.54 trigger.module
--- modules/trigger/trigger.module	8 Nov 2009 10:02:41 -0000	1.54
+++ modules/trigger/trigger.module	12 Nov 2009 22:35:55 -0000
@@ -352,41 +352,6 @@ function _trigger_normalize_comment_cont
 }
 
 /**
- * Implement hook_comment_presave().
- */
-function trigger_comment_presave($comment) {
-  _trigger_comment($comment, 'comment_presave');
-}
-
-/**
- * Implement hook_comment_insert().
- */
-function trigger_comment_insert($comment) {
-  _trigger_comment($comment, 'comment_insert');
-}
-
-/**
- * Implement hook_comment_update().
- */
-function trigger_comment_update($comment) {
-  _trigger_comment($comment, 'comment_update');
-}
-
-/**
- * Implement hook_comment_delete().
- */
-function trigger_comment_delete($comment) {
-  _trigger_comment($comment, 'comment_delete');
-}
-
-/**
- * Implement hook_comment_view().
- */
-function trigger_comment_view($comment) {
-  _trigger_comment($comment, 'comment_view');
-}
-
-/**
  * Calls action functions for comment triggers.
  *
  * @param $a1
@@ -568,27 +533,6 @@ function _trigger_taxonomy($hook, $array
 }
 
 /**
- * Implement hook_taxonomy_term_insert().
- */
-function trigger_taxonomy_term_insert($term) {
-  _trigger_taxonomy('taxonomy_term_insert', (array) $term);
-}
-
-/**
- * Implement hook_taxonomy_term_update().
- */
-function trigger_taxonomy_term_update($term) {
-  _trigger_taxonomy('taxonomy_term_update', (array) $term);
-}
-
-/**
- * Implement hook_taxonomy_term_delete().
- */
-function trigger_taxonomy_term_delete($term) {
-  _trigger_taxonomy('taxonomy_term_delete', (array) $term);
-}
-
-/**
  * Implement hook_actions_delete().
  *
  * Removes all trigger entries for the given action, when an action is deleted.
Index: modules/trigger/trigger.taxonomy.inc
===================================================================
RCS file: modules/trigger/trigger.taxonomy.inc
diff -N modules/trigger/trigger.taxonomy.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/trigger/trigger.taxonomy.inc	12 Nov 2009 22:35:55 -0000
@@ -0,0 +1,29 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Taxonomy hooks for Trigger module.
+ */
+
+/**
+ * Implement hook_taxonomy_term_insert().
+ */
+function trigger_taxonomy_term_insert($term) {
+  _trigger_taxonomy('taxonomy_term_insert', (array) $term);
+}
+
+/**
+ * Implement hook_taxonomy_term_update().
+ */
+function trigger_taxonomy_term_update($term) {
+  _trigger_taxonomy('taxonomy_term_update', (array) $term);
+}
+
+/**
+ * Implement hook_taxonomy_term_delete().
+ */
+function trigger_taxonomy_term_delete($term) {
+  _trigger_taxonomy('taxonomy_term_delete', (array) $term);
+}
+
Index: modules/user/user.block.inc
===================================================================
RCS file: modules/user/user.block.inc
diff -N modules/user/user.block.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/user/user.block.inc	12 Nov 2009 22:35:45 -0000
@@ -0,0 +1,122 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Block hooks for User module.
+ */
+
+/**
+ * Implement hook_block_info().
+ */
+function user_block_info() {
+  global $user;
+
+  $blocks['login']['info'] = t('User login');
+  // Not worth caching.
+  $blocks['login']['cache'] = DRUPAL_NO_CACHE;
+
+  $blocks['new']['info'] = t('Who\'s new');
+
+  // Too dynamic to cache.
+  $blocks['online']['info'] = t('Who\'s online');
+  $blocks['online']['cache'] = DRUPAL_NO_CACHE;
+  return $blocks;
+}
+
+/**
+ * Implement hook_block_configure().
+ */
+function user_block_configure($delta = '') {
+  global $user;
+
+  switch ($delta) {
+    case 'new':
+      $form['user_block_whois_new_count'] = array(
+        '#type' => 'select',
+        '#title' => t('Number of users to display'),
+        '#default_value' => variable_get('user_block_whois_new_count', 5),
+        '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)),
+      );
+      return $form;
+
+    case 'online':
+      $period = drupal_map_assoc(array(30, 60, 120, 180, 300, 600, 900, 1800, 2700, 3600, 5400, 7200, 10800, 21600, 43200, 86400), 'format_interval');
+      $form['user_block_seconds_online'] = array('#type' => 'select', '#title' => t('User activity'), '#default_value' => variable_get('user_block_seconds_online', 900), '#options' => $period, '#description' => t('A user is considered online for this long after they have last viewed a page.'));
+      $form['user_block_max_list_count'] = array('#type' => 'select', '#title' => t('User list length'), '#default_value' => variable_get('user_block_max_list_count', 10), '#options' => drupal_map_assoc(array(0, 5, 10, 15, 20, 25, 30, 40, 50, 75, 100)), '#description' => t('Maximum number of currently online users to display.'));
+      return $form;
+  }
+}
+
+/**
+ * Implement hook_block_save().
+ */
+function user_block_save($delta = '', $edit = array()) {
+  global $user;
+
+  switch ($delta) {
+    case 'new':
+      variable_set('user_block_whois_new_count', $edit['user_block_whois_new_count']);
+      break;
+
+    case 'online':
+      variable_set('user_block_seconds_online', $edit['user_block_seconds_online']);
+      variable_set('user_block_max_list_count', $edit['user_block_max_list_count']);
+      break;
+  }
+}
+
+/**
+ * Implement hook_block_view().
+ */
+function user_block_view($delta = '') {
+  global $user;
+
+  $block = array();
+
+  switch ($delta) {
+    case 'login':
+      // For usability's sake, avoid showing two login forms on one page.
+      if (!$user->uid && !(arg(0) == 'user' && !is_numeric(arg(1)))) {
+
+        $block['subject'] = t('User login');
+        $block['content'] = drupal_get_form('user_login_block');
+      }
+      return $block;
+
+    case 'new':
+      if (user_access('access content')) {
+        // Retrieve a list of new users who have subsequently accessed the site successfully.
+        $items = db_query_range('SELECT uid, name FROM {users} WHERE status <> 0 AND access <> 0 ORDER BY created DESC', 0, variable_get('user_block_whois_new_count', 5))->fetchAll();
+        $output = theme('user_list', array('users' => $items));
+
+        $block['subject'] = t('Who\'s new');
+        $block['content'] = $output;
+      }
+      return $block;
+
+    case 'online':
+      if (user_access('access content')) {
+        // Count users active within the defined period.
+        $interval = REQUEST_TIME - variable_get('user_block_seconds_online', 900);
+
+        // Perform database queries to gather online user lists. We use s.timestamp
+        // rather than u.access because it is much faster.
+        $authenticated_count = db_query("SELECT COUNT(DISTINCT s.uid) FROM {sessions} s WHERE s.timestamp >= :timestamp AND s.uid > 0", array(':timestamp' => $interval))->fetchField();
+
+        $output = format_plural($authenticated_count, 'There is currently 1 user online.', 'There are currently @count users online.');
+
+        // Display a list of currently online users.
+        $max_users = variable_get('user_block_max_list_count', 10);
+        if ($authenticated_count && $max_users) {
+          $items = db_query_range('SELECT u.uid, u.name, MAX(s.timestamp) AS max_timestamp FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= :interval AND s.uid > 0 GROUP BY u.uid, u.name ORDER BY max_timestamp DESC', 0, $max_users, array(':interval' => $interval))->fetchAll();
+          $output .= theme('user_list', array('users' => $items));
+        }
+
+        $block['subject'] = t('Who\'s online');
+        $block['content'] = $output;
+      }
+      return $block;
+  }
+}
+
Index: modules/user/user.comment.inc
===================================================================
RCS file: modules/user/user.comment.inc
diff -N modules/user/user.comment.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/user/user.comment.inc	12 Nov 2009 22:35:47 -0000
@@ -0,0 +1,20 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Comment hooks for User module.
+ */
+
+/**
+ * Implement hook_comment_view().
+ */
+function user_comment_view($comment) {
+  if (variable_get('user_signatures', 0) && !empty($comment->signature)) {
+    $comment->signature = check_markup($comment->signature, $comment->format, '', TRUE);
+  }
+  else {
+    $comment->signature = '';
+  }
+}
+
Index: modules/user/user.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.info,v
retrieving revision 1.12
diff -u -p -r1.12 user.info
--- modules/user/user.info	19 Aug 2009 20:19:37 -0000	1.12
+++ modules/user/user.info	12 Nov 2009 22:35:50 -0000
@@ -11,3 +11,6 @@ files[] = user.install
 files[] = user.test
 files[] = user.tokens.inc
 required = TRUE
+files[] = user.block.inc
+files[] = user.comment.inc
+files[] = user.search.inc
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1078
diff -u -p -r1.1078 user.module
--- modules/user/user.module	12 Nov 2009 07:00:48 -0000	1.1078
+++ modules/user/user.module	12 Nov 2009 22:35:50 -0000
@@ -778,49 +778,6 @@ function user_file_delete($file) {
 }
 
 /**
- * Implement hook_search_info().
- */
-function user_search_info() {
-  return array(
-    'title' => 'Users',
-  );
-}
-
-/**
- * Implement hook_search_access().
- */
-function user_search_access() {
-  return user_access('access user profiles');
-}
-
-/**
- * Implement hook_search_execute().
- */
-function user_search_execute($keys = NULL) {
-  $find = array();
-  // Replace wildcards with MySQL/PostgreSQL wildcards.
-  $keys = preg_replace('!\*+!', '%', $keys);
-  $query = db_select('users')->extend('PagerDefault');
-  $query->fields('users', array('name', 'uid', 'mail'));
-  if (user_access('administer users')) {
-    // Administrators can also search in the otherwise private email field.
-    $query->condition(db_or()->
-      where('LOWER(name) LIKE LOWER(:name)', array(':name' => "%$keys%"))->
-      where('LOWER(mail) LIKE LOWER(:mail)', array(':mail' => "%$keys%")));
-  }
-  else {
-    $query->where('LOWER(name) LIKE LOWER(:name)', array(':name' => "%$keys%"));
-  }
-  $result = $query
-    ->limit(15)
-    ->execute();
-  foreach ($result as $account) {
-    $find[] = array('title' => $account->name . ' (' . $account->mail . ')', 'link' => url('user/' . $account->uid, array('absolute' => TRUE)));
-  }
-  return $find;
-}
-
-/**
  * Implement hook_element_info().
  */
 function user_element_info() {
@@ -1106,120 +1063,6 @@ function user_login_block($form) {
 }
 
 /**
- * Implement hook_block_info().
- */
-function user_block_info() {
-  global $user;
-
-  $blocks['login']['info'] = t('User login');
-  // Not worth caching.
-  $blocks['login']['cache'] = DRUPAL_NO_CACHE;
-
-  $blocks['new']['info'] = t('Who\'s new');
-
-  // Too dynamic to cache.
-  $blocks['online']['info'] = t('Who\'s online');
-  $blocks['online']['cache'] = DRUPAL_NO_CACHE;
-  return $blocks;
-}
-
-/**
- * Implement hook_block_configure().
- */
-function user_block_configure($delta = '') {
-  global $user;
-
-  switch ($delta) {
-    case 'new':
-      $form['user_block_whois_new_count'] = array(
-        '#type' => 'select',
-        '#title' => t('Number of users to display'),
-        '#default_value' => variable_get('user_block_whois_new_count', 5),
-        '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)),
-      );
-      return $form;
-
-    case 'online':
-      $period = drupal_map_assoc(array(30, 60, 120, 180, 300, 600, 900, 1800, 2700, 3600, 5400, 7200, 10800, 21600, 43200, 86400), 'format_interval');
-      $form['user_block_seconds_online'] = array('#type' => 'select', '#title' => t('User activity'), '#default_value' => variable_get('user_block_seconds_online', 900), '#options' => $period, '#description' => t('A user is considered online for this long after they have last viewed a page.'));
-      $form['user_block_max_list_count'] = array('#type' => 'select', '#title' => t('User list length'), '#default_value' => variable_get('user_block_max_list_count', 10), '#options' => drupal_map_assoc(array(0, 5, 10, 15, 20, 25, 30, 40, 50, 75, 100)), '#description' => t('Maximum number of currently online users to display.'));
-      return $form;
-  }
-}
-
-/**
- * Implement hook_block_save().
- */
-function user_block_save($delta = '', $edit = array()) {
-  global $user;
-
-  switch ($delta) {
-    case 'new':
-      variable_set('user_block_whois_new_count', $edit['user_block_whois_new_count']);
-      break;
-
-    case 'online':
-      variable_set('user_block_seconds_online', $edit['user_block_seconds_online']);
-      variable_set('user_block_max_list_count', $edit['user_block_max_list_count']);
-      break;
-  }
-}
-
-/**
- * Implement hook_block_view().
- */
-function user_block_view($delta = '') {
-  global $user;
-
-  $block = array();
-
-  switch ($delta) {
-    case 'login':
-      // For usability's sake, avoid showing two login forms on one page.
-      if (!$user->uid && !(arg(0) == 'user' && !is_numeric(arg(1)))) {
-
-        $block['subject'] = t('User login');
-        $block['content'] = drupal_get_form('user_login_block');
-      }
-      return $block;
-
-    case 'new':
-      if (user_access('access content')) {
-        // Retrieve a list of new users who have subsequently accessed the site successfully.
-        $items = db_query_range('SELECT uid, name FROM {users} WHERE status <> 0 AND access <> 0 ORDER BY created DESC', 0, variable_get('user_block_whois_new_count', 5))->fetchAll();
-        $output = theme('user_list', array('users' => $items));
-
-        $block['subject'] = t('Who\'s new');
-        $block['content'] = $output;
-      }
-      return $block;
-
-    case 'online':
-      if (user_access('access content')) {
-        // Count users active within the defined period.
-        $interval = REQUEST_TIME - variable_get('user_block_seconds_online', 900);
-
-        // Perform database queries to gather online user lists. We use s.timestamp
-        // rather than u.access because it is much faster.
-        $authenticated_count = db_query("SELECT COUNT(DISTINCT s.uid) FROM {sessions} s WHERE s.timestamp >= :timestamp AND s.uid > 0", array(':timestamp' => $interval))->fetchField();
-
-        $output = format_plural($authenticated_count, 'There is currently 1 user online.', 'There are currently @count users online.');
-
-        // Display a list of currently online users.
-        $max_users = variable_get('user_block_max_list_count', 10);
-        if ($authenticated_count && $max_users) {
-          $items = db_query_range('SELECT u.uid, u.name, MAX(s.timestamp) AS max_timestamp FROM {users} u INNER JOIN {sessions} s ON u.uid = s.uid WHERE s.timestamp >= :interval AND s.uid > 0 GROUP BY u.uid, u.name ORDER BY max_timestamp DESC', 0, $max_users, array(':interval' => $interval))->fetchAll();
-          $output .= theme('user_list', array('users' => $items));
-        }
-
-        $block['subject'] = t('Who\'s online');
-        $block['content'] = $output;
-      }
-      return $block;
-  }
-}
-
-/**
  * Process variables for user-picture.tpl.php.
  *
  * The $variables array contains the following arguments:
@@ -2854,18 +2697,6 @@ function user_forms() {
 }
 
 /**
- * Implement hook_comment_view().
- */
-function user_comment_view($comment) {
-  if (variable_get('user_signatures', 0) && !empty($comment->signature)) {
-    $comment->signature = check_markup($comment->signature, $comment->format, '', TRUE);
-  }
-  else {
-    $comment->signature = '';
-  }
-}
-
-/**
  * Theme output of user signature.
  *
  * @ingroup themeable
Index: modules/user/user.search.inc
===================================================================
RCS file: modules/user/user.search.inc
diff -N modules/user/user.search.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/user/user.search.inc	12 Nov 2009 22:35:50 -0000
@@ -0,0 +1,51 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Search hooks for User module.
+ */
+
+/**
+ * Implement hook_search_info().
+ */
+function user_search_info() {
+  return array(
+    'title' => 'Users',
+  );
+}
+
+/**
+ * Implement hook_search_access().
+ */
+function user_search_access() {
+  return user_access('access user profiles');
+}
+
+/**
+ * Implement hook_search_execute().
+ */
+function user_search_execute($keys = NULL) {
+  $find = array();
+  // Replace wildcards with MySQL/PostgreSQL wildcards.
+  $keys = preg_replace('!\*+!', '%', $keys);
+  $query = db_select('users')->extend('PagerDefault');
+  $query->fields('users', array('name', 'uid', 'mail'));
+  if (user_access('administer users')) {
+    // Administrators can also search in the otherwise private email field.
+    $query->condition(db_or()->
+      where('LOWER(name) LIKE LOWER(:name)', array(':name' => "%$keys%"))->
+      where('LOWER(mail) LIKE LOWER(:mail)', array(':mail' => "%$keys%")));
+  }
+  else {
+    $query->where('LOWER(name) LIKE LOWER(:name)', array(':name' => "%$keys%"));
+  }
+  $result = $query
+    ->limit(15)
+    ->execute();
+  foreach ($result as $account) {
+    $find[] = array('title' => $account->name . ' (' . $account->mail . ')', 'link' => url('user/' . $account->uid, array('absolute' => TRUE)));
+  }
+  return $find;
+}
+
