You are here

function workflow_access_form_alter in Workflow 7

Same name and namespace in other branches
  1. 5.2 workflow_access.module \workflow_access_form_alter()
  2. 5 workflow_access.module \workflow_access_form_alter()

Implements hook_form_alter().

Tell the Features module that we intend to provide one exportable component.

File

workflow_access/workflow_access.module, line 288
Provides node access permissions based on workflow states.

Code

function workflow_access_form_alter(&$form, &$form_state, $form_id) {
  switch ($form_id) {
    case 'workflow_admin_ui_types_form':
      $form['workflow_access'] = array(
        '#type' => 'fieldset',
        '#title' => t('Workflow Access'),
        '#collapsible' => TRUE,
        '#collapsed' => TRUE,
      );
      $form['workflow_access']['workflow_access_priority'] = array(
        '#type' => 'weight',
        '#delta' => 10,
        '#title' => t('Workflow Access Priority'),
        '#default_value' => variable_get('workflow_access_priority', 0),
        '#description' => t('This sets the node access priority. This can be dangerous. If there is any doubt,
          leave it at 0.') . ' ' . l(t('Read the manual.'), 'https://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook_node_access_records/7'),
      );
      $form['#submit'][] = 'workflow_access_priority_submit';
      return;
  }
}