You are here

public function SimplifyAdminForm::submitForm in Simplify 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/SimplifyAdminForm.php, line 181

Class

SimplifyAdminForm
Configure simplify global configurations.

Namespace

Drupal\simplify\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->configFactory
    ->getEditable('simplify.global')
    ->set('simplify_admin', $form_state
    ->getValue('simplify_admin'))
    ->set('simplify_nodes_global', $this
    ->getFormValue($form_state, 'simplify_nodes_global'))
    ->set('simplify_users_global', $this
    ->getFormValue($form_state, 'simplify_users_global'))
    ->set('simplify_comments_global', $this
    ->getFormValue($form_state, 'simplify_comments_global'))
    ->set('simplify_taxonomies_global', $this
    ->getFormValue($form_state, 'simplify_taxonomies_global'))
    ->set('simplify_blocks_global', $this
    ->getFormValue($form_state, 'simplify_blocks_global'))
    ->set('simplify_profiles_global', $this
    ->getFormValue($form_state, 'simplify_profiles_global'))
    ->save();
  parent::submitForm($form, $form_state);
}