You are here

public function ProtectedSubmissionsForm::submitForm in Protected Submissions 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/ProtectedSubmissionsForm.php, line 285

Class

ProtectedSubmissionsForm
ProtectedSubmissionsForm class.

Namespace

Drupal\protected_submissions\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('protected_submissions.settings');
  $config
    ->set('protected_submissions.allowed_scripts', $form_state
    ->getValue('allowed_scripts'));
  $config
    ->set('protected_submissions.check_quantity', $form_state
    ->getValue('check_quantity'));
  $config
    ->set('protected_submissions.reject_message', $form_state
    ->getValue('reject_message'));
  $config
    ->set('protected_submissions.reject_patterns', $form_state
    ->getValue('reject_patterns'));
  $config
    ->set('protected_submissions.log_rejected', $form_state
    ->getValue('log_rejected'));
  $config
    ->save();
  return parent::submitForm($form, $form_state);
}