You are here

public function SubscriptionSettingsForm::submitForm in Simplenews 8

Same name and namespace in other branches
  1. 8.2 src/Form/SubscriptionSettingsForm.php \Drupal\simplenews\Form\SubscriptionSettingsForm::submitForm()
  2. 3.x src/Form/SubscriptionSettingsForm.php \Drupal\simplenews\Form\SubscriptionSettingsForm::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/SubscriptionSettingsForm.php, line 192

Class

SubscriptionSettingsForm
Configure simplenews subscription settings.

Namespace

Drupal\simplenews\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('simplenews.settings')
    ->set('subscription.use_combined', $form_state
    ->getValue('simplenews_use_combined'))
    ->set('subscription.confirm_subscribe_subject', $form_state
    ->getValue('simplenews_confirm_subscribe_subject'))
    ->set('subscription.confirm_subscribe_unsubscribed', $form_state
    ->getValue('simplenews_confirm_subscribe_unsubscribed'))
    ->set('subscription.confirm_subscribe_subscribed', $form_state
    ->getValue('simplenews_confirm_subscribe_subscribed'))
    ->set('subscription.confirm_unsubscribe_subscribed', $form_state
    ->getValue('simplenews_confirm_unsubscribe_subscribed'))
    ->set('subscription.confirm_unsubscribe_unsubscribed', $form_state
    ->getValue('simplenews_confirm_unsubscribe_unsubscribed'))
    ->set('subscription.confirm_combined_subject', $form_state
    ->getValue('simplenews_confirm_combined_subject'))
    ->set('subscription.confirm_combined_body', $form_state
    ->getValue('simplenews_confirm_combined_body'))
    ->set('subscription.confirm_combined_body_unchanged', $form_state
    ->getValue('simplenews_confirm_combined_body_unchanged'))
    ->set('subscription.confirm_combined_line_subscribe_unsubscribed', $form_state
    ->getValue('simplenews_confirm_combined_line_subscribe_unsubscribed'))
    ->set('subscription.confirm_combined_line_subscribe_subscribed', $form_state
    ->getValue('simplenews_confirm_combined_line_subscribe_subscribed'))
    ->set('subscription.confirm_combined_line_unsubscribe_subscribed', $form_state
    ->getValue('simplenews_confirm_combined_line_unsubscribe_subscribed'))
    ->set('subscription.confirm_combined_line_unsubscribe_unsubscribed', $form_state
    ->getValue('simplenews_confirm_combined_line_unsubscribe_unsubscribed'))
    ->set('subscription.confirm_subscribe_page', $form_state
    ->getValue('simplenews_confirm_subscribe_page'))
    ->set('subscription.confirm_unsubscribe_page', $form_state
    ->getValue('simplenews_confirm_unsubscribe_page'))
    ->save();
  parent::submitForm($form, $form_state);
}