You are here

function logintoboggan_menu in LoginToboggan 5

Same name and namespace in other branches
  1. 6 logintoboggan.module \logintoboggan_menu()
  2. 7 logintoboggan.module \logintoboggan_menu()

Implementation of hook_menu()

Related topics

File

./logintoboggan.module, line 485
Logintoboggan Module

Code

function logintoboggan_menu($may_cache) {
  global $user;
  $items = array();
  if ($may_cache) {

    //settings page
    $items[] = array(
      'path' => 'admin/user/logintoboggan',
      'title' => t('LoginToboggan'),
      'description' => t('Set up custom login options like instant login, login redirects, pre-authorized validation roles, etc.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'logintoboggan_main_settings',
      ),
    );

    //callback for user validate routine
    $items[] = array(
      'path' => 'user/validate',
      'title' => t('Validate e-mail address'),
      'callback' => 'logintoboggan_validate_email',
      'access' => TRUE,
      'type' => MENU_CALLBACK,
    );

    //callback for handling access denied redirection
    $items[] = array(
      'path' => 'toboggan/denied',
      'access' => TRUE,
      'callback' => 'logintoboggan_denied',
      'title' => t('Access denied'),
      'type' => MENU_CALLBACK,
    );
  }
  else {

    // add custom css for the block
    drupal_add_css(drupal_get_path('module', 'logintoboggan') . '/logintoboggan.css');

    //callback for re-sending validation e-mail
    $items[] = array(
      'path' => 'toboggan/revalidate',
      'title' => t('Re-send validation e-mail'),
      'callback' => 'logintoboggan_resend_validation',
      'callback arguments' => array(
        arg(2),
      ),
      'access' => $user->uid == arg(2) || user_access('administer users'),
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}