| Conditions | 3 |
| Paths | 3 |
| Total Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | public function render() |
||
| 42 | { |
||
| 43 | $langUid = (int) $this->arguments['languageUid']; |
||
| 44 | if (\array_key_exists($langUid, self::$flags)) { |
||
| 45 | return self::$flags[$langUid]; |
||
| 46 | } |
||
| 47 | |||
| 48 | $translationTools = GeneralUtility::makeInstance(TranslationConfigurationProvider::class); |
||
| 49 | $sysLanguages = $translationTools->getSystemLanguages(); |
||
| 50 | |||
| 51 | $iconFactory = GeneralUtility::makeInstance(IconFactory::class); |
||
| 52 | |||
| 53 | $out = ''; |
||
| 54 | $title = \htmlspecialchars($sysLanguages[$langUid]['title']); |
||
| 55 | if ($sysLanguages[$langUid]['flagIcon']) { |
||
| 56 | $out .= '<span title="' . $title . '">' . $iconFactory->getIcon($sysLanguages[$langUid]['flagIcon'], Icon::SIZE_SMALL)->render() . '</span>'; |
||
| 57 | $out .= ' '; |
||
| 58 | } |
||
| 59 | $out .= $title; |
||
| 60 | |||
| 61 | self::$flags[$this->arguments['languageUid']] = (string) $out; |
||
| 62 | |||
| 63 | return $out; |
||
| 64 | } |
||
| 65 | } |
||
| 66 |