You are here

function workbench_access_form_node_admin_content_alter in Workbench Access 7

Implements hook_form_FORM_ID_alter().

Helper function to nest the node operations form properly.

File

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

Code

function workbench_access_form_node_admin_content_alter(&$form, &$form_state) {
  if (empty($form['admin']['options']['operation']['#options'])) {
    return;
  }
  $options =& $form['admin']['options']['operation']['#options'];
  foreach ($form['admin']['options']['operation']['#options'] as $key => $value) {
    if ($key == 'workbench_access') {
      unset($options[$key]);
      $item = t('Set editorial section');
      $options[$item] = array();
    }
    if (substr($key, 0, 17) == 'workbench_access-') {
      unset($options[$key]);
      $options[$item][$key] = $value;
    }
  }
}