protected function LingotekConfigManagementForm::getTargetActionUrl in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 8 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
- 8.2 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
- 3.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
- 3.1.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
- 3.2.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
- 3.3.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
- 3.4.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
- 3.5.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
- 3.6.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
- 3.7.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getTargetActionUrl()
- 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 1769
Class
- LingotekConfigManagementForm
- Form for bulk management of content.
Namespace
Drupal\lingotek\FormCode
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 (in_array($target_status, [
Lingotek::STATUS_REQUEST,
Lingotek::STATUS_UNTRACKED,
Lingotek::STATUS_DELETED,
])) {
$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;
}