function TranslateFilterForm::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/locale/src/Form/TranslateFilterForm.php, line 85

Class

TranslateFilterForm
Provides a filtered translation edit form.

Namespace

Drupal\locale\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $filters = $this->translateFilters();
  $session_filters = $this->getRequest()
    ->getSession()
    ->get('locale_translate_filter', []);
  foreach ($filters as $name => $filter) {
    if ($form_state->hasValue($name)) {
      $session_filters[$name] = trim($form_state->getValue($name));
    }
  }
  $this->getRequest()
    ->getSession()
    ->set('locale_translate_filter', $session_filters);
  $form_state->setRedirect('locale.translate_page');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.