public function LingotekTargetStatuses::preRender in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 8.2 src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::preRender()
- 4.0.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::preRender()
- 3.0.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::preRender()
- 3.1.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::preRender()
- 3.2.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::preRender()
- 3.3.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::preRender()
- 3.4.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::preRender()
- 3.5.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::preRender()
- 3.7.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::preRender()
- 3.8.x src/Element/LingotekTargetStatuses.php \Drupal\lingotek\Element\LingotekTargetStatuses::preRender()
Calculates the url and status title and adds them to the render array.
Parameters
array $element: The element as a render array.
Return value
array The element as a render array.
File
- src/
Element/ LingotekTargetStatuses.php, line 54
Class
- LingotekTargetStatuses
- Provides a Lingotek target status element.
Namespace
Drupal\lingotek\ElementCode
public function preRender(array $element) {
$statuses = NULL;
if (isset($element['#entity'])) {
$statuses = $this
->getTranslationsStatuses($element['#entity'], $element['#source_langcode'], $element['#statuses']);
}
if (isset($element['#mapper'])) {
$statuses = $this
->getTranslationsStatusesForConfigMapper($element['#mapper'], $element['#source_langcode'], $element['#statuses']);
}
elseif (isset($element['#ui_component'])) {
$statuses = $this
->getTranslationsStatusesForUI($element['#ui_component'], $element['#source_langcode'], $element['#statuses']);
}
$element['#statuses'] = $statuses;
return $element;
}