? .cache
? .project
? .settings
? CHANGELOGGER.txt
? comment_publish.patch
? sites/default/files
? sites/default/settings.php
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.682
diff -u -p -w -r1.682 comment.module
--- modules/comment/comment.module	14 Jan 2009 21:48:24 -0000	1.682
+++ modules/comment/comment.module	16 Jan 2009 23:11:43 -0000
@@ -2100,7 +2100,15 @@ function comment_action_info() {
       'hooks' => array(
         'comment' => array('insert', 'update'),
       )
+    ),
+    'comment_publish_action' => array(
+      'description' => t('Publish comment'),
+      'type' => 'comment',
+      'configurable' => FALSE,
+      'hooks' => array(
+        'comment' => array('insert', 'update'),
     )
+    ),
   );
 }
 
@@ -2129,6 +2137,30 @@ function comment_unpublish_action($comme
 }
 
 /**
+ * Drupal action to publish a comment.
+ *
+ * @param $context
+ *   Keyed array. Must contain the id of the comment if $comment is not passed.
+ * @param $comment
+ *   An optional comment object.
+ */
+function comment_publish_action($comment, $context = array()) {
+  if (isset($comment->cid)) {
+    $cid = $comment->cid;
+    $subject = $comment->subject;
+  }
+  else {
+    $cid = $context['cid'];
+    $subject = db_query('SELECT subject FROM {comment} WHERE cid = :cid', array(':cid', $cid))->fetchField();
+  }
+  db_update('comment')
+    ->fields(array('status' => COMMENT_PUBLISHED,))
+    ->condition('cid', $cid)
+    ->execute();
+  watchdog('action', 'Published comment %subject.', array('%subject' => $subject));
+}
+
+/**
  * Form builder; Prepare a form for blacklisted keywords.
  *
  * @ingroup forms
