You are here

public function SettingsForm::submitForm in Quote 8.2

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/SettingsForm.php, line 168

Class

SettingsForm
Class Settings Form.

Namespace

Drupal\quote\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $allow_types = array_filter($form_state
    ->getValue('quote_allow_types', []));
  $this
    ->config('quote.settings')
    ->set('quote_modes_quote_sel', $form_state
    ->getValue('quote_modes_quote_sel'))
    ->set('quote_modes_quote_all', $form_state
    ->getValue('quote_modes_quote_all'))
    ->set('quote_modes_quote_reply_all', $form_state
    ->getValue('quote_modes_quote_reply_all'))
    ->set('quote_modes_quote_reply_sel', $form_state
    ->getValue('quote_modes_quote_reply_sel'))
    ->set('quote_allow_comments', $form_state
    ->getValue('quote_allow_comments'))
    ->set('quote_allow_types', $allow_types)
    ->set('quote_selector', $form_state
    ->getValue('quote_selector'))
    ->set('quote_limit', $form_state
    ->getValue('quote_limit'))
    ->set('quote_selector_comment_quote_all', $form_state
    ->getValue('quote_selector_comment_quote_all'))
    ->set('quote_selector_node_quote_all', $form_state
    ->getValue('quote_selector_node_quote_all'))
    ->set('quote_ckeditor_support', $form_state
    ->getValue('quote_ckeditor_support'))
    ->save();
  $this->cacheRender
    ->invalidateAll();
}