You are here

function workflow_get_states in Workflow 5

Same name and namespace in other branches
  1. 5.2 workflow.module \workflow_get_states()
  2. 6.2 workflow.module \workflow_get_states()
  3. 6 workflow.module \workflow_get_states()

Load workflow states for a workflow from the database.

Parameters

$wid: The ID of the workflow.

Return value

An array of workflow states keyed by state ID.

12 calls to workflow_get_states()
theme_workflow_edit_form in ./workflow.module
workflow_access_form_alter in ./workflow_access.module
Implementation of hook_form_alter().
workflow_actions_page in ./workflow.module
workflow_field_choices in ./workflow.module
Get the states one can move to for a given node.
workflow_form_alter in ./workflow.module
Generate a forms API compliant workflow field.

... See full list

File

./workflow.module, line 1554

Code

function workflow_get_states($wid) {
  $states = array();
  $result = db_query("SELECT sid, state FROM {workflow_states} WHERE wid = %d ORDER BY weight, state", intval($wid));
  while ($data = db_fetch_object($result)) {
    $states[$data->sid] = $data->state;
  }
  return $states;
}