You are here

public function LingotekManagementFormBase::debugExportFinished in Lingotek Translation 3.5.x

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

Batch callback called when the debug export batch finishes.

Parameters

$success:

$results:

$operations:

Return value

\Drupal\Core\Routing\LocalRedirectResponse

File

src/Form/LingotekManagementFormBase.php, line 778

Class

LingotekManagementFormBase
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

public function debugExportFinished($success, $results, $operations) {
  if ($success) {
    $links = [];
    if (isset($results['exported'])) {
      foreach ($results['exported'] as $result) {
        $links[] = [
          '#theme' => 'file_link',
          '#file' => File::load($result),
        ];
      }
      $build = [
        '#theme' => 'item_list',
        '#items' => $links,
      ];
      $this
        ->messenger()
        ->addStatus($this
        ->t('Exports available at: @exports', [
        '@exports' => \Drupal::service('renderer')
          ->render($build),
      ]));
    }
  }
}