Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.865
diff -u -F^f -p -r1.865 common.inc
--- includes/common.inc	9 Feb 2009 03:29:53 -0000	1.865
+++ includes/common.inc	12 Feb 2009 21:44:28 -0000
@@ -3570,9 +3570,6 @@ function drupal_common_theme() {
     'item_list' => array(
       'arguments' => array('items' => array(), 'title' => NULL, 'type' => 'ul', 'attributes' => NULL),
     ),
-    'list' => array(
-      'arguments' => array('elements' => NULL),
-    ),
     'more_help_link' => array(
       'arguments' => array('url' => NULL),
     ),
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.469
diff -u -F^f -p -r1.469 theme.inc
--- includes/theme.inc	5 Feb 2009 03:42:56 -0000	1.469
+++ includes/theme.inc	12 Feb 2009 21:44:29 -0000
@@ -625,6 +625,10 @@ function theme() {
   if (isset($info['function'])) {
     // The theme call is a function.
     if (drupal_function_exists($info['function'])) {
+      if (isset($args[0]) && is_array($args[0]) && isset($args[0]['#theme'])) {
+        // Prepare $args so that we pass a full set of arguments to the theme function.
+        $args = theme_prepare_function_arguments($info, $args);
+      }
       $output = call_user_func_array($info['function'], $args);
     }
   }
@@ -703,6 +707,45 @@ function theme() {
 }
 
 /**
+ * Prepare the arguments to a theme function when called from drupal_render().
+ * Copies #properties from the $elements array so they are passed as proper
+ * function parameters to the theme() function.
+ * 
+ * Example:
+ * @code
+ *   $elements['tracker] = array(
+ *     '#rows' => $rows,
+ *     '#header' => array(t('Type'), t('Post'), t('Author'), t('Replies'), t('Last updated')),
+ *     '#theme' => 'table',
+ *    );
+ * @endcode
+ * 
+ * Will be transformed into a theme call like:
+ * 
+ * @code
+ *   theme('table', array(t('Type'), t('Post'), t('Author'), t('Replies'), t('Last updated')), $rows);
+ * @endcode
+ *
+ * @param $info
+ *   An array of data about the theme hook.
+ * @param $args
+ *   An array of renderable elements.
+ */
+function theme_prepare_function_arguments($info, $args) {
+  $use_prepared = FALSE;
+  foreach ($info['arguments'] as $name => $default) {
+    if (isset($args[0]["#$name"])) {
+      $prepared[] =  $args[0]["#$name"];
+      $use_prepared = TRUE;
+    }
+    else {
+      $prepared[] = $default;
+    }
+  }
+  return $use_prepared ? $prepared : $args;
+}
+
+/**
  * Choose which template file to actually render. These are all suggested
  * templates from themes and modules. Theming implementations can occur on
  * multiple levels. All paths are checked to account for this.
@@ -1571,25 +1614,6 @@ function theme_item_list($items = array(
 }
 
 /**
- * Return a themed list of items from a drupal_render() style array.
- *
- * @param $elements
- *   An array consisting of the following keys:
- *   - #items: an array of items as expected by theme('item_list').
- *   - #title: a title which prints above the list.
- *   - #list_type: the type of list to return. Defaults to "ul".
- *   - #attributes: an array of attributes as expected by theme('item_list').
- * @return
- *   A string containing the list output.
- */
-function theme_list($elements) {
-  // Populate any missing array elements with their defaults.
-  $elements += element_info('list');
-
-  return theme('item_list', $elements['#items'], $elements['#title'], $elements['#list_type'], $elements['#attributes']);
-}
-
-/**
  * Returns code that emits the 'more help'-link.
  */
 function theme_more_help_link($url) {
Index: modules/blog/blog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.module,v
retrieving revision 1.316
diff -u -F^f -p -r1.316 blog.module
--- modules/blog/blog.module	31 Dec 2008 12:02:21 -0000	1.316
+++ modules/blog/blog.module	12 Feb 2009 21:44:29 -0000
@@ -105,8 +105,9 @@ function blog_nodeapi_view($node, $tease
         'attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => $node->name))),
       );
       $node->content['links']['blog'] = array(
-        '#type' => 'node_links',
-        '#value' => $links,
+        '#theme' => 'links',
+        '#links' => $links,
+        '#attributes' => array('class' => 'links inline'),
       );
     }
   }
Index: modules/blog/blog.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.pages.inc,v
retrieving revision 1.15
diff -u -F^f -p -r1.15 blog.pages.inc
--- modules/blog/blog.pages.inc	27 Jan 2009 00:22:25 -0000	1.15
+++ modules/blog/blog.pages.inc	12 Feb 2009 21:44:29 -0000
@@ -25,7 +25,7 @@ function blog_page_user($account) {
 
   $build['blog_actions'] = array(
     '#items' => $items,
-    '#theme' => 'list',
+    '#theme' => 'item_list',
     '#weight' => -1,
   );
 
@@ -62,7 +62,7 @@ function blog_page_last() {
     $items[] = l(t('Create new blog entry.'), "node/add/blog");
     $build['blog_actions'] = array(
       '#items' => $items,
-      '#theme' => 'list',
+      '#theme' => 'item_list',
       '#weight' => -1,
     );
   }
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.485
diff -u -F^f -p -r1.485 book.module
--- modules/book/book.module	26 Jan 2009 14:08:42 -0000	1.485
+++ modules/book/book.module	12 Feb 2009 21:44:29 -0000
@@ -89,8 +89,9 @@ function book_nodeapi_view_link($node, $
 
   if (!empty($links)) {
     $node->content['links']['book'] = array(
-      '#type' => 'node_links',
-      '#value' => $links,
+      '#theme' => 'links',
+      '#links' => $links,
+      'attributes' => array('class' => 'links inline'),
     );
   }
 }
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.692
diff -u -F^f -p -r1.692 comment.module
--- modules/comment/comment.module	7 Feb 2009 20:10:40 -0000	1.692
+++ modules/comment/comment.module	12 Feb 2009 21:44:29 -0000
@@ -484,8 +484,9 @@ function comment_nodeapi_view($node, $te
     }
 
     $node->content['links']['comment'] = array(
-      '#type' => 'node_links',
-      '#value' => $links,
+      '#theme' => 'links',
+      '#links' => $links,
+      '#attributes' => array('class' => 'links inline'),
     );
 
     // Append the list of comments to $node->content for node detail pages.
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1023
diff -u -F^f -p -r1.1023 node.module
--- modules/node/node.module	6 Feb 2009 16:25:08 -0000	1.1023
+++ modules/node/node.module	12 Feb 2009 21:44:29 -0000
@@ -138,9 +138,6 @@ function node_theme() {
     'node_admin_overview' => array(
       'arguments' => array('name' => NULL, 'type' => NULL),
     ),
-    'node_links' => array(
-      'arguments' => array('element' => NULL),
-    ),
   );
 }
 
@@ -3133,27 +3130,3 @@ function node_list_permissions($type) {
 
   return $perms;
 }
-
-/**
- * Implementation of hook_elements().
- */
-function node_elements() {
-  $type['node_links'] = array('#theme' => 'node_links');
-
-  return $type;
-}
-
-/**
- * Format a set of node links.
- *
- * @param $element
- *   An associative array containing the properties of the element.
- *   Properties used:  value
- * @return
- *   A themed HTML string representing the links.
- *
- * @ingroup themeable
- */
-function theme_node_links($element) {
-  return theme('links', $element['#value'],  array('class' => 'links inline'));
-}
Index: modules/statistics/statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v
retrieving revision 1.296
diff -u -F^f -p -r1.296 statistics.module
--- modules/statistics/statistics.module	26 Jan 2009 14:08:43 -0000	1.296
+++ modules/statistics/statistics.module	12 Feb 2009 21:44:29 -0000
@@ -113,8 +113,9 @@ function statistics_nodeapi_view($node, 
   }
 
   $node->content['links']['statistics'] = array(
-    '#type' => 'node_links',
-    '#value' => $links,
+    '#theme' => 'links',
+    '#links' => $links,
+    '#attributes' => array('class' => 'links inline'),
   );
 }
 
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.461
diff -u -F^f -p -r1.461 taxonomy.module
--- modules/taxonomy/taxonomy.module	11 Feb 2009 03:53:36 -0000	1.461
+++ modules/taxonomy/taxonomy.module	12 Feb 2009 21:44:30 -0000
@@ -72,9 +72,10 @@ function taxonomy_nodeapi_view($node) {
   }
   
   $node->content['links']['terms'] = array(
-    '#type' => 'node_links',
-    '#value' => $links,
+    '#theme' => 'links',
+    '#links' => $links,
     '#sorted' => TRUE,
+    '#attributes' => array('class' => 'links inline'),
   );
 }
 
