You are here

public function ConfigTranslationDeleteForm::submitForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/config_translation/src/Form/ConfigTranslationDeleteForm.php \Drupal\config_translation\Form\ConfigTranslationDeleteForm::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/config_translation/src/Form/ConfigTranslationDeleteForm.php, line 137
Contains \Drupal\config_translation\Form\ConfigTranslationDeleteForm.

Class

ConfigTranslationDeleteForm
Builds a form to delete configuration translation.

Namespace

Drupal\config_translation\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  foreach ($this->mapper
    ->getConfigNames() as $name) {
    $this->languageManager
      ->getLanguageConfigOverride($this->language
      ->getId(), $name)
      ->delete();
  }

  // Flush all persistent caches.
  $this->moduleHandler
    ->invokeAll('cache_flush');
  foreach (Cache::getBins() as $cache_backend) {
    $cache_backend
      ->deleteAll();
  }
  drupal_set_message($this
    ->t('@language translation of %label was deleted', array(
    '%label' => $this->mapper
      ->getTitle(),
    '@language' => $this->language
      ->getName(),
  )));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}