You are here

function workbench_access_node_operations in Workbench Access 7

Implements hook_node_operations().

File

./workbench_access.module, line 1923
Workbench Access module file.

Code

function workbench_access_node_operations($form = array(), $form_state = array()) {
  if (!user_access('batch update workbench access')) {
    return;
  }
  $active = workbench_access_get_active_tree();
  if (!$active) {
    return;
  }
  $tree = $active['tree'];
  workbench_access_build_tree($tree);
  $options = workbench_access_options($tree, $active['active']);
  if (empty($options)) {
    return;
  }
  $operations = array(
    'workbench_access' => array(
      'label' => t('Editorial section'),
    ),
  );
  foreach ($options as $key => $value) {
    $operations['workbench_access-' . $key] = array(
      'label' => $value,
      'callback' => 'workbench_access_mass_update',
      'callback arguments' => array(
        'access_id' => $key,
        'access_scheme' => $active['access_scheme'],
      ),
    );
  }
  return $operations;
}