You are here

public function SettingsForm::submitForm in Save & Edit 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/SettingsForm.php, line 119

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\save_edit\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('save_edit.settings')
    ->set('button_value', $form_state
    ->getValue('button_value'))
    ->set('button_weight', $form_state
    ->getValue('button_weight'))
    ->set('dropbutton', $form_state
    ->getValue('dropbutton'))
    ->set('hide_default_save', $form_state
    ->getValue('hide_default_save'))
    ->set('hide_default_publish', $form_state
    ->getValue('hide_default_publish'))
    ->set('hide_default_preview', $form_state
    ->getValue('hide_default_preview'))
    ->set('hide_default_delete', $form_state
    ->getValue('hide_default_delete'))
    ->set('unpublish', $form_state
    ->getValue('unpublish'))
    ->set('unpublish_new_only', $form_state
    ->getValue('unpublish_new_only'))
    ->set('node_types', $form_state
    ->getValue('node_types'))
    ->save();
}