Index: modules/tracker/tracker.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/tracker/tracker.css,v
retrieving revision 1.1
diff -u -F^f -p -r1.1 tracker.css
--- modules/tracker/tracker.css	14 Aug 2006 07:14:50 -0000	1.1
+++ modules/tracker/tracker.css	12 Feb 2009 21:44:30 -0000
@@ -1,8 +1,8 @@
 /* $Id: tracker.css,v 1.1 2006/08/14 07:14:50 drumm Exp $ */
 
-#tracker td.replies {
+.page-tracker td.replies {
   text-align: center;
 }
-#tracker table {
+.page-tracker table {
   width: 100%;
 }
Index: modules/tracker/tracker.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/tracker/tracker.pages.inc,v
retrieving revision 1.14
diff -u -F^f -p -r1.14 tracker.pages.inc
--- modules/tracker/tracker.pages.inc	30 Dec 2008 16:43:19 -0000	1.14
+++ modules/tracker/tracker.pages.inc	12 Feb 2009 21:44:30 -0000
@@ -62,12 +62,16 @@ function tracker_page($account = NULL, $
     $rows[] = array(array('data' => t('No posts available.'), 'colspan' => '5'));
   }
 
-  $header = array(t('Type'), t('Post'), t('Author'), t('Replies'), t('Last updated'));
+  $page['tracker'] = array(
+    '#rows' => $rows,
+    '#header' => array(t('Type'), t('Post'), t('Author'), t('Replies'), t('Last updated')),
+    '#theme' => 'table',
+  );
+  $page['pager'] = array(
+    '#markup' => theme('pager', NULL, 25, 0),
+    '#weight' => 10,
+  );
+  $page['#sorted'] = TRUE;
 
