You are here

function state_flow_menu in State Machine 7.3

Same name and namespace in other branches
  1. 6 modules/state_flow/state_flow.module \state_flow_menu()
  2. 7 modules/state_flow/state_flow.module \state_flow_menu()
  3. 7.2 modules/state_flow/state_flow.module \state_flow_menu()

Implements hook_menu().

File

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

Code

function state_flow_menu() {
  $items = array();
  $items['node/%node/workflow'] = array(
    'title' => 'Workflow',
    'description' => 'Information about the workflow status of this content',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'state_flow_events',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'state_flow_menu_node_access',
    'access arguments' => array(
      1,
    ),
    'weight' => 10,
    'file' => 'state_flow.pages.inc',
  );

  // This item required to have a valid path scheme for entity_translation.
  $items['node/%node/revisions/%state_flow_revision_node'] = array(
    'title' => 'Revision ',
    'title callback' => 'state_flow_revision_menu_item_title_callback',
    'title arguments' => array(
      3,
    ),
    'load arguments' => array(
      3,
    ),
    'page callback' => 'node_show',
    'page arguments' => array(
      1,
      TRUE,
    ),
    'access callback' => '_node_revision_access',
    'access arguments' => array(
      1,
    ),
  );
  $items['node/%node/revisions/%state_flow_revision_node/edit'] = array(
    'title' => 'Edit revision',
    'type' => MENU_LOCAL_TASK,
    'load arguments' => array(
      3,
    ),
    'page callback' => 'node_page_edit',
    'page arguments' => array(
      1,
      TRUE,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'file' => 'node.pages.inc',
    'file path' => drupal_get_path('module', 'node'),
  );
  $items['node/%node/revisions/%state_flow_revision_node/workflow'] = array(
    'title' => 'Transition a revision to a new workflow state',
    'type' => MENU_CALLBACK,
    'load arguments' => array(
      3,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'state_flow_entity_events_revision',
      1,
      'node',
      5,
      array(),
    ),
    'access callback' => 'state_flow_events_revisions_access',
    'access arguments' => array(
      1,
      5,
    ),
    'file' => 'state_flow_entity.forms.inc',
    'file path' => drupal_get_path('module', 'state_flow_entity'),
  );
  $items['admin/content/content-revisions'] = array(
    'title' => 'Content Revisions',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'state_flow_content_page',
    ),
    'access arguments' => array(
      'administer content revisions',
    ),
    'type' => MENU_NORMAL_ITEM | MENU_LOCAL_TASK,
    'file' => 'state_flow.admin.inc',
  );
  return $items;
}