You are here

function state_flow_events in State Machine 6

Same name and namespace in other branches
  1. 7.3 modules/state_flow/state_flow.pages.inc \state_flow_events()
  2. 7 modules/state_flow/state_flow.pages.inc \state_flow_events()
  3. 7.2 modules/state_flow/state_flow.pages.inc \state_flow_events()

Show the states as a node tab

Parameters

object $node:

Return value

array

1 string reference to 'state_flow_events'
state_flow_menu in modules/state_flow/state_flow.module
Implementation of hook_menu().

File

modules/state_flow/state_flow.module, line 81
A base implementation of the state machine class and its relationship to revisions

Code

function state_flow_events($node) {
  $states = state_flow_get_history($node->nid);
  $state_flow = state_flow_load_state_machine($node);
  drupal_set_title('Events');
  $events = $state_flow
    ->get_available_events();
  $output = !empty($events) ? drupal_get_form('state_flow_events_form', $state_flow) : t('No events to fire');
  $output .= theme('state_flow_states', $states);
  return $output;
}