protected function LingotekConfigManagementForm::getSourceStatus in Lingotek Translation 8
Same name and namespace in other branches
- 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()
- 3.8.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 990 - Contains \Drupal\Lingotek\Form\LingotekConfigManagementForm.
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 = array(
'data' => array(
'#type' => 'inline_template',
'#template' => '<span class="language-icon source-{{status}}" title="{{status_title}}">{% if url %}<a href="{{url}}">{%endif%}{{language}}{%if url %}</a>{%endif%}</span>',
'#context' => array(
'language' => strtoupper($language_source
->id()),
'status' => strtolower($source_status),
'status_title' => $this
->getSourceStatusText($mapper, $source_status),
'url' => $this
->getSourceActionUrl($mapper, $source_status),
),
),
);
if ($source_status == Lingotek::STATUS_EDITED && !$this->translationService
->getConfigDocumentId($mapper)) {
$data['data']['#context']['status'] = strtolower(Lingotek::STATUS_REQUEST);
}
return $data;
}