You are here

function state_flow_state_flow_entity_plugins in State Machine 7.3

Implements hook_state_flow_entity_plugins().

File

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

Code

function state_flow_state_flow_entity_plugins() {
  $info = array();
  $workflow_options = array(
    'states' => array(
      'draft' => array(
        'label' => t('Draft'),
      ),
      'published' => array(
        'label' => t('Published'),
        'on_enter' => 'on_enter_published',
        'on_exit' => 'on_exit_published',
      ),
      'unpublished' => array(
        'label' => t('Unpublished'),
        'on_enter' => 'on_enter_unpublished',
      ),
    ),
    'events' => array(
      'keep in draft' => array(
        'label' => t('Keep in Draft'),
        'origin' => 'draft',
        'target' => 'draft',
      ),
      'publish' => array(
        'label' => t('Publish'),
        'origin' => array(
          'draft',
          'published',
        ),
        'target' => 'published',
      ),
      'unpublish' => array(
        'label' => t('Unpublish'),
        'origin' => array(
          'draft',
          'published',
        ),
        'target' => 'unpublished',
        'permission' => 'publish and unpublish content',
      ),
      'to draft' => array(
        'label' => t('To Draft'),
        'origin' => array(
          'unpublished',
          'published',
        ),
        'target' => 'draft',
      ),
    ),
  );
  $info['state_flow_node'] = array(
    'handler' => array(
      'class' => 'StateFlowNode',
      'file' => 'state_flow_node.inc',
      'path' => drupal_get_path('module', 'state_flow') . '/plugins',
      'parent' => 'state_flow_entity',
      'workflow_options' => $workflow_options,
      'entity_type' => 'node',
      'event_form_options' => array(),
    ),
  );
  return $info;
}