Index: revision_moderation.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/revision_moderation/revision_moderation.module,v
retrieving revision 1.26.2.10
diff -u -r1.26.2.10 revision_moderation.module
--- revision_moderation.module	20 Feb 2007 15:55:17 -0000	1.26.2.10
+++ revision_moderation.module	20 Oct 2007 18:55:24 -0000
@@ -10,6 +10,10 @@
 if (module_exists('actions')) {
   include_once drupal_get_path('module', 'revision_moderation') .'/revision_moderation_actions.inc';
 }
+// Workflow-ng module support.
+if (module_exists('workflow_ng')) {
+  include_once drupal_get_path('module', 'revision_moderation') .'/revision_moderation_workflow_ng.inc';
+}
 
 /**
  * Implementation of hook_menu().
@@ -316,3 +320,41 @@
   watchdog('content', t('@type: published %title revision %revision', array('@type' => t($node->type), '%title' => $node->title, '%revision' => $vid)), WATCHDOG_NOTICE, l(t('view'), "node/$nid/revisions/$vid/view"));
   drupal_goto("node/$nid");
 }
+
+/**
+ * Implementation of hook_token_values()
+ */
+function revision_moderation_token_values($entity_type, $object = NULL) {
+  $values = array();
+  if ($entity_type == 'node') {
+    $values['revision_moderation'] = $object->revision_moderation ? t('on') : t('off');
+    $values['revision'] = $object->revision ? t('on') : t('off');
+  }
+  return $values;
+}
+
+/**
+ * Implementation of hook_token_list()
+ */
+function revision_moderation_token_list($entity_type = 'all') {
+  $tokens = array();
+  $tokens['node']['revision_moderation'] = t('Whether revision moderation is on. (@on/@off)', array('@on' => t('on'), '@off' => t('off')));
+  $tokens['node']['revision'] = t('Whether a new revision is to be created. (@on/@off)', array('@on' => t('on'), '@off' => t('off')));
+  return $tokens;
+}
+
+/**
+ * Enables revision moderation for a node
+ */
+function revision_moderation_enable_moderation(&$node) {
+  $node->revision_moderation = 1;
+  // Also enable "Create new revisions" option, in case it isn't yet.
+  $node->revision = 1;
+}
+
+/**
+ * Disables revision moderation for a node
+ */
+function revision_moderation_disable_moderation(&$node) {
+  $node->revision_moderation = 0;
+}
Index: revision_moderation_actions.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/revision_moderation/revision_moderation_actions.inc,v
retrieving revision 1.2
diff -u -r1.2 revision_moderation_actions.inc
--- revision_moderation_actions.inc	2 Nov 2006 04:37:49 -0000	1.2
+++ revision_moderation_actions.inc	20 Oct 2007 18:55:24 -0000
@@ -21,9 +21,7 @@
       );
       break;
     case 'do':
-      $node->revision_moderation = 1;
-      // Also enable "Create new revisions" option, in case it isn't yet.
-      $node->revision = 1;
+      revision_moderation_enable_moderation($node);
       node_save($node);
       break;
   }
@@ -44,7 +42,7 @@
       );
       break;
     case 'do':
-      $node->revision_moderation = 0;
+      revision_moderation_disable_moderation($node);
       node_save($node);
       break;
   }
Index: revision_moderation_workflow_ng.inc
===================================================================
RCS file: revision_moderation_workflow_ng.inc
diff -N revision_moderation_workflow_ng.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ revision_moderation_workflow_ng.inc	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,68 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Some workflow-ng actions for the revision moderation module.
+ */
+
+/**
+ * Implementation of hook_action_info()
+ */
+function revision_moderation_action_info() {
+  return array(
+    'revision_moderation_workflow_ng_enable' => array(
+      '#label' => t('Enable revision moderation for a content'),
+      '#arguments' => array(
+        'node' => array(
+          '#entity' => 'node',
+          '#label' => t('Content'),
+        ),
+      ),
+      '#module' => t('Revision Moderation'),
+    ),
+    'revision_moderation_workflow_ng_disable' => array(
+      '#label' => t('Disable revision moderation for a content'),
+      '#arguments' => array(
+        'node' => array(
+          '#entity' => 'node',
+          '#label' => t('Content'),
+        ),
+      ),
+      '#module' => t('Revision Moderation'),
+    ),
+    'revision_moderation_workflow_ng_publish' => array(
+      '#label' => t('Publish a content revision'),
+      '#arguments' => array(
+        'node' => array(
+          '#entity' => 'node',
+          '#label' => t('Content, which is to be published'),
+        ),
+      ),
+      '#module' => t('Revision Moderation'),
+    ),
+  );
+}
+
+/**
+ * Implementation of a worklfow-ng action: enables revision moderation
+ */
+function revision_moderation_workflow_ng_enable($node) {
+  revision_moderation_enable_moderation($node);
+  return array('node' => $node);
+}
+
+/**
+ * Implementation of a worklfow-ng action: disables revision moderation
+ */
+function revision_moderation_workflow_ng_disable($node) {
+  revision_moderation_disable_moderation($node);
+  return array('node' => $node);
+}
+
+/**
+ * Implementation of a worklfow-ng action: publishes a revision
+ */
+function revision_moderation_workflow_ng_publish($node) {
+  db_query("UPDATE {node} SET vid = %d WHERE nid = %d", $node->vid, $node->nid);
+}
