source: sipes/modules_contrib/revision_moderation/revision_moderation_actions.inc

stableversion-3.0
Last change on this file was 177a560, checked in by José Gregorio Puentes <jpuentes@…>, 8 años ago

se agrego el directorio de modulos contribuidos de drupal

  • Propiedad mode establecida a 100644
File size: 1.4 KB
Línea 
1<?php
2// $Id: revision_moderation_actions.inc,v 1.3 2007/12/18 03:14:40 webchick Exp $
3
4/**
5 * @file
6 * Actions support for revision moderation module.
7 */
8
9/**
10 * Implementation of hook_action_info.
11 */
12function 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 */
38function 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 */
49function revision_moderation_disable_action(&$node, $context) {
50  $node->revision_moderation = 0;
51  node_save($node);
52}
Nota: Vea TracBrowser para ayuda de uso del navegador del repositorio.