You are here

function user_revision_menu in User Revision 7

Same name and namespace in other branches
  1. 7.2 user_revision.module \user_revision_menu()

Implements hook_menu().

File

./user_revision.module, line 23
Enables user revision.

Code

function user_revision_menu() {
  $items['user/%user/revisions'] = array(
    'title' => 'Revisions',
    'page callback' => 'user_revision_overview',
    'page arguments' => array(
      1,
    ),
    'access callback' => '_user_revision_access',
    'access arguments' => array(
      1,
      array(
        'view user revisions',
        'view own user revisions',
      ),
    ),
    'weight' => 2,
    'type' => MENU_LOCAL_TASK,
    'file' => 'user_revision.pages.inc',
  );
  $items['user/%user/revisions/%/view'] = array(
    'title' => 'Revisions',
    'page callback' => 'user_revision_show',
    'page arguments' => array(
      1,
      3,
    ),
    'access callback' => '_user_revision_access',
    'access arguments' => array(
      1,
      array(
        'view user revisions',
        'view own user revisions',
      ),
    ),
  );
  $items['user/%user_revision/revisions/%/revert'] = array(
    'title' => 'Revert to earlier revision',
    'load arguments' => array(
      3,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_revision_revert_confirm',
      1,
    ),
    'access callback' => '_user_revision_access',
    'access arguments' => array(
      1,
      array(
        'revert user revisions',
        'revert own user revisions',
      ),
    ),
    'file' => 'user_revision.pages.inc',
  );
  $items['user/%user_revision/revisions/%/delete'] = array(
    'title' => 'Delete earlier revision',
    'load arguments' => array(
      3,
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_revision_delete_confirm',
      1,
    ),
    'access callback' => '_user_revision_access',
    'access arguments' => array(
      1,
      array(
        'delete user revisions',
        'delete own user revisions',
      ),
    ),
    'file' => 'user_revision.pages.inc',
  );
  $items['admin/config/people/revisions'] = array(
    'title' => 'Revision settings',
    'description' => 'Configure revision settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'user_revision_admin_settings',
    ),
    'access arguments' => array(
      'view user revisions',
    ),
    'file' => 'user_revision.admin.inc',
    'weight' => 10,
  );
  return $items;
}