You are here

function custom_pub_node_operations in Custom Publishing Options 7

Implements hook_node_operations().

Return value

array

File

./custom_pub.module, line 487
Adds the ability to add Custom publishing options to the node Add/Edit forms.

Code

function custom_pub_node_operations() {
  $types = custom_pub_types_list();
  $operations = array();
  foreach ($types as $machine_name => $name) {
    $operations[$machine_name] = array(
      'label' => t('Add "!name" status', array(
        '!name' => $name,
      )),
      'callback' => 'node_mass_update',
      'callback arguments' => array(
        'updates' => array(
          $machine_name => 1,
        ),
      ),
    );
    $operations['remove_' . $machine_name] = array(
      'label' => t('Remove "!type" status', array(
        '!type' => $name,
      )),
      'callback' => 'node_mass_update',
      'callback arguments' => array(
        'updates' => array(
          $machine_name => 0,
        ),
      ),
    );
  }
  return $operations;
}