protected function LingotekManagementFormBase::getSourceStatus in Lingotek Translation 3.5.x
Same name and namespace in other branches
- 8.2 src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getSourceStatus()
- 4.0.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getSourceStatus()
- 3.0.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getSourceStatus()
- 3.1.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getSourceStatus()
- 3.2.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getSourceStatus()
- 3.3.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getSourceStatus()
- 3.4.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getSourceStatus()
- 3.6.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getSourceStatus()
- 3.7.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getSourceStatus()
- 3.8.x src/Form/LingotekManagementFormBase.php \Drupal\lingotek\Form\LingotekManagementFormBase::getSourceStatus()
Gets the source status of an entity in a format ready to display.
Parameters
\Drupal\Core\Entity\ContentEntityInterface $entity: The entity.
Return value
array A render array.
1 call to LingotekManagementFormBase::getSourceStatus()
- LingotekManagementFormBase::getRow in src/
Form/ LingotekManagementFormBase.php - Gets a rows fo rendering based on the passed entity.
File
- src/
Form/ LingotekManagementFormBase.php, line 1548
Class
- LingotekManagementFormBase
- Form for bulk management of content.
Namespace
Drupal\lingotek\FormCode
protected function getSourceStatus(ContentEntityInterface $entity) {
$langcode_source = LingotekLocale::convertLingotek2Drupal($this->translationService
->getSourceLocale($entity));
$language = $this->languageManager
->getLanguage($langcode_source);
$source_status = $this->translationService
->getSourceStatus($entity);
$data = [
'data' => [
'#type' => 'lingotek_source_status',
'#entity' => $entity,
'#language' => $language,
'#status' => $source_status,
],
];
if ($source_status == Lingotek::STATUS_EDITED && !$this->translationService
->getDocumentId($entity)) {
$data['data']['#context']['status'] = strtolower(Lingotek::STATUS_REQUEST);
}
return $data;
}