protected function LingotekConfigManagementForm::getSourceStatus in Lingotek Translation 3.8.x
Same name and namespace in other branches
- 8 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatus()
- 8.2 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatus()
- 4.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatus()
- 3.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatus()
- 3.1.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatus()
- 3.2.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatus()
- 3.3.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatus()
- 3.4.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatus()
- 3.5.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatus()
- 3.6.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatus()
- 3.7.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::getSourceStatus()
Gets the source status of an config in a format ready to display.
Parameters
\Drupal\config_translation\ConfigMapperInterface $mapper: The mapper.
Return value
array A render array.
1 call to LingotekConfigManagementForm::getSourceStatus()
- LingotekConfigManagementForm::buildForm in src/
Form/ LingotekConfigManagementForm.php - Form constructor.
File
- src/
Form/ LingotekConfigManagementForm.php, line 1426
Class
- LingotekConfigManagementForm
- Form for bulk management of content.
Namespace
Drupal\lingotek\FormCode
protected function getSourceStatus(ConfigMapperInterface $mapper) {
$is_config_entity = $mapper instanceof ConfigEntityMapper;
$entity = $is_config_entity ? $mapper
->getEntity() : NULL;
$language_source = $this->languageLocaleMapper
->getConfigurableLanguageForLocale($is_config_entity ? $this->translationService
->getSourceLocale($entity) : $this->translationService
->getConfigSourceLocale($mapper));
$source_status = $is_config_entity ? $this->translationService
->getSourceStatus($entity) : $this->translationService
->getConfigSourceStatus($mapper);
$data = [
'data' => [
'#type' => 'lingotek_source_status',
'#language' => $language_source,
'#status' => strtolower($source_status),
'#status_title' => $this
->getSourceStatusText($mapper, $source_status),
'#url' => $this
->getSourceActionUrl($mapper, $source_status),
],
];
return $data;
}