You are here

public function NegotiationBrowserDeleteForm::submitForm in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/language/src/Form/NegotiationBrowserDeleteForm.php \Drupal\language\Form\NegotiationBrowserDeleteForm::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 FormInterface::submitForm

File

core/modules/language/src/Form/NegotiationBrowserDeleteForm.php, line 71
Contains \Drupal\language\Form\NegotiationBrowserDeleteForm.

Class

NegotiationBrowserDeleteForm
Defines a confirmation form for deleting a browser language negotiation mapping.

Namespace

Drupal\language\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('language.mappings')
    ->clear('map.' . $this->browserLangcode)
    ->save();
  $args = array(
    '%browser' => $this->browserLangcode,
  );
  $this
    ->logger('language')
    ->notice('The browser language detection mapping for the %browser browser language code has been deleted.', $args);
  drupal_set_message($this
    ->t('The mapping for the %browser browser language code has been deleted.', $args));
  $form_state
    ->setRedirect('language.negotiation_browser');
}