? diff-d7.patch
Index: diff.engine.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/diff/diff.engine.inc,v
retrieving revision 1.1
diff -u -p -r1.1 diff.engine.inc
--- diff.engine.inc	2 Sep 2008 18:36:44 -0000	1.1
+++ diff.engine.inc	22 Feb 2010 10:45:49 -0000
@@ -701,7 +701,7 @@ class Diff {
     }
 
     $lcs = $this->lcs();
-    trigger_error('Diff okay: LCS = '. $lcs, E_USER_NOTICE);
+    trigger_error('Diff okay: LCS = ' . $lcs, E_USER_NOTICE);
   }
 }
 
@@ -849,6 +849,7 @@ class DiffFormatter {
     if (is_array($block)) {
       $this->_block($x0, $xi - $x0, $y0, $yi - $y0, $block);
     }
+
     $end = $this->_end_diff();
     return $end;
   }
@@ -953,7 +954,7 @@ class _HWLDF_WordAccumulator {
   function _flushGroup($new_tag) {
     if ($this->_group !== '') {
       if ($this->_tag == 'mark') {
-        $this->_line .= '<span class="diffchange">'. check_plain($this->_group) .'</span>';
+        $this->_line .= '<span class="diffchange">' . check_plain($this->_group) . '</span>';
       }
       else {
         $this->_line .= check_plain($this->_group);
@@ -1100,11 +1101,11 @@ class DrupalDiffFormatter extends DiffFo
   function _block_header($xbeg, $xlen, $ybeg, $ylen) {
     return array(
       array(
-        'data' => theme('diff_header_line', $xbeg),
+        'data' => theme('diff_header_line', array('lineno' => $xbeg)),
         'colspan' => 2,
       ),
       array(
-        'data' => theme('diff_header_line', $ybeg),
+        'data' => theme('diff_header_line', array('lineno' => $ybeg)),
         'colspan' => 2,
       )
     );
@@ -1129,7 +1130,7 @@ class DrupalDiffFormatter extends DiffFo
     return array(
       '+',
       array(
-        'data' => theme('diff_content_line', $line),
+        'data' => theme('diff_content_line', array('line' => $line)),
         'class' => 'diff-addedline',
       )
     );
@@ -1142,7 +1143,7 @@ class DrupalDiffFormatter extends DiffFo
     return array(
       '-',
       array(
-        'data' => theme('diff_content_line', $line),
+        'data' => theme('diff_content_line', array('line' => $line)),
         'class' => 'diff-deletedline',
       )
     );
@@ -1155,7 +1156,7 @@ class DrupalDiffFormatter extends DiffFo
     return array(
       '&nbsp;',
       array(
-        'data' => theme('diff_content_line', $line),
+        'data' => theme('diff_content_line', array('line' => $line)),
         'class' => 'diff-context',
       )
     );
@@ -1164,7 +1165,7 @@ class DrupalDiffFormatter extends DiffFo
   function emptyLine() {
     return array(
       '&nbsp;',
-      theme('diff_empty_line', '&nbsp;'),
+      theme('diff_empty_line', array('line' => '&nbsp;')),
     );
   }
 
Index: diff.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/diff/diff.info,v
retrieving revision 1.4
diff -u -p -r1.4 diff.info
--- diff.info	2 Sep 2008 18:36:44 -0000	1.4
+++ diff.info	22 Feb 2010 10:45:49 -0000
@@ -4,4 +4,4 @@ description = Show difference between no
 package = Core - optional
 core = 7.x
 files[] = diff.module
-files[] = DiffEngine.php
\ No newline at end of file
+files[] = diff.engine.inc
\ No newline at end of file
Index: diff.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/diff/diff.module,v
retrieving revision 1.26
diff -u -p -r1.26 diff.module
--- diff.module	2 Sep 2008 18:36:44 -0000	1.26
+++ diff.module	22 Feb 2010 10:45:50 -0000
@@ -17,7 +17,11 @@ define('REVISION_LIST_SIZE', 50);
 function diff_help($path, $arg) {
   switch ($path) {
     case 'admin/help#diff':
-      $output = '<p>'. t('The diff module enables users to view the difference between two node revisions. You may disable this feature for individual content types on the content type configuration page. This module also provides a helpful %preview_changes button while editing a post.', array('%preview_changes' => t('Preview changes'), '%view_revisions' => t('view revisions'))) .'</p>';
+      $output = '<p>' . t('The diff module enables users to view the difference between two node revisions. You may disable this feature for individual content types on the content type configuration page. This module also provides a helpful %preview_changes button while editing a post.',
+        array('%preview_changes' => t('Preview changes'),
+          '%view_revisions' => t('view revisions'))
+        )
+        . '</p>';
       return $output;
   }
 }
@@ -51,7 +55,7 @@ function diff_latest($node) {
   $revisions = node_revision_list($node);
   $new = array_shift($revisions);
   $old = array_shift($revisions);
-  drupal_goto("node/$node->nid/revisions/view/$old->vid/$new->vid");
+  drupal_goto('node/' . $node->nid . '/revisions/view/' . $old->vid . '/' . $new->vid);
 }
 
 /**
@@ -69,7 +73,7 @@ function diff_menu_alter(&$callbacks) {
  * an input form to select two revisions for a comparison.
  */
 function diff_diffs_overview(&$node) {
-  drupal_set_title(t('Revisions for %title', array('%title' => $node->title)));
+  drupal_set_title(t('Revisions for !title', array('!title' => $node->title)));
   return drupal_get_form('diff_node_revisions', $node);
 }
 
@@ -79,7 +83,7 @@ function diff_diffs_overview(&$node) {
  * @param $node
  *   Node whose revisions are displayed for selection.
  */
-function diff_node_revisions($form_state, &$node) {
+function diff_node_revisions($form, $form_state, &$node) {
   $form = array();
 
   $form['nid'] = array(
@@ -121,16 +125,18 @@ function diff_node_revisions($form_state
       $form['info'][$revision->vid] = array(
         '#markup' => t('!date by !username', array(
           '!date' => l(format_date($revision->timestamp, 'small'), "node/$node->nid"), 
-          '!username' => theme('username', $revision)))
-        . (($revision->log != '') ? '<p class="revision-log">'. filter_xss($revision->log) .'</p>' : ''),
+          '!username' => theme('username', array(
+            'account' => $revision))))
+        . (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : ''),
       );
     }
     else {
       $form['info'][$revision->vid] = array(
         '#markup' => t('!date by !username', array(
           '!date' => l(format_date($revision->timestamp, 'small'), "node/$node->nid/revisions/$revision->vid/view"), 
-          '!username' => theme('username', $revision)))
-        . (($revision->log != '') ? '<p class="revision-log">'. filter_xss($revision->log) .'</p>' : '')
+          '!username' => theme('username', array(
+            'account' => $revision))))
+        . (($revision->log != '') ? '<p class="revision-log">' . filter_xss($revision->log) . '</p>' : '')
       );
       if ($revert_permission) {
         $operations[] = array('#markup' => l(t('revert'), "node/$node->nid/revisions/$revision->vid/revert"));
@@ -162,9 +168,10 @@ function diff_node_revisions($form_state
   $form['submit'] = array('#type' => 'submit', '#value' => t('Show diff'));
 
   if (count($revision_list) > REVISION_LIST_SIZE) {
-    $form['#suffix'] = theme('pager', NULL, REVISION_LIST_SIZE, 0);
+    $form['#suffix'] = theme('pager', array(
+      'quantity' => REVISION_LIST_SIZE,
+      'element' => 0));
   }
-
   return $form;
 }
 
@@ -172,7 +179,8 @@ function diff_node_revisions($form_state
  * Theme function to display the revisions table with means to select
  * two revisions.
  */
-function theme_diff_node_revisions($form) {
+function theme_diff_node_revisions($variables) {
+  $form = $variables['form'];
   $output = '';
 
   // Overview table:
@@ -181,6 +189,7 @@ function theme_diff_node_revisions($form
     array('data' => drupal_render($form['submit']), 'colspan' => 2),
     array('data' => t('Operations'), 'colspan' => 2)
   );
+  $rows = array();
   if (isset($form['info']) && is_array($form['info'])) {
     foreach (element_children($form['info']) as $key) {
       $row = array();
@@ -196,19 +205,28 @@ function theme_diff_node_revisions($form
       }
       else {
         // its the current revision (no commands to revert or delete)
-        $row[] = array('data' => drupal_render($form['info'][$key]), 'class' => 'revision-current');
-        $row[] = array('data' => drupal_render($form['diff']['old'][$key]), 'class' => 'revision-current');
-        $row[] = array('data' => drupal_render($form['diff']['new'][$key]), 'class' => 'revision-current');
-        $row[] = array('data' => theme('placeholder', t('current revision')), 'class' => 'revision-current', 'colspan' => '2');
+        $row[] = array(
+          'data' => drupal_render($form['info'][$key]),
+          'class' => array('revision-current'));
+        $row[] = array(
+          'data' => drupal_render($form['diff']['old'][$key]),
+          'class' => array('revision-current'));
+        $row[] = array(
+          'data' => drupal_render($form['diff']['new'][$key]),
+          'class' => array('revision-current'));
+        $row[] = array(
+          'data' => drupal_placeholder(array('text' => t('current revision'))),
+          'class' => array('revision-current'),
+          'colspan' => '2');
         $rows[] = array(
           'data' => $row,
-          'class' => 'error',
+          'class' => array('error'),
         );
       }
     }
   }
-  $output .= theme('table', $header, $rows);
-  $output .= drupal_render($form);
+  $output .= theme('table', array('header' => $header, 'rows' => $rows));
+  $output .= drupal_render_children($form);
   return $output;
 }
 
@@ -219,7 +237,7 @@ function diff_node_revisions_submit($for
   // The ids are ordered so the old revision is always on the left.
   $old_vid = min($form_state['values']['old'], $form_state['values']['new']);
   $new_vid = max($form_state['values']['old'], $form_state['values']['new']);
-  $form_state['redirect'] =  'node/'. $form_state['values']['nid'] .'/revisions/view/'. $old_vid .'/'. $new_vid;
+  $form_state['redirect'] =  'node/' . $form_state['values']['nid'] . '/revisions/view/' . $old_vid . '/' . $new_vid;
 }
 
 /**
@@ -246,7 +264,7 @@ function diff_node_revisions_validate($f
 function diff_diffs_show(&$node, $old_vid, $new_vid) {
 
   // Set same title as on the 'Revisions' tab for consistency
-  drupal_set_title(t('Revisions for %title', array('%title' => $node->title)));
+  drupal_set_title(t('Revisions for !title', array('!title' => $node->title)));
 
   $node_revisions = node_revision_list($node);
 
@@ -256,27 +274,29 @@ function diff_diffs_show(&$node, $old_vi
   // Generate table header (date, username, logmessage).
   $old_header = t('!date by !username', array(
     '!date' => l(format_date($old_node->revision_timestamp), "node/$node->nid/revisions/$old_node->vid/view"), 
-    '!username' => theme('username', $node_revisions[$old_vid]),
+    '!username' => theme('username', array(
+      'account' => $node_revisions[$old_vid])),
   ));
   $new_header = t('!date by !username', array(
     '!date' => l(format_date($new_node->revision_timestamp), "node/$node->nid/revisions/$new_node->vid/view"), 
-    '!username' => theme('username', $node_revisions[$new_vid]),
+    '!username' => theme('username', array(
+      'account' => $node_revisions[$new_vid])),
   ));
 
-  $old_log = $old_node->log != '' ? '<p class="revision-log">'. filter_xss($old_node->log) .'</p>' : '';
-  $new_log = $new_node->log != '' ? '<p class="revision-log">'. filter_xss($new_node->log) .'</p>' : '';
+  $old_log = $old_node->log != '' ? '<p class="revision-log">' . filter_xss($old_node->log) . '</p>' : '';
+  $new_log = $new_node->log != '' ? '<p class="revision-log">' . filter_xss($new_node->log) . '</p>' : '';
 
   // Generate previous diff/next diff links.
   $next_vid = _diff_get_next_vid($node_revisions, $new_vid);
   if ($next_vid) {
-    $next_link = l(t('next diff >'), 'node/'. $node->nid .'/revisions/view/'. $new_vid .'/'. $next_vid);
+    $next_link = l(t('next diff >'), 'node/' . $node->nid . '/revisions/view/' . $new_vid . '/' . $next_vid);
   }
   else {
     $next_link = '';
   }
   $prev_vid = _diff_get_previous_vid($node_revisions, $old_vid);
   if ($prev_vid) {
-    $prev_link = l(t('< previous diff'), 'node/'. $node->nid .'/revisions/view/'. $prev_vid .'/'. $old_vid);
+    $prev_link = l(t('< previous diff'), 'node/' . $node->nid . '/revisions/view/' . $prev_vid . '/' . $old_vid);
   }
   else {
     $prev_link = '';
@@ -310,16 +330,20 @@ function diff_diffs_show(&$node, $old_vi
     )
   );
   $rows = array_merge($rows, _diff_body_rows($old_node, $new_node));
-  $output = theme('table', $header, $rows, array('class' => 'diff'), NULL, $cols);
+  $output = theme('table', array('header' => $header, 
+    'rows' => $rows,
+    'attributes' => array('class' => array('diff')),
+    'colgroups' => $cols));
 
   if ($node->vid == $new_vid) {
-    $output .= '<div class="diff-section-title">'. t('Current revision:') .'</div>';
+    $output .= '<div class="diff-section-title">' . t('Current revision:') . '</div>';
   }
   else {
-    $output .= '<div class="diff-section-title">'. t('Revision of !new_date:', array('!new_date' => format_date($new_node->revision_timestamp))) .'</div>';
+    $output .= '<div class="diff-section-title">' . t('Revision of !new_date:', array('!new_date' => format_date($new_node->revision_timestamp))) . '</div>';
   }
   // Don't include node links (final argument) when viewing the diff.
-  $output .= node_view($new_node, FALSE, FALSE, FALSE);
+  // $output .= node_view($new_node, FALSE, FALSE, FALSE);
+  $output .= drupal_render(node_view($new_node, 'full'));
   return $output;
 }
 
@@ -332,7 +356,8 @@ function diff_diffs_show(&$node, $old_vi
  *   Node for comparison which will be displayed on the right side.
  */
 function _diff_body_rows(&$old_node, &$new_node) {
-  drupal_add_css(drupal_get_path('module', 'diff') .'/diff.css', 'module', 'all', FALSE);
+  drupal_add_css(drupal_get_path('module', 'diff') . '/diff.css',
+      array('scope' => 'all', 'preprocess' => FALSE));
   module_load_include('inc', 'diff', 'diff.engine');
   include_once('node.inc');
   if (module_exists('taxonomy')) {
@@ -368,7 +393,7 @@ function _diff_body_rows(&$old_node, &$n
   if (!isset($node_diffs['#sorted'])) {
     uasort($node_diffs, "element_sort");
   }
-  
+
   foreach ($node_diffs as $node_diff) {
     $diff = new Diff($node_diff['#old'], $node_diff['#new']);
     $formatter = new DrupalDiffFormatter();
@@ -376,6 +401,7 @@ function _diff_body_rows(&$old_node, &$n
       $formatter->show_header = $node_diff['#format']['show_header'];
     }
     $diff_rows = $formatter->format($diff);
+
     if (count($diff_rows)) {
       $rows[] = array(
         array(
@@ -451,9 +477,9 @@ function _diff_get_previous_vid(&$node_r
  * Implementation of hook_form_alter().
  */
 function diff_form_alter(&$form, $form_state, $form_id) {
-  if (isset($form['type']['#value']) && $form['type']['#value'] .'_node_form' == $form_id) {
+  if (isset($form['type']['#value']) && $form['type']['#value'] . '_node_form' == $form_id) {
     // Add a 'Preview changes' button on the node edit form.
-    if (variable_get('show_preview_changes_'. $form['type']['#value'], TRUE) && $form['nid']['#value'] > 0) {
+    if (variable_get('show_preview_changes_' . $form['type']['#value'], TRUE) && $form['nid']['#value'] > 0) {
       $form['buttons']['preview_changes'] = array(
         '#type' => 'submit',
         '#value' => t('Preview changes'),
@@ -468,9 +494,9 @@ function diff_form_alter(&$form, $form_s
     $form['workflow']['show_preview_changes'] = array(
       '#type' => 'checkbox',
       '#title' => t('Show %preview_changes button on node edit form', array('%preview_changes' => t('Preview changes'))),
-      '#prefix' => '<strong>'. t('Preview changes') .'</strong>',
+      '#prefix' => '<strong>' . t('Preview changes') . '</strong>',
       '#weight' => 10,
-      '#default_value' => variable_get('show_preview_changes_'. $form['#node_type']->type, TRUE),
+      '#default_value' => variable_get('show_preview_changes_' . $form['#node_type']->type, TRUE),
     );
   }
 }
@@ -483,32 +509,245 @@ function diff_node_form_build_preview_ch
 
   // Create diff of old node and edited node
   $rows = _diff_body_rows(node_load($form_state['values']['nid']), $node);
+
   $cols = _diff_default_cols();
   $header = _diff_default_header();
-  $changes = theme('diff_table', $header, $rows, array('class' => 'diff'), NULL, $cols);
+  $changes = theme('diff_table', array(
+    'header' => $header,
+    'rows' => $rows,
+    'attributes' => array('class' => 'diff'),
+    'colgroups' => $cols));
   // Prepend diff to edit form
-  $form_state['node_preview'] = isset($form_state['node_preview']) ? $changes . $form_state['node_preview'] : $changes;
+  $form_state['node_preview'] = isset($form_state['node_preview']) 
+    ? $changes . $form_state['node_preview']
+    : $changes;
+}
+
+/**
+ * themes
+ */
+
+/**
+ * Return a themed table. This is a modified version of theme_table, adding
+ * colgroup tag and col tag options.
+ *
+ * @param $header
+ *   An array containing the table headers. Each element of the array can be
+ *   either a localized string or an associative array with the following keys:
+ *   - "data": The localized title of the table column.
+ *   - "field": The database field represented in the table column (required if
+ *     user is to be able to sort on this column).
+ *   - "sort": A default sort order for this column ("asc" or "desc").
+ *   - Any HTML attributes, such as "colspan", to apply to the column header cell.
+ * @param $rows
+ *   An array of table rows. Every row is an array of cells, or an associative
+ *   array with the following keys:
+ *   - "data": an array of cells
+ *   - Any HTML attributes, such as "class", to apply to the table row.
+ *
+ *   Each cell can be either a string or an associative array with the following keys:
+ *   - "data": The string to display in the table cell.
+ *   - "header": Indicates this cell is a header.
+ *   - Any HTML attributes, such as "colspan", to apply to the table cell.
+ *
+ *   Here's an example for $rows:
+ *   @verbatim
+ *   $rows = array(
+ *     // Simple row
+ *     array(
+ *       'Cell 1', 'Cell 2', 'Cell 3'
+ *     ),
+ *     // Row with attributes on the row and some of its cells.
+ *     array(
+ *       'data' => array('Cell 1', array('data' => 'Cell 2', 'colspan' => 2)), 'class' => 'funky'
+ *     )
+ *   );
+ *   @endverbatim
+ *
+ * @param $attributes
+ *   An array of HTML attributes to apply to the table tag.
+ * @param $caption
+ *   A localized string to use for the <caption> tag.
+ * @param $cols
+ *   An array of table colum groups. Every column group is an array of columns,
+ *   or an associative array with the following keys:
+ *   - "data": an array of cells
+ *   - Any HTML attributes, such as "class", to apply to the table column group.
+ *
+ *   Each column can be either an empty array or associative array with the following keys:
+ *   - Any HTML attributes, such as "class", to apply to the table column group.
+ *
+ *   Here's an example for $cols:
+ *   @verbatim
+ *   $cols = array(
+ *     // Simple colgroup.
+ *     array(),
+ *     // Simple colgroup with attributes.
+ *     array(
+ *       'data'  => array(), 'colspan' => 2, 'style' => 'color: green;',
+ *     ),
+ *     // Simple colgroup with one col.
+ *     array(
+ *       array(),
+ *     ),
+ *     // Colgroup with attributes on the colgroup and some of its cols.
+ *     array(
+ *       'data'  => array(array('class' => 'diff-marker'), array('colspan' => 2)), 'class' => 'funky',
+ *     ),
+ *   );
+ *   @endverbatim
+ *
+ *   The HTML will look as follows:
+ *   @verbatim
+ *   <table>
+ *     <!-- Simple colgroup. -->
+ *     <colgroup />
+ *
+ *     <!-- Simple colgroup with attributes. -->
+ *     <colgroup colspan="2" style="color: green;" />
+ *
+ *     <!-- Simple colgroup with one col. -->
+ *     <colgroup>
+ *       <col />
+ *     </colgroup>
+ *
+ *     <!-- Colgroup with attributes on the colgroup and some of its cols. -->
+ *     <colgroup class="funky">
+ *       <col class="diff-marker" />
+ *       <col colspan="2" />
+ *     </colgroup>
+ *     ...
+ *   </table>
+ *   @endverbatim
+ *
+ * @return
+ *   An HTML string representing the table.
+ */
+function theme_diff_table($variables) {
+  $header = $variables['header'];
+  $rows = $variables['rows'];
+  $attributes = isset($variables['attributes']) ? $variables['attributes'] : array();
+  $caption = isset($variables['caption']) ? $variables['caption'] : NULL;
+  $cols = isset($variables['cols']) ? $variables['cols'] : array();
+  
+  $output = '<table' . drupal_attributes($attributes) .">\n";
+
+  if (isset($caption)) {
+    $output .= '<caption>' . $caption ."</caption>\n";
+  }
+
+  // Format the table columns:
+  if (count($cols)) {
+    foreach ($cols as $number => $col) {
+      $attributes = array();
+
+      // Check if we're dealing with a simple or complex column
+      if (isset($col['data'])) {
+        foreach ($col as $key => $value) {
+          if ($key == 'data') {
+            $cells = $value;
+          }
+          else {
+            $attributes[$key] = $value;
+          }
+        }
+      }
+      else {
+        $cells = $col;
+      }
+
+      // Build colgroup
+      if (is_array($cells) && count($cells)) {
+        $output .= ' <colgroup' . drupal_attributes($attributes) . '>';
+        $i = 0;
+        foreach ($cells as $cell) {
+          $output .= ' <col' . drupal_attributes($cell) . ' />';
+        }
+        $output .= " </colgroup>\n";
+      }
+      else {
+        $output .= ' <colgroup' . drupal_attributes($attributes) ." />\n";
+      }
+    }
+  }
+
+  // Format the table header:
+  if (count($header)) {
+    $ts = tablesort_init($header);
+    $output .= ' <thead><tr>';
+    foreach ($header as $cell) {
+      $cell = tablesort_header($cell, $header, $ts);
+      $output .= _theme_table_cell($cell, TRUE);
+    }
+    $output .= " </tr></thead>\n";
+  }
+
+  // Format the table rows:
+  $output .= "<tbody>\n";
+  if (count($rows)) {
+    $flip = array('even' => 'odd', 'odd' => 'even');
+    $class = 'even';
+    foreach ($rows as $number => $row) {
+      $attributes = array();
+
+      // Check if we're dealing with a simple or complex row
+      if (isset($row['data'])) {
+        foreach ($row as $key => $value) {
+          if ($key == 'data') {
+            $cells = $value;
+          }
+          else {
+            $attributes[$key] = $value;
+          }
+        }
+      }
+      else {
+        $cells = $row;
+      }
+
+      // Add odd/even class
+      $class = $flip[$class];
+      if (isset($attributes['class'])) {
+        $attributes['class'] .= ' ' . $class;
+      }
+      else {
+        $attributes['class'] = $class;
+      }
+
+      // Build row
+      $output .= ' <tr' . drupal_attributes($attributes) . '>';
+      $i = 0;
+      foreach ($cells as $cell) {
+        $cell = tablesort_cell($cell, $header, $ts, $i++);
+        $output .= _theme_table_cell($cell);
+      }
+      $output .= " </tr>\n";
+    }
+  }
+
+  $output .= "</tbody></table>\n";
+  return $output;
 }
 
 /**
  * Theme function for a header line in the diff.
  */
-function theme_diff_header_line($lineno) {
-  return '<strong>'. t('Line %lineno', array('%lineno' => $lineno)) .'</strong>';
+function theme_diff_header_line($variables) {
+  return '<strong>' . t('Line %lineno', array('%lineno' => $variables['lineno'])) . '</strong>';
 }
 
 /**
  * Theme function for a content line in the diff.
  */
-function theme_diff_content_line($line) {
-  return '<div>'. $line .'</div>';
+function theme_diff_content_line($variables) {
+  return '<div>' . $variables['line'] . '</div>';
 }
 
 /**
  * Theme function for an empty line in the diff.
  */
-function theme_diff_empty_line($line) {
-  return $line;
+function theme_diff_empty_line($variables) {
+  return $variables['line'];
 }
 
 /**
@@ -516,17 +755,21 @@ function theme_diff_empty_line($line) {
  */
 function diff_theme() {
   return array(
+    'diff_table' => array(
+      'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => NULL,
+        'caption' => NULL, 'cols' => NULL),
+    ),
     'diff_node_revisions' => array(
-      'arguments' => array('form' => NULL),
+      'render element' => 'form',
     ),
     'diff_header_line' => array(
-      'arguments' => array('lineno' => NULL),
+      'variables' => array('lineno' => NULL),
     ),
     'diff_content_line' => array(
-      'arguments' => array('line' => NULL),
+      'variables' => array('line' => NULL),
     ),
     'diff_empty_line' => array(
-      'arguments' => array('line' => NULL),
+      'variables' => array('line' => NULL),
     ),
   );
 }
Index: node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/diff/node.inc,v
retrieving revision 1.5
diff -u -p -r1.5 node.inc
--- node.inc	2 Sep 2008 18:36:44 -0000	1.5
+++ node.inc	22 Feb 2010 10:45:50 -0000
@@ -5,9 +5,9 @@
  * Implementation of hook_diff() for node.module (body and title).
  */
 function node_diff(&$old_node, &$new_node) {
-  
+
   $result = array();
-  $type = node_get_types('type', $new_node);
+  $type = node_type_get_type($new_node);
   $result['title'] = array(
     '#name' => $type->title_label,
     '#old' => array($old_node->title),
@@ -20,8 +20,8 @@ function node_diff(&$old_node, &$new_nod
   if ($type->has_body) {
     $result['body'] = array(
       '#name' => $type->body_label,
-      '#old' => explode("\n", $old_node->body),
-      '#new' => explode("\n", $new_node->body),
+      '#old' => explode("\n", $old_node->body[$old_node->language][0]['value']),
+      '#new' => explode("\n", $new_node->body[$new_node->language][0]['value']),
     );
   }
   return $result;
