You are here

public function CopypreventionSettingsForm::submitForm in Copy Prevention 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/CopypreventionSettingsForm.php, line 122

Class

CopypreventionSettingsForm
Copyprevention Settings Form class.

Namespace

Drupal\copyprevention\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('copyprevention.settings');
  $config
    ->set('copyprevention_body', $form_state
    ->getValue('copyprevention_body'));
  $config
    ->set('copyprevention_images', $form_state
    ->getValue('copyprevention_images'));
  $config
    ->set('copyprevention_images_min_dimension', $form_state
    ->getValue('copyprevention_images_min_dimension'));
  $config
    ->set('copyprevention_images_search', $form_state
    ->getValue('copyprevention_images_search'));
  $config
    ->save();
  parent::submitForm($form, $form_state);
}