You are here

public function SettingsForm::submitForm in Browser update 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 285

Class

SettingsForm
Defines a form that configures browser-update.org settings.

Namespace

Drupal\bu\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();

  // Save the updated settings.
  $this
    ->config('bu.settings')
    ->set('notify_ie', $values['notify_ie'])
    ->set('notify_firefox', $values['notify_firefox'])
    ->set('notify_opera', $values['notify_opera'])
    ->set('notify_safari', $values['notify_safari'])
    ->set('notify_chrome', $values['notify_chrome'])
    ->set('insecure', $values['insecure'])
    ->set('unsupported', $values['unsupported'])
    ->set('mobile', $values['mobile'])
    ->set('position', $values['position'])
    ->set('visibility_pages', $values['visibility_pages'])
    ->set('visibility_type', $values['visibility_type'])
    ->set('text_override', $values['text_override'])
    ->set('reminder', $values['reminder'])
    ->set('reminder_closed', $values['reminder_closed'])
    ->set('test_mode', $values['test_mode'])
    ->set('new_window', $values['new_window'])
    ->set('url', $values['url'])
    ->set('no_close', $values['no_close'])
    ->set('source', $values['source'])
    ->set('show_source', $values['show_source'])
    ->save();
  parent::submitForm($form, $form_state);
}