You are here

function revisioning_menu in Revisioning 6

Same name and namespace in other branches
  1. 8 revisioning.module \revisioning_menu()
  2. 6.4 revisioning.module \revisioning_menu()
  3. 6.3 revisioning.module \revisioning_menu()
  4. 7 revisioning.module \revisioning_menu()

Implementation of hook_menu().

Define new menu items. Existing menu items are modified through hook_menu_alter().

File

./revisioning.module, line 27

Code

function revisioning_menu() {
  $items = array();

  // Add a tab to the 'My content' menu (as defined in module_grants.module)
  // and make it the default
  $items['content/pending'] = array(
    'title' => 'Pending',
    'page callback' => 'revisioning_pending_nodes',
    'access arguments' => array(
      'access content summary',
    ),
    'weight' => -20,
  );

  // Callback (not a menu item) to allow users to edit specified revision
  $items['node/%node/revisions/%/edit'] = array(
    //'title' => t('Edit revision'),
    'load arguments' => array(
      3,
    ),
    'page callback' => 'revisioning_edit',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'module_grants_node_revision_access',
    'access arguments' => array(
      'edit revisions',
      1,
    ),
    'file' => 'node.pages.inc',
    'file path' => drupal_get_path('module', 'node'),
    'type' => MENU_CALL_BACK,
  );

  // Callback to allow users to publish revisions
  $items['node/%node/revisions/%/publish'] = array(
    //'title' => t('Publish revision'),
    'load arguments' => array(
      3,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'revisioning_publish_confirm',
      1,
    ),
    'access callback' => 'module_grants_node_revision_access',
    'access arguments' => array(
      'publish revisions',
      1,
    ),
    'type' => MENU_CALLBACK,
  );

  // Callback to allow users to unpublish a node
  $items['node/%node/unpublish'] = array(
    //'title' => t('Unpublish'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'revisioning_unpublish_confirm',
      1,
    ),
    'access callback' => 'module_grants_node_revision_access',
    'access arguments' => array(
      'unpublish current revision',
      1,
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}