You are here

function workflow_get_workflow_options in Workflow 7

Get an options list for workflow states (to show in a widget). To be used in non-OO modules, like workflow_rules.

Parameters

$wid: The Workflow ID.

bool $grouped: Indicates if the value must be grouped per workflow. This influence the rendering of the select_list options.

Return value

An array of $sid => state->label(), grouped per Workfllow.

1 call to workflow_get_workflow_options()
_workflow_rules_workflow_get_options in workflow_rules/workflow_rules.rules.inc
Condition callback: gather all workflow states, to show in list_options.

File

./workflow.module, line 447
Support workflows made up of arbitrary states.

Code

function workflow_get_workflow_options($wid = 0, $grouped = FALSE) {
  $options = array();
  foreach (Workflow::getWorkflows($wid) as $workflow) {
    $options += $workflow
      ->getOptions($grouped);
  }
  return $options;
}