-  $output = '<div id="tracker">';
-  $output .= theme('table', $header, $rows);
-  $output .= theme('pager', NULL, 25, 0);
-  $output .= '</div>';
-
-  return $output;
+  return drupal_get_page($page);
 }
Index: modules/translation/translation.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/translation/translation.module,v
retrieving revision 1.38
diff -u -F^f -p -r1.38 translation.module
--- modules/translation/translation.module	22 Jan 2009 03:11:54 -0000	1.38
+++ modules/translation/translation.module	12 Feb 2009 21:44:30 -0000
@@ -181,8 +181,9 @@ function translation_nodeapi_view(&$node
           'attributes' => array('title' => $translations[$langcode]->title, 'class' => 'translation-link')
         );
         $node->content['links']['translation'] = array(
-          '#type' => 'node_links',
-          '#value' => $links,
+          '#theme' => 'links',
+          '#links' => $links,
+          '#attributes' => array('class' => 'links inline'),
         );
       }
     }
Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.227
diff -u -F^f -p -r1.227 upload.module
--- modules/upload/upload.module	3 Feb 2009 18:55:32 -0000	1.227
+++ modules/upload/upload.module	12 Feb 2009 21:44:30 -0000
@@ -77,8 +77,9 @@ function upload_nodeapi_links($node, $te
         'fragment' => 'attachments'
       );
       $node->content['links']['upload_attachments'] = array(
-        '#type' => 'node_links',
-        '#value' => $links,
+        '#theme' => 'links',
+        '#links' => $links,
+        'attributes' => array('class' => 'links inline'),
       );
     }
   }
