protected function LingotekSourceStatus::getSourceActionUrlForUI in Lingotek Translation 3.8.x
Same name and namespace in other branches
- 4.0.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceActionUrlForUI()
- 3.2.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceActionUrlForUI()
- 3.3.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceActionUrlForUI()
- 3.4.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceActionUrlForUI()
- 3.5.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceActionUrlForUI()
- 3.6.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceActionUrlForUI()
- 3.7.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceActionUrlForUI()
1 call to LingotekSourceStatus::getSourceActionUrlForUI()
- LingotekSourceStatus::preRender in src/
Element/ LingotekSourceStatus.php - Calculates the url and status title and adds them to the render array.
File
- src/
Element/ LingotekSourceStatus.php, line 151
Class
- LingotekSourceStatus
- Provides a Lingotek source status element.
Namespace
Drupal\lingotek\ElementCode
protected function getSourceActionUrlForUI($component, $source_status) {
$url = NULL;
if ($source_status == Lingotek::STATUS_IMPORTING) {
$url = Url::fromRoute('lingotek.interface_translation.check_upload', [], [
'query' => [
'component' => $component,
] + $this
->getDestinationWithQueryArray(),
]);
}
if (in_array($source_status, [
Lingotek::STATUS_EDITED,
Lingotek::STATUS_UNTRACKED,
Lingotek::STATUS_ERROR,
Lingotek::STATUS_CANCELLED,
Lingotek::STATUS_ARCHIVED,
Lingotek::STATUS_DELETED,
])) {
if ($doc_id = \Drupal::service('lingotek.interface_translation')
->getDocumentId($component)) {
$url = Url::fromRoute('lingotek.interface_translation.update', [], [
'query' => [
'component' => $component,
] + $this
->getDestinationWithQueryArray(),
]);
}
else {
$url = Url::fromRoute('lingotek.interface_translation.upload', [], [
'query' => [
'component' => $component,
] + $this
->getDestinationWithQueryArray(),
]);
}
}
return $url;
}