You are here

function state_flow_menu_alter in State Machine 7.3

Same name and namespace in other branches
  1. 6 modules/state_flow/state_flow.module \state_flow_menu_alter()

Implements hook_menu_alter().

File

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

Code

function state_flow_menu_alter(&$items) {

  // Hijack the node/X/edit page to ensure that the right revision  is displayed
  if (isset($items['node/%node/edit'])) {
    $items['node/%node/edit']['page callback'] = 'state_flow_node_edit_page_override';
    $items['node/%node/edit']['title'] = t('Edit Draft');
  }

  // Ensure viewing a revision is the default task for the revisions route.
  if (isset($items['node/%node/revisions/%/view'])) {
    $items['node/%node/revisions/%/view']['type'] = MENU_DEFAULT_LOCAL_TASK;
  }

  // Ensure our access callback is used.
  if (isset($items['node/%/revisions-state-flow-states'])) {
    $items['node/%/revisions-state-flow-states']['access callback'] = 'state_flow_revisions_node_tab_access';
  }
}