function state_flow_get_all_events in State Machine 7.2
Same name and namespace in other branches
- 7.3 modules/state_flow/state_flow.module \state_flow_get_all_events()
 
Get all of the events for all content types
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 381  - 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;
      $state_machine = state_flow_load_state_machine($node);
      if (!$state_machine
        ->ignore()) {
        foreach ($state_machine
          ->get_all_events() as $key => $value) {
          $events[$key] = $key;
        }
      }
    }
  }
  return $events;
}