function multiple_registration_menu in Multiple Registration 7
Implements hook_menu().
File
- ./
multiple_registration.module, line 14 - Add ability to create several registration pages.
Code
function multiple_registration_menu() {
$items = array();
$items['admin/config/people/multiple_registration'] = array(
'title' => 'Multiple registrations pages',
'description' => 'Multiple registration configuration',
'page callback' => 'multiple_registration_settings_form',
'access callback' => 'user_access',
'access arguments' => array(
'administer multiple_registration',
),
'type' => MENU_NORMAL_ITEM,
);
$items['admin/config/people/multiple_registration/%/add'] = array(
'title' => 'Create new registration page',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'multiple_registration_create_registration_form',
4,
),
'access callback' => 'user_access',
'access arguments' => array(
'administer multiple_registration',
),
'type' => MENU_CALLBACK,
);
$items['admin/config/people/multiple_registration/%/remove'] = array(
'title' => 'Remove registration page',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'multiple_registration_remove_registration_form',
4,
),
'access callback' => 'user_access',
'access arguments' => array(
'administer multiple_registration',
),
'type' => MENU_CALLBACK,
);
$items['admin/config/people/multiple_registration/default_form'] = array(
'title' => 'Manage default registration form state',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'multiple_registration_default_registration_form',
),
'access callback' => 'user_access',
'access arguments' => array(
'administer multiple_registration',
),
'type' => MENU_CALLBACK,
);
if ($registration_pages = _multiple_registration_get_registration_pages()) {
$user_roles = user_roles();
foreach ($registration_pages as $rid => $path) {
$items[$path] = array(
'title' => 'Create new @role account',
'title arguments' => array(
'@role' => $user_roles[$rid],
),
'page callback' => 'drupal_get_form',
'page arguments' => array(
'user_register_form',
),
'access callback' => 'user_register_access',
'type' => MENU_LOCAL_TASK,
);
}
}
return $items;
}