You are here

function workflow_rules_check_state_form in Workflow 6

Same name and namespace in other branches
  1. 6.2 workflow_rules/workflow_rules.module \workflow_rules_check_state_form()

Configuration form for check state condition.

File

workflow_rules/workflow_rules.module, line 177
Rules integration for the Workflow module

Code

function workflow_rules_check_state_form($settings, &$form) {
  $options = array();
  $options['ANY'] = t('Any state');
  foreach (workflow_get_all() as $wid => $workflow) {
    $options[$workflow] = array();
    foreach (workflow_get_states($wid) as $sid => $state) {
      $options[$workflow][$sid] = $state;
    }
  }
  $form['settings']['state'] = array(
    '#type' => 'select',
    '#title' => t('State'),
    '#options' => $options,
    '#multiple' => TRUE,
    '#default_value' => isset($settings['state']) ? $settings['state'] : array(),
    '#required' => TRUE,
  );
}