You are here

function workflow_state_ctools_settings in Workflow 7.2

Settings form for the 'workflow state' access plugin.

1 string reference to 'workflow_state_ctools_settings'
workflow_state.inc in workflow_node/plugins/access/workflow_state.inc
Describes a CTools Access plugin.

File

workflow_node/plugins/access/workflow_state.inc, line 51
Describes a CTools Access plugin.

Code

function workflow_state_ctools_settings($form, &$form_state, $conf) {
  $options = array();
  $workflows = workflow_get_workflows();
  foreach ($workflows as $workflow) {
    $options[$workflow->name] = array();
    $states = workflow_get_workflow_states_by_wid($workflow->wid);
    foreach ($states as $state) {
      $options[$workflow->name][$state->sid] = $state->state;
    }
  }
  $form['settings']['workflow_state'] = array(
    '#title' => t('Select workflow state'),
    '#type' => 'select',
    '#options' => $options,
    '#description' => t('The pane will only be visible for nodes that are in this workflow state.'),
    '#default_value' => $conf['workflow_state'],
  );
  return $form;
}