You are here

public function SimpleRecaptchaSettingsForm::submitForm in Simple Google reCAPTCHA 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

src/Form/SimpleRecaptchaSettingsForm.php, line 130

Class

SimpleRecaptchaSettingsForm
Provides administration form for simple_recaptcha module.

Namespace

Drupal\simple_recaptcha\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->configFactory
    ->getEditable(static::SETTINGS)
    ->set('form_ids', $form_state
    ->getValue('form_ids'))
    ->set('site_key', $form_state
    ->getValue('site_key'))
    ->set('secret_key', $form_state
    ->getValue('secret_key'))
    ->set('site_key_v3', $form_state
    ->getValue('site_key_v3'))
    ->set('secret_key_v3', $form_state
    ->getValue('secret_key_v3'))
    ->set('recaptcha_type', $form_state
    ->getValue('recaptcha_type'))
    ->set('v3_score', $form_state
    ->getValue('v3_score'))
    ->set('recaptcha_use_globally', $form_state
    ->getValue('recaptcha_use_globally'))
    ->save();
  parent::submitForm($form, $form_state);
}