You are here

public function LingotekConfigManagementForm::filterForm in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::filterForm()
  2. 8.2 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::filterForm()
  3. 4.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::filterForm()
  4. 3.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::filterForm()
  5. 3.1.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::filterForm()
  6. 3.2.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::filterForm()
  7. 3.3.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::filterForm()
  8. 3.5.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::filterForm()
  9. 3.6.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::filterForm()
  10. 3.7.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::filterForm()
  11. 3.8.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::filterForm()

Form submission handler for filtering.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

File

src/Form/LingotekConfigManagementForm.php, line 393

Class

LingotekConfigManagementForm
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

public function filterForm(array &$form, FormStateInterface $form_state) {
  $value = $form_state
    ->getValue([
    'filters',
    'wrapper',
    'bundle',
  ]);
  $job_id = $form_state
    ->getValue([
    'filters',
    'wrapper',
    'job',
  ]) ?: NULL;
  $label = $form_state
    ->getValue([
    'filters',
    'wrapper',
    'label',
  ]) ?: NULL;

  /** @var \Drupal\user\PrivateTempStore $temp_store */
  $temp_store = $this
    ->getFilterTempStore();
  $temp_store
    ->set('bundle', $value);
  $temp_store
    ->set('job', $job_id);
  $temp_store
    ->set('label', $label);
  $this->filter = $value;

  // If we apply any filters, we need to go to the first page again.
  $form_state
    ->setRedirect('<current>');
}