function userprotect_menu in User protect 7
Same name and namespace in other branches
- 5 userprotect.module \userprotect_menu()
- 6 userprotect.module \userprotect_menu()
Implements hook_menu().
File
- ./
userprotect.module, line 293 - Main module file for the userprotect module.
Code
function userprotect_menu() {
$items = array();
$admin = array(
'administer userprotect',
);
// Admin page link.
$items['admin/config/people/userprotect'] = array(
'title' => 'User protect',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'userprotect_protected_users',
),
'access callback' => 'user_access',
'access arguments' => $admin,
'description' => 'Protect inidividual users and/or roles from editing operations.',
'file' => 'userprotect.admin.inc',
);
// Default tab.
$items['admin/config/people/userprotect/protected_users'] = array(
'title' => 'Protected users',
'type' => MENU_DEFAULT_LOCAL_TASK,
'access callback' => 'user_access',
'access arguments' => $admin,
'weight' => 1,
'file' => 'userprotect.admin.inc',
);
// Protected roles tab.
$items['admin/config/people/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,
'file' => 'userprotect.admin.inc',
);
// Administrator bypass tab.
$items['admin/config/people/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,
'file' => 'userprotect.admin.inc',
);
// Default settings.
$items['admin/config/people/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,
'file' => 'userprotect.admin.inc',
);
// 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,
'file' => 'userprotect.admin.inc',
);
return $items;
}