$noscriptString = ''; foreach ($langActive as $language) { $href = JFModuleHTML::_createHRef($language, $params); if ($language->code == $curLanguage->getTag() && !$show_active) { continue; // Not showing the active language } if ($language->code == $curLanguage->getTag()) { $activehref = $href; } if (isset($language->disabled) && $language->disabled) { $disabled = " disabled='disabled'"; } else { $disabled = ""; } $langOption = JFModuleHTML::makeOption($href, $language->name, $disabled); $langOptions[] = $langOption; $href = JFModuleHTML::_createHRef($language, $params); $noscriptString .= '<a href="' . $href . '"><span lang="' . $language->getLanguageCode() . '" xml:lang="' . $language->getLanguageCode() . '">' . $language->name . '</span></a> '; } if (count($langOptions) > 1) { $langlist = JFModuleHTML::selectList($langOptions, 'lang', ' class="jflanguageselection" size="1" onchange="document.location.replace(this.value);"', 'value', 'text', $activehref); $outString = '<div id="jflanguageselection">'; $outString .= '<label for="jflanguageselection" class="jflanguageselection">' . JText::_("JFMSELECT") . '</label>'; $outString .= $langlist; $outString .= '</div>'; if ($noscriptString != '') { $outString .= '<noscript>' . $noscriptString . '</noscript>'; } } elseif (count($langOptions) == 1) { $outString = '<div id="jflanguageselection"><ul class="jflanguageselection"><li id="active_language"><a href="' . $langOptions[0]->value . '"><span lang="' . $langOptions[0]->value . '" xml:lang="' . $langOptions[0]->value . '">' . $langOptions[0]->text . '</a></li></ul></div>';
// Not showing the active language } $href = JFModuleHTML::_createHRef($language, $params); $langImg = JFModuleHTML::getLanguageImageSource($language); if ($language->get('id') == $curLanguage->get('id')) { $activehref = $href; $activeLangImg = array('img' => $langImg, 'code' => $languageCode, 'name' => $language->title_native); } if (isset($language->disabled) && $language->disabled) { $disabled = " disabled='disabled'"; $noscriptString .= '<span lang="' . $languageCode . '" xml:lang="' . $languageCode . '" style="opacity:0.5" class="opaque">' . $language->title_native . '</span> '; $langOption = JFModuleHTML::makeOption($href, $language->title_native, $disabled . " style='padding-left:22px;background-image: url(\"" . JURI::base(true) . $langImg . "\");background-repeat: no-repeat;background-position:center left;opacity:0.5;' class='opaque'"); } else { $disabled = ""; $noscriptString .= '<a href="' . $href . '"><span lang="' . $languageCode . '" xml:lang="' . $languageCode . '">' . $language->title_native . '</span></a> '; $langOption = JFModuleHTML::makeOption($href, $language->title_native, $disabled . " style='padding-left:22px;background-image: url(\"" . JURI::base(true) . $langImg . "\");background-repeat: no-repeat;background-position:center left;'"); } $langOption->iso = $language->iso; $langOptions[] = $langOption; } if (count($langOptions) >= 1) { $outString = '<div id="jflanguageselection">'; $outString .= '<label for="jflanguageselection" class="jflanguageselection">' . JText::_('JFMSELECT') . '</label>'; if ($activeLangImg != null) { $outString .= '<img src="' . JURI::base(true) . $activeLangImg['img'] . '" alt="' . $activeLangImg['name'] . '" title="' . $activeLangImg['name'] . '" border="0" class="langImg"/>'; } $langlist = JFModuleHTML::selectList($langOptions, 'lang', ' class="jflanguageselection" onfocus="jfselectlang=this.selectedIndex;" onchange="if(this.options[this.selectedIndex].disabled){this.selectedIndex=jfselectlang;} else {document.location.replace(this.value);}"', 'value', 'text', $activehref); $outString .= '' . $langlist . ''; $outString .= '</div>' . "\n"; if ($noscriptString != '') { $outString .= '<noscript>' . $noscriptString . '</noscript>';
$noscriptString = ''; foreach ($langActive as $language) { $href = JFModuleHTML::_createHRef($language, $params); if ($language->get('id') == $curLanguage->get('id') && !$show_active) { continue; // Not showing the active language } if ($language->get('id') == $curLanguage->get('id')) { $activehref = $href; } if (isset($language->disabled) && $language->disabled) { $disabled = " disabled='disabled'"; } else { $disabled = ""; } $langOption = JFModuleHTML::makeOption($href, $language->title_native, $disabled); $langOptions[] = $langOption; $href = JFModuleHTML::_createHRef($language, $params); $noscriptString .= '<a href="' . $href . '"><span lang="' . $language->getLanguageCode() . '" xml:lang="' . $language->getLanguageCode() . '">' . $language->title_native . '</span></a> '; } if (count($langOptions) > 1) { $langlist = JFModuleHTML::selectList($langOptions, 'lang', ' class="jflanguageselection" size="1" onchange="document.location.replace(this.value);"', 'value', 'text', $activehref); $outString = '<div id="jflanguageselection">'; $outString .= '<label for="jflanguageselection" class="jflanguageselection">' . JText::_("JFMSELECT") . '</label>'; $outString .= $langlist; $outString .= '</div>'; if ($noscriptString != '') { $outString .= '<noscript>' . $noscriptString . '</noscript>'; } } elseif (count($langOptions) == 1) { $outString = '<div id="jflanguageselection"><ul class="jflanguageselection"><li id="active_language"><a href="' . $langOptions[0]->value . '"><span lang="' . $langOptions[0]->value . '" xml:lang="' . $langOptions[0]->value . '">' . $langOptions[0]->text . '</a></li></ul></div>';