Index: content_moderation.module
===================================================================
--- content_moderation.module	(revision 759)
+++ content_moderation.module	(working copy)
@@ -126,7 +126,8 @@
       'arguments' => array('node' => NULL,'links' => NULL, 'state' => t('none'), 'live' => NULL,'revisions_list' => ''),
     ),
     'content_moderation_node_history' => array(
-     'arguments' => array('history' => array()),
+      'template' => 'content_moderation_node_history',
+      'arguments' => array('history' => array()),
     ),
     'content_moderation_revisions_list' => array(
       'template' => 'content_moderation_revisions_list',
@@ -381,38 +382,34 @@
   }
 }
 
-/*
- * Implementation content_moderation_node_history
- * Theming the output of content moderations history table
+/**
+ * pre-process content moderation history data for tpl file
  */
-function theme_content_moderation_node_history($history) {
-  $data = array();
+function template_preprocess_content_moderation_node_history(&$variables) {
+  $variables['title'] = t('Moderation history');
+  
+  $variables['header'] = array(
+    t('Date'),
+    t('Author'),
+    t('Transition'),
+    t('Revision'),
+  );
+  
+  $rows = array();
+  foreach($variables['history'] as $e) {
+     $user = user_load($e->uid);
+     $state_class = "state_{$e->state_name}";
+     // TODO: proper localized date format
+    $rows[] = array (
+       format_date($e->stamp,'small'),                         // date
+       l($user->name,"user/{$user->uid}"),                     // Who changed that state?
+       "<span class='$state_class'>".ucfirst(t('!old',array('!old' => $e->old_state_name))).' -> '.ucfirst(t($e->state_name)).'</span>',             // Transition
+       l($e->vid,"node/{$e->nid}/revisions/{$e->vid}/view")   // revision
+     );
+   }
+  $variables['rows'] = $rows;
+ }
 
-  foreach($history as $e) {
-    $user = user_load($e->uid);
-    $state_class = "state_{$e->state_name}";
-    // TODO: proper localized date format
-    $data[] = array (
-      format_date($e->stamp,'small'),                         // date
-      l($user->name,"user/{$user->uid}"),                     // Who changed that state?
-      "<span class='$state_class'>".ucfirst(t('!old',array('!old' => $e->old_state_name))).' -> '.ucfirst(t($e->state_name)).'</span>',             // Transition
-      l($e->vid,"node/{$e->nid}/revisions/{$e->vid}/view"),   // revision
-      check_plain($e->comment), // comment
-    );
-  }
-  $title = t('Moderation history');
-  $title = "<h2>$title</h2>";
-  return $title.theme('table',
-                array(
-                      t('Date'),
-                      t('Author'),
-                      t('Transition'),
-                      t('Revision'),
-                      t('Comment'),
-                    )
-                ,$data);
-}
-
 /*
  * Needed by the views API
  */
Index: content_moderation_node_history.tpl.php
===================================================================
--- content_moderation_node_history.tpl.php	(revision 0)
+++ content_moderation_node_history.tpl.php	(revision 0)
@@ -0,0 +1,3 @@
+<h2><?php print $title; ?></h2>
+
+<?php print theme('table', $header, $rows); ?>
