You are here

function captcha_menu in CAPTCHA 6

Same name and namespace in other branches
  1. 5.3 captcha.module \captcha_menu()
  2. 6.2 captcha.module \captcha_menu()
  3. 7 captcha.module \captcha_menu()

Implementation of hook_menu().

File

./captcha.module, line 48
This module enables basic CAPTCHA functionality: administrators can add a CAPTCHA to desired forms that users without the 'skip CAPTCHA' permission (typically anonymous visitors) have to solve.

Code

function captcha_menu() {
  $items = array();

  // main configuration page of the basic CAPTCHA module
  $items['admin/user/captcha'] = array(
    'title' => 'CAPTCHA',
    'description' => 'Administer how and where CAPTCHAs are used.',
    'file' => 'captcha.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'captcha_admin_settings',
    ),
    'access arguments' => array(
      'administer CAPTCHA settings',
    ),
    'type' => MENU_NORMAL_ITEM,
  );

  // the default local task (needed when other modules want to offer
  // alternative CAPTCHA types and their own configuration page as local task)
  $items['admin/user/captcha/captcha'] = array(
    'title' => 'CAPTCHA',
    'access arguments' => array(
      'administer CAPTCHA settings',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -20,
  );
  $items['admin/user/captcha/captcha/settings'] = array(
    'title' => 'General settings',
    'access arguments' => array(
      'administer CAPTCHA settings',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => 0,
  );
  $items['admin/user/captcha/captcha/examples'] = array(
    'title' => 'Examples',
    'description' => 'An overview of the available challenge types with examples.',
    'file' => 'captcha.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'captcha_examples',
      5,
      6,
    ),
    'access arguments' => array(
      'administer CAPTCHA settings',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 5,
  );
  $items['admin/user/captcha/captcha/captcha_point'] = array(
    'title' => 'CAPTCHA point administration',
    'file' => 'captcha.admin.inc',
    'page callback' => 'captcha_point_admin',
    'page arguments' => array(
      5,
      6,
    ),
    'access arguments' => array(
      'administer CAPTCHA settings',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}