/[drupal]/contributions/modules/revision_moderation/revision_moderation_actions.inc
ViewVC logotype

Contents of /contributions/modules/revision_moderation/revision_moderation_actions.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Tue Dec 18 03:14:40 2007 UTC (23 months, 1 week ago) by webchick
Branch: MAIN
CVS Tags: DRUPAL-6--1-0-ALPHA1, HEAD
Branch point for: DRUPAL-7--1, DRUPAL-6--1
Changes since 1.2: +35 -34 lines
File MIME type: text/x-php
#198587 by cwgordon7: Port to Drupal 6.x (GHOP)
1 <?php
2 // $Id$
3
4 /**
5 * @file
6 * Actions support for revision moderation module.
7 */
8
9 /**
10 * Implementation of hook_action_info.
11 */
12 function revision_moderation_action_info() {
13 $actions['revision_moderation_enable_action'] = array(
14 'type' => 'node',
15 'description' => t('Enable revision moderation on node'),
16 'configurable' => FALSE,
17 'hooks' => array(
18 'nodeapi' => array('presave', 'insert', 'update'),
19 'comment' => array('delete', 'insert', 'update')
20 ),
21 );
22 $actions['revision_moderation_disable_action'] = array(
23 'type' => 'node',
24 'description' => t('Disable revision moderation on node'),
25 'configurable' => FALSE,
26 'hooks' => array(
27 'nodeapi' => array('presave', 'insert', 'update'),
28 'comment' => array('delete', 'insert', 'update')
29 ),
30 );
31 return $actions;
32 }
33
34 /**
35 * Implementation of a Drupal action; enables revision moderation
36 * on a node.
37 */
38 function revision_moderation_enable_action(&$node, $context) {
39 $node->revision_moderation = 1;
40 // Also enable "Create new revisions" option, in case it isn't yet.
41 $node->revision = 1;
42 node_save($node);
43 }
44
45 /**
46 * Implementation of a Drupal action; disables revision moderation
47 * on a node.
48 */
49 function revision_moderation_disable_action(&$node, $context) {
50 $node->revision_moderation = 0;
51 node_save($node);
52 }

  ViewVC Help
Powered by ViewVC 1.1.2