Skip to content

Commit

Permalink
[BUGFIX] Handle flag icon for CE set with language 'All' (#719)
Browse files Browse the repository at this point in the history
Resolves: #718
  • Loading branch information
webian authored Sep 11, 2023
1 parent 3dd6712 commit b6b8403
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Classes/Service/ContentEditableWrapperService.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,16 @@ public function renderInlineActionIcons(bool $elementIsHidden, string $recordTit
$languageIcon = '';
$siteLanguages = $frontendController->getSite()->getAllLanguages();
if (count($siteLanguages) > 1) {
$siteLanguage = $siteLanguages[$langUid];
$title = htmlspecialchars($siteLanguage->getTitle());
if ($siteLanguage->getFlagIdentifier()) {
$icon = $this->iconFactory->getIcon($siteLanguage->getFlagIdentifier(), Icon::SIZE_SMALL)->render();
if ($langUid >= 0) { // Specific language CE
$siteLanguage = $siteLanguages[$langUid];
$title = htmlspecialchars($siteLanguage->getTitle());
if ($siteLanguage->getFlagIdentifier()) {
$icon = $this->iconFactory->getIcon($siteLanguage->getFlagIdentifier(), Icon::SIZE_SMALL)->render();
$languageIcon = '<span title="' . $title . '" class="t3js-flag">' . $icon . '</span>';
}
} else { // All languages CE
$title = htmlspecialchars($GLOBALS['LANG']->sL('LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages'));
$icon = $this->iconFactory->getIcon('flags-multiple', Icon::SIZE_SMALL)->render();
$languageIcon = '<span title="' . $title . '" class="t3js-flag">' . $icon . '</span>';
}
}
Expand Down

0 comments on commit b6b8403

Please sign in to comment.