protected function LingotekSourceStatus::getSourceActionUrlForUI in Lingotek Translation 3.5.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.6.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceActionUrlForUI()
- 3.7.x src/Element/LingotekSourceStatus.php \Drupal\lingotek\Element\LingotekSourceStatus::getSourceActionUrlForUI()
- 3.8.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 94
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 ($source_status == Lingotek::STATUS_EDITED || $source_status == Lingotek::STATUS_UNTRACKED || $source_status == Lingotek::STATUS_ERROR || $source_status == Lingotek::STATUS_CANCELLED) {
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;
}