You are here

public function WordListCaptchaSettingsForm::submitForm in CAPTCHA Pack 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides ConfigFormBase::submitForm

File

text_captcha/modules/word_list_captcha/src/Form/WordListCaptchaSettingsForm.php, line 73

Class

WordListCaptchaSettingsForm
Administration form.

Namespace

Drupal\word_list_captcha\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('word_list_captcha.settings');
  $config
    ->set('word_list_captcha_list_size', $form_state
    ->getValue('word_list_captcha_list_size'));
  foreach ($form_state
    ->getValues() as $label => $value) {
    if (strpos($label, 'word_list_captcha_word_pool') !== FALSE) {
      $config
        ->set($label, $value);
    }
  }
  $config
    ->save();
  parent::SubmitForm($form, $form_state);
}