content_helper_operations_node_operations

custom/content_helper/content_helper_operations/content_helper_operations.module, line 10

Versions
6
content_helper_operations_node_operations()

@file Add some useful node operations to Content Management page.

Operation include:

  • Set node's comment settings to Disabled, Read only, or Read/Write.

Code

<?php
function content_helper_operations_node_operations() {

  // Comment settings
  if (module_exists('comment')) {
    $operations['disablecomment'] = array(
      'label' => t('Set comments to Disabled'),
      'callback' => 'node_mass_update',
      'callback arguments' => array('updates' => array('comment' => COMMENT_NODE_DISABLED)),
    );
    $operations['readcomment'] = array(
      'label' => t('Set comments to Read only'),
      'callback' => 'node_mass_update',
      'callback arguments' => array('updates' => array('comment' => COMMENT_NODE_READ_ONLY)),
    );
    $operations['readwritecomment'] = array(
      'label' => t('Set comments to Read/Write'),
      'callback' => 'node_mass_update',
      'callback arguments' => array('updates' => array('comment' => COMMENT_NODE_READ_WRITE)),
    );
  }

  return $operations;
}
?>