You are here

public function ConfigForm::submitForm in Insert 8

Same name and namespace in other branches
  1. 8.2 src/Form/ConfigForm.php \Drupal\insert\Form\ConfigForm::submitForm()

@inheritdoc

Overrides ConfigFormBase::submitForm

File

src/Form/ConfigForm.php, line 81

Class

ConfigForm

Namespace

Drupal\insert\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('insert.config');
  $config
    ->set('text_formats', array_keys(array_filter($form_state
    ->getValue('text_formats'), function ($value) {
    return !!$value;
  })));
  $config
    ->set('css_classes.file', $form_state
    ->getValue('file'));
  $config
    ->set('css_classes.image', $form_state
    ->getValue('image'));
  $config
    ->save();
  parent::submitForm($form, $form_state);
}