You are here

function state_flow_get_all_events 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_events()

Get all of the events for all content types.

@todo, this will not play well at all with having more than one workflow available.

1 call to state_flow_get_all_events()
state_flow_node_revision_operations in modules/state_flow/state_flow.module
Implements hook_node_revision_operations().

File

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

Code

function state_flow_get_all_events() {
  static $events = array();
  if (empty($events)) {
    $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');
      $events += array_keys($machine
        ->get_all_events());
    }
  }
  return $events;
}