You are here

public function SettingsForm::submitForm in Forward 4.x

Same name and namespace in other branches
  1. 8.3 src/Form/SettingsForm.php \Drupal\forward\Form\SettingsForm::submitForm()
  2. 8 src/Form/SettingsForm.php \Drupal\forward\Form\SettingsForm::submitForm()
  3. 8.2 src/Form/SettingsForm.php \Drupal\forward\Form\SettingsForm::submitForm()
  4. 4.0.x src/Form/SettingsForm.php \Drupal\forward\Form\SettingsForm::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/SettingsForm.php, line 258

Class

SettingsForm
Configure settings for this module.

Namespace

Drupal\forward\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Save all other settings.
  $this->configFactory
    ->getEditable('forward.settings')
    ->set('forward_form_title', $form_state
    ->getValue('forward_form_title'))
    ->set('forward_form_noindex', $form_state
    ->getValue('forward_form_noindex'))
    ->set('forward_form_instructions', $form_state
    ->getValue('forward_form_instructions'))
    ->set('forward_form_allow_plain_text', $form_state
    ->getValue('forward_form_allow_plain_text'))
    ->set('forward_form_display_page', $form_state
    ->getValue('forward_form_display_page'))
    ->set('forward_form_display_subject', $form_state
    ->getValue('forward_form_display_subject'))
    ->set('forward_form_display_body', $form_state
    ->getValue('forward_form_display_body'))
    ->set('forward_form_confirmation', $form_state
    ->getValue('forward_form_confirmation'))
    ->set('forward_personal_message', $form_state
    ->getValue('forward_personal_message'))
    ->set('forward_personal_message_filter', $form_state
    ->getValue('forward_personal_message_filter'))
    ->set('forward_personal_message_tags', $form_state
    ->getValue('forward_personal_message_tags'))
    ->set('forward_email_logo', $form_state
    ->getValue('forward_email_logo'))
    ->set('forward_email_from_address', $form_state
    ->getValue('forward_email_from_address'))
    ->set('forward_email_subject', $form_state
    ->getValue('forward_email_subject'))
    ->set('forward_email_message', $form_state
    ->getValue('forward_email_message'))
    ->set('forward_email_footer', $form_state
    ->getValue('forward_email_footer'))
    ->set('forward_filter_format_html', $form_state
    ->getValue('forward_filter_format_html'))
    ->set('forward_filter_format_plain_text', $form_state
    ->getValue('forward_filter_format_plain_text'))
    ->set('forward_bypass_access_control', $form_state
    ->getValue('forward_bypass_access_control'))
    ->set('forward_flood_control_limit', $form_state
    ->getValue('forward_flood_control_limit'))
    ->set('forward_flood_control_error', $form_state
    ->getValue('forward_flood_control_error'))
    ->set('forward_max_recipients', $form_state
    ->getValue('forward_max_recipients'))
    ->save();
  parent::submitForm($form, $form_state);
}