diff --git a/templates/includes/header.php b/templates/includes/header.php index 9deef8f24be0aaed455c6df7a3fa621f4f0ffbe7..aadd1d674edc40e4a3e9dae3493b71570896cb40 100644 --- a/templates/includes/header.php +++ b/templates/includes/header.php @@ -147,62 +147,63 @@ if($onLoad !== '') { if ($includeLanguageBar) { - - echo '<div id="languagebar">'; $languages = $this->getLanguageList(); - $langnames = array( - 'no' => 'BokmĂĄl', // Norwegian BokmĂĄl - 'nn' => 'Nynorsk', // Norwegian Nynorsk - 'se' => 'Sámegiella', // Northern Sami - 'sam' => 'Ă…arjelh-saemien giele', // Southern Sami - 'da' => 'Dansk', // Danish - 'en' => 'English', - 'de' => 'Deutsch', // German - 'sv' => 'Svenska', // Swedish - 'fi' => 'Suomeksi', // Finnish - 'es' => 'Español', // Spanish - 'fr' => 'Français', // French - 'it' => 'Italiano', // Italian - 'nl' => 'Nederlands', // Dutch - 'lb' => 'LĂ«tzebuergesch', // Luxembourgish - 'cs' => 'ÄŚeština', // Czech - 'sl' => 'Slovenščina', // Slovensk - 'lt' => 'LietuviĹł kalba', // Lithuanian - 'hr' => 'Hrvatski', // Croatian - 'hu' => 'Magyar', // Hungarian - 'pl' => 'JÄ™zyk polski', // Polish - 'pt' => 'PortuguĂŞs', // Portuguese - 'pt-br' => 'PortuguĂŞs brasileiro', // Portuguese - 'ru' => 'Ń€ŃŃŃкий ŃŹĐ·Ń‹Đş', // Russian - 'et' => 'eesti keel', // Estonian - 'tr' => 'TĂĽrkçe', // Turkish - 'el' => 'ελληνικά', // Greek - 'ja' => '日本語', // Japanese - 'zh' => '简体ä¸ć–‡', // Chinese (simplified) - 'zh-tw' => 'çąé«”ä¸ć–‡', // Chinese (traditional) - 'ar' => 'العربية', // Arabic - 'fa' => 'پارسی', // Persian - 'ur' => 'اردŮ', // Urdu - 'he' => 'עִבְרִית', // Hebrew - 'id' => 'Bahasa Indonesia', // Indonesian - 'sr' => 'Srpski', // Serbian - 'lv' => 'Latviešu', // Latvian - 'ro' => 'RomâneČ™te', // Romanian - 'eu' => 'Euskara', // Basque - ); - - $textarray = array(); - foreach ($languages AS $lang => $current) { - $lang = strtolower($lang); - if ($current) { - $textarray[] = $langnames[$lang]; - } else { - $textarray[] = '<a href="' . htmlspecialchars(SimpleSAML_Utilities::addURLparameter(SimpleSAML_Utilities::selfURL(), array($this->languageParameterName => $lang))) . '">' . - $langnames[$lang] . '</a>'; + if ( count($languages) > 1 ) { + echo '<div id="languagebar">'; + $langnames = array( + 'no' => 'BokmĂĄl', // Norwegian BokmĂĄl + 'nn' => 'Nynorsk', // Norwegian Nynorsk + 'se' => 'Sámegiella', // Northern Sami + 'sam' => 'Ă…arjelh-saemien giele', // Southern Sami + 'da' => 'Dansk', // Danish + 'en' => 'English', + 'de' => 'Deutsch', // German + 'sv' => 'Svenska', // Swedish + 'fi' => 'Suomeksi', // Finnish + 'es' => 'Español', // Spanish + 'fr' => 'Français', // French + 'it' => 'Italiano', // Italian + 'nl' => 'Nederlands', // Dutch + 'lb' => 'LĂ«tzebuergesch', // Luxembourgish + 'cs' => 'ÄŚeština', // Czech + 'sl' => 'Slovenščina', // Slovensk + 'lt' => 'LietuviĹł kalba', // Lithuanian + 'hr' => 'Hrvatski', // Croatian + 'hu' => 'Magyar', // Hungarian + 'pl' => 'JÄ™zyk polski', // Polish + 'pt' => 'PortuguĂŞs', // Portuguese + 'pt-br' => 'PortuguĂŞs brasileiro', // Portuguese + 'ru' => 'Ń€ŃŃŃкий ŃŹĐ·Ń‹Đş', // Russian + 'et' => 'eesti keel', // Estonian + 'tr' => 'TĂĽrkçe', // Turkish + 'el' => 'ελληνικά', // Greek + 'ja' => '日本語', // Japanese + 'zh' => '简体ä¸ć–‡', // Chinese (simplified) + 'zh-tw' => 'çąé«”ä¸ć–‡', // Chinese (traditional) + 'ar' => 'العربية', // Arabic + 'fa' => 'پارسی', // Persian + 'ur' => 'اردŮ', // Urdu + 'he' => 'עִבְרִית', // Hebrew + 'id' => 'Bahasa Indonesia', // Indonesian + 'sr' => 'Srpski', // Serbian + 'lv' => 'Latviešu', // Latvian + 'ro' => 'RomâneČ™te', // Romanian + 'eu' => 'Euskara', // Basque + ); + + $textarray = array(); + foreach ($languages AS $lang => $current) { + $lang = strtolower($lang); + if ($current) { + $textarray[] = $langnames[$lang]; + } else { + $textarray[] = '<a href="' . htmlspecialchars(SimpleSAML_Utilities::addURLparameter(SimpleSAML_Utilities::selfURL(), array($this->languageParameterName => $lang))) . '">' . + $langnames[$lang] . '</a>'; + } } + echo join(' | ', $textarray); + echo '</div>'; } - echo join(' | ', $textarray); - echo '</div>'; }