public function WorkflowItem::getAllowedValues in Workflow 7.2
Same name and namespace in other branches
- 7 includes/Field/WorkflowItem.php \WorkflowItem::getAllowedValues()
Helper function for list.module formatter.
Callback function for the list module formatter.
"The strings are not safe for output. Keys and values of the array should "be sanitized through field_filter_xss() before being displayed.
Return value
array The array of allowed values. Keys of the array are the raw stored values (number or text), values of the array are the display labels. It contains all possible values for the field, because the result is cached on a field basis, and used for all nodes on a page.
See also
list_allowed_values
File
- includes/
Field/ WorkflowItem.php, line 323 - Contains workflow\includes\Field\WorkflowItem.
Class
- WorkflowItem
- Plugin implementation of the 'workflow' field type.
Code
public function getAllowedValues() {
// Get all state names, including inactive states.
$wid = isset($this->field['settings']['wid']) ? $this->field['settings']['wid'] : 0;
$options = workflow_get_workflow_state_names($wid, $grouped = FALSE, $all = TRUE);
return $options;
}