Changing Joom!Fish language selector |
12/13/2006 |
After some requests concerning the opacity effect of the Joom!fish language selector module (mod_jflanguageselection), we give you here the code modification that was done.
The modification takes place on the switch level defining the type of display(text, image, selectlist) in line 99
$href = JFModuleHTML::_createHRef ($language->iso);
if( isset($language->image) && $language->image!="" ) {
$langImg = '/images/' .$language->image;
} else {
$langImg = '/components/com_joomfish/images/flags/' .$language->iso .".gif";
}
Under the condition which determines whether an image is defined in the configuration of Joomfish and add this portion of code which cuts out the name of the file image in order to insert the suffix there _active.
$pos = strrpos( $language->image, ".");
$image = substr($language->image, 0, $pos).'_active'.substr($language->image, $pos);
Always under the replace condition the attribution of the image to the variable $langImg by this code which adds a check between the current language of the site and the language defined in the loop.
$langImg = ($iso_client_lang == $language->iso) ? '/images/'.$image : '/images/' .$language->image;
What gives us :
$href = JFModuleHTML::_createHRef ($language->iso);
if( isset($language->image) && $language->image!="" ) {
$pos = strrpos( $language->image, ".");
$image = substr($language->image, 0, $pos).'_active'.substr($language->image, $pos);
$langImg = ($iso_client_lang == $language->iso) ? '/images/'.$image : '/images/' .$language->image;
} else {
$langImg = '/components/com_joomfish/images/flags/' .$language->iso .".gif";
}
|