You are here

function state_flow_get_all_states in State Machine 7.3

Same name and namespace in other branches
  1. 7.2 modules/state_flow/state_flow.module \state_flow_get_all_states()

Get all of the states for all content types.

2 calls to state_flow_get_all_states()
state_flow_get_all_state_options in modules/state_flow/state_flow.module
Get all of the states for all content types as option list array.
state_flow_node_revision_filters in modules/state_flow/state_flow.module
Implements hook_node_revision_filters()

File

modules/state_flow/state_flow.module, line 418
An implementation of node revision workflow for Drupal based on the State Machine system.

Code

function state_flow_get_all_states() {
  static $states = array();
  if (empty($states)) {
    $i = 0;
    foreach (node_type_get_types() as $type_key => $type) {

      // Fake a node object.
      $node = new stdClass();
      $node->vid = $i;
      $i++;
      $node->type = $type_key;
      $machine = state_flow_entity_load_state_machine($node, 'node');
      $states += $machine
        ->get_states_options();
    }
  }
  return $states;
}