You are here

function username_check_settings in Username originality AJAX check 8

Same name and namespace in other branches
  1. 5 username_check.module \username_check_settings()
  2. 6 username_check.settings.inc \username_check_settings()
  3. 7 username_check.admin.inc \username_check_settings()

Menu callback; displays the username_check module settings page.

1 string reference to 'username_check_settings'
UsernameCheckSettings::getFormId in src/Form/UsernameCheckSettings.php
Returns a unique string identifying the form.

File

./username_check.admin.inc, line 11
Admin page callbacks for the username_check module.

Code

function username_check_settings() {
  $form = array();
  $form['username_check_mode'] = array(
    '#type' => 'radios',
    '#title' => t('Check for usernames pre-existing in system:'),
    '#options' => array(
      'auto' => t('On - executes when user leaves username field or upon timer end'),
      'off' => t('Off - No Username checking'),
    ),
    '#default_value' => \Drupal::config('username_check.settings')
      ->get('username_check_mode'),
  );
  $form['username_check_mail_mode'] = array(
    '#type' => 'radios',
    '#title' => t('Check for E-mail addresses pre-existing in system:'),
    '#options' => array(
      'auto' => t('On - executes when user leaves e-mail field or upon timer end'),
      'off' => t('Off - No E-mail address checking'),
    ),
    '#default_value' => \Drupal::config('username_check.settings')
      ->get('username_check_mail_mode'),
  );
  $form['username_check_delay'] = array(
    '#type' => 'textfield',
    '#title' => t('Timer threshold:'),
    '#description' => t('Threshold in seconds (ex: 0.5, 1) for the check to happen.'),
    '#default_value' => \Drupal::config('username_check.settings')
      ->get('username_check_delay'),
  );
  return system_settings_form($form);
}