You are here

function _workflow_rules_workflow_get_options in Workflow 7

Same name and namespace in other branches
  1. 7.2 workflow_rules/workflow_rules.rules-callback.inc \_workflow_rules_workflow_get_options()

Condition callback: gather all workflow states, to show in list_options.

4 string references to '_workflow_rules_workflow_get_options'
_workflow_rules_rules_field_action_info in workflow_rules/workflow_rules.field.inc
Implements subfunction of hook_rules_action_info().
_workflow_rules_rules_field_condition_info in workflow_rules/workflow_rules.field.inc
Implements subfunction of hook_rules_condition_info(). Using "node:" and "node:unchanged", there is no need to create more conditions to check transitions.
_workflow_rules_rules_node_action_info in workflow_rules/workflow_rules.node.inc
Implements subfunction of hook_rules_action_info().
_workflow_rules_rules_node_condition_info in workflow_rules/workflow_rules.node.inc
Implements subfunction of hook_rules_condition_info().

File

workflow_rules/workflow_rules.rules.inc, line 79
Rules integration for the Workflow module

Code

function _workflow_rules_workflow_get_options($data) {
  $wid = 0;

  // This is a poorman's effort to convert a token into a field name.
  $token = isset($data->settings['field:select']) ? $data->settings['field:select'] : '';
  $field_name = _workflow_rules_token_replace($token);
  $field = field_info_field($field_name);
  $wid = !empty($field) ? $field['settings']['wid'] : 0;
  $options['ANY'] = 'ANY state';
  $options += workflow_get_workflow_options($wid, $grouped = TRUE);
  return $options;
}