? delete_cleanup_1.diff
? tab_log_list_1.diff
? tab_log_list_del_cleanup.diff
Index: modr8.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/modr8/modr8.module,v
retrieving revision 1.12
diff -u -p -r1.12 modr8.module
--- modr8.module	15 Jan 2007 00:28:16 -0000	1.12
+++ modr8.module	20 Jan 2007 15:11:34 -0000
@@ -50,7 +50,7 @@ function modr8_menu($may_cache) {
   elseif (arg(0) == 'node' && is_numeric($nid = arg(1))) {  
     $items[] = array(
       'path' => 'node/'. $nid .'/modr8', 
-      'title' => t('Moderation log'),
+      'title' => t('Moderation'),
       'callback' => 'modr8_log_view',
       'callback arguments' => array('node', $nid),
       'access' => user_access('moderate content') && db_result(db_query("SELECT COUNT(*) FROM {modr8_log} ml WHERE ml.nid = %d", $nid)),
@@ -138,14 +138,14 @@ function modr8_nodeapi(&$node, $op, $tea
         theme('modr8_message', FALSE, $node->type, $op);
       }
       break;
-    case 'submit':
+    case 'delete':
+      // Delete log entries when a node is deleted, unless it's deleted while
+      // in moderation.  In the latter case, we want to retain the log to see
+      // which moderator deleted the node  and any message they sent.
+      if (!$node->moderate) {
+        db_query("DELETE FROM {modr8_log} WHERE nid = %d", $node->nid);
+      }
       break;
-    //TODO- change this - probably not necessary or needs to be re-thought
-		// if not administrator, go BACK into moderation upon editing
-		  if (!user_access('administer nodes') && in_array('moderate', variable_get('node_options_'. $node->type, array()))){
-			  $node->moderate = TRUE;
-           theme('modr8_message', FALSE, $node->type, $op);
-		  }
   }
 }
 
Index: modr8_admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/modr8/modr8_admin.inc,v
retrieving revision 1.8
diff -u -p -r1.8 modr8_admin.inc
--- modr8_admin.inc	15 Jan 2007 00:28:16 -0000	1.8
+++ modr8_admin.inc	20 Jan 2007 15:11:34 -0000
@@ -362,14 +362,14 @@ function modr8_log_overview($nid = 0) {
 
   $header = array(
     array('data' => t('Action'), ),
+    array('data' => t('Moderator'), 'field' => 'u.name'),
     array('data' => t('Date'), 'field' => 'ml.modid', 'sort' => 'desc'),
-    array('data' => t('Author'),),
     array('data' => t('Title (view event)'),),
   );
   $tablesort = tablesort_sql($header);
 
   $count_sql = "SELECT COUNT(*) FROM {modr8_log} ml";  
-  $pager_sql = "SELECT ml.modid, ml.action, ml.title, ml.timestamp, u.name, u.uid FROM {modr8_log} ml LEFT JOIN {users} u ON u.uid = ml.author_uid";
+  $pager_sql = "SELECT ml.modid, ml.action, ml.title, ml.timestamp, u.name, u.uid FROM {modr8_log} ml LEFT JOIN {users} u ON u.uid = ml.uid";
   if ($nid) {
     $count_sql .= " WHERE ml.nid = %d";
     $pager_sql .= " WHERE ml.nid = %d";
@@ -381,7 +381,7 @@ function modr8_log_overview($nid = 0) {
   $rows = array();
   
   while ($event = db_fetch_object($result)) {
-    $rows[] = array(t($event->action),  format_date($event->timestamp, 'small'), theme('username', $event), 
+    $rows[] = array(t($event->action), theme('username', $event), format_date($event->timestamp, 'small'),
     l(truncate_utf8($event->title, 50, TRUE, TRUE), 'admin/logs/modr8/event/'. $event->modid, array(), NULL, NULL, FALSE, TRUE)
     );
   }
