You are here

public function QuicklinkConfigForm::submitForm in Quicklink 2.0.x

Same name and namespace in other branches
  1. 8 src/Form/QuicklinkConfigForm.php \Drupal\quicklink\Form\QuicklinkConfigForm::submitForm()

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/QuicklinkConfigForm.php, line 335

Class

QuicklinkConfigForm
Class QuicklinkConfig.

Namespace

Drupal\quicklink\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('quicklink.settings')
    ->set('no_load_content_types', array_filter($form_state
    ->getValue('no_load_content_types')))
    ->set('selector', trim($form_state
    ->getValue('selector')))
    ->set('url_patterns_to_ignore', trim($form_state
    ->getValue('url_patterns_to_ignore')))
    ->set('ignore_selectors', trim($form_state
    ->getValue('ignore_selectors')))
    ->set('prefetch_only_paths', trim($form_state
    ->getValue('prefetch_only_paths')))
    ->set('no_load_when_authenticated', $form_state
    ->getValue('no_load_when_authenticated'))
    ->set('no_load_when_session', $form_state
    ->getValue('no_load_when_session'))
    ->set('ignore_admin_paths', $form_state
    ->getValue('ignore_admin_paths'))
    ->set('ignore_ajax_links', $form_state
    ->getValue('ignore_ajax_links'))
    ->set('ignore_hashes', $form_state
    ->getValue('ignore_hashes'))
    ->set('ignore_file_ext', $form_state
    ->getValue('ignore_file_ext'))
    ->set('allowed_domains', trim($form_state
    ->getValue('allowed_domains')))
    ->set('total_request_limit', $form_state
    ->getValue('total_request_limit'))
    ->set('concurrency_throttle_limit', $form_state
    ->getValue('concurrency_throttle_limit'))
    ->set('viewport_delay', $form_state
    ->getValue('viewport_delay'))
    ->set('idle_wait_timeout', $form_state
    ->getValue('idle_wait_timeout'))
    ->set('load_polyfill', $form_state
    ->getValue('load_polyfill'))
    ->set('enable_debug_mode', $form_state
    ->getValue('enable_debug_mode'))
    ->save();
}