You are here

protected function LingotekConfigManagementForm::getTargetActionUrl in Lingotek Translation 3.0.x

Same name and namespace in other branches
  1. 8 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
  2. 8.2 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
  3. 4.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
  4. 3.1.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
  5. 3.2.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
  6. 3.3.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
  7. 3.4.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
  8. 3.5.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
  9. 3.6.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
  10. 3.7.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
  11. 3.8.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
1 call to LingotekConfigManagementForm::getTargetActionUrl()
LingotekConfigManagementForm::getTranslationsStatuses in src/Form/LingotekConfigManagementForm.php
Gets the translation status of an entity in a format ready to display.

File

src/Form/LingotekConfigManagementForm.php, line 1645

Class

LingotekConfigManagementForm
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

protected function getTargetActionUrl(ConfigMapperInterface &$mapper, $target_status, $langcode) {
  $url = NULL;
  $args = $this
    ->getActionUrlArguments($mapper);
  $document_id = $mapper instanceof ConfigEntityMapper ? $this->translationService
    ->getDocumentId($mapper
    ->getEntity()) : $this->translationService
    ->getConfigDocumentId($mapper);
  $locale = $this->languageLocaleMapper
    ->getLocaleForLangcode($langcode);
  if ($locale) {
    if ($target_status == Lingotek::STATUS_REQUEST || $target_status == Lingotek::STATUS_UNTRACKED) {
      $url = Url::fromRoute('lingotek.config.request', $args + [
        'locale' => $locale,
      ], [
        'query' => $this
          ->getDestinationArray(),
      ]);
    }
    if ($target_status == Lingotek::STATUS_PENDING) {
      $url = Url::fromRoute('lingotek.config.check_download', $args + [
        'locale' => $locale,
      ], [
        'query' => $this
          ->getDestinationArray(),
      ]);
    }
    if ($target_status == Lingotek::STATUS_READY || $target_status == Lingotek::STATUS_ERROR) {
      $url = Url::fromRoute('lingotek.config.download', $args + [
        'locale' => $locale,
      ], [
        'query' => $this
          ->getDestinationArray(),
      ]);
    }
    if ($target_status == Lingotek::STATUS_CURRENT || $target_status == Lingotek::STATUS_INTERMEDIATE || $target_status == Lingotek::STATUS_EDITED) {
      $url = Url::fromRoute('lingotek.workbench', [
        'doc_id' => $document_id,
        'locale' => $locale,
      ]);
    }
  }
  return $url;
}