You are here

function userprotect_menu in User protect 6

Same name and namespace in other branches
  1. 5 userprotect.module \userprotect_menu()
  2. 7 userprotect.module \userprotect_menu()

Implementation of hook_menu().

File

./userprotect.module, line 320

Code

function userprotect_menu() {
  $items = array();
  $admin = array(
    'administer userprotect',
  );

  // Admin page link.
  $items['admin/user/userprotect'] = array(
    'title' => 'User Protect',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'userprotect_protected_users',
    ),
    'access callback' => 'user_access',
    'access arguments' => $admin,
    'description' => t('Protect inidividual users and/or roles from editing operations.'),
  );

  // Default tab.
  $items['admin/user/userprotect/protected_users'] = array(
    'title' => 'Protected users',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'access callback' => 'user_access',
    'access arguments' => $admin,
    'weight' => 1,
  );

  // Protected roles tab.
  $items['admin/user/userprotect/protected_roles'] = array(
    'title' => 'Protected roles',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'userprotect_protected_roles',
    ),
    'access callback' => 'user_access',
    'access arguments' => $admin,
    'type' => MENU_LOCAL_TASK,
    'weight' => 2,
  );

  // Administrator bypass tab.
  $items['admin/user/userprotect/administrator_bypass'] = array(
    'title' => 'Administrator bypass',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'userprotect_administrator_bypass',
    ),
    'access callback' => 'user_access',
    'access arguments' => $admin,
    'type' => MENU_LOCAL_TASK,
    'weight' => 3,
  );

  // Default settings.
  $items['admin/user/userprotect/protection_defaults'] = array(
    'title' => 'Protection defaults',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'userprotect_protection_defaults',
    ),
    'access callback' => 'user_access',
    'access arguments' => $admin,
    'type' => MENU_LOCAL_TASK,
    'weight' => 4,
  );

  // Remove a user from being protected.
  $items['userprotect/delete/%user'] = array(
    'title' => 'Delete protected user',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'userprotect_protected_users_delete_form',
      2,
      3,
    ),
    'type' => MENU_CALLBACK,
    'access callback' => 'user_access',
    'access arguments' => $admin,
  );
  return $items;
}