Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Handle flag icon for CE set with language 'All' #719

Merged
merged 1 commit into from Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions Classes/Service/ContentEditableWrapperService.php
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