You are here

function word_list_captcha_settings_form in CAPTCHA Pack 5

Same name and namespace in other branches
  1. 6 text_captcha/word_list_captcha/word_list_captcha.admin.inc \word_list_captcha_settings_form()
  2. 7 text_captcha/word_list_captcha/word_list_captcha.admin.inc \word_list_captcha_settings_form()

Function for the settings form

2 string references to 'word_list_captcha_settings_form'
word_list_captcha_menu in text_captcha/word_list_captcha/word_list_captcha.module
Implementation of hook_menu().
word_list_captcha_settings_form_validate in text_captcha/word_list_captcha/word_list_captcha.module
Validation function for the settings form

File

text_captcha/word_list_captcha/word_list_captcha.module, line 39

Code

function word_list_captcha_settings_form() {
  $form = array();

  // form element for the number of words in the word list
  $form['word_list_captcha_list_size'] = array(
    '#type' => 'select',
    '#title' => t('Number of words in word list'),
    '#default_value' => variable_get('word_list_captcha_list_size', 5),
    '#options' => array(
      4 => 4,
      5 => 5,
      6 => 6,
      7 => 7,
      8 => 8,
      9 => 9,
      10 => 10,
    ),
  );

  // form elements for the word pools
  _text_captcha_word_pool_form_items($form, 'word_list_captcha_word_pool_1', t('Word pool @num', array(
    '@num' => 1,
  )), 'Enter a bunch of related words (space separated, no punctuation). Make sure they are not related in the same way to the words of the other word pool.', WORD_LIST_CAPTCHA_WORD_POOL1, 2);
  _text_captcha_word_pool_form_items($form, 'word_list_captcha_word_pool_2', t('Word pool @num', array(
    '@num' => 2,
  )), 'Enter a bunch of related words (space separated, no punctuation). Make sure they are not related in the same way to the words of the other word pool.', WORD_LIST_CAPTCHA_WORD_POOL2, 2);

  // add buttons and return
  return system_settings_form($form);
}