FIX Warning

This commit is contained in:
Laurent Destailleur 2019-01-11 18:17:51 +01:00
parent 38ebb4ce4e
commit 2040ca1141

View File

@ -1193,16 +1193,19 @@ class Website extends CommonObject
$out.= '</li></a>'; $out.= '</li></a>';
} }
$i=0; $i=0;
foreach($languagecodes as $languagecode) if (is_array($languagecodes))
{ {
if ($languagecode == $languagecodeselected) continue; // Already output foreach($languagecodes as $languagecode)
$shortcode = strtolower(substr($languagecode, -2)); {
$label = $weblangs->trans("Language_".$languagecode); if ($languagecode == $languagecodeselected) continue; // Already output
if ($shortcode == 'us') $label = preg_replace('/\s*\(.*\)/', '', $label); $shortcode = strtolower(substr($languagecode, -2));
$out.= '<a href="'.$url.$languagecode.'"><li><img height="12px" src="medias/image/common/flags/'.$shortcode.'.png" style="margin-right: 5px;"/>'.$label; $label = $weblangs->trans("Language_".$languagecode);
if (empty($i) && empty($languagecodeselected)) $out.= '<span class="fa fa-caret-down" style="padding-left: 5px;" />'; if ($shortcode == 'us') $label = preg_replace('/\s*\(.*\)/', '', $label);
$out.= '</li></a>'; $out.= '<a href="'.$url.$languagecode.'"><li><img height="12px" src="medias/image/common/flags/'.$shortcode.'.png" style="margin-right: 5px;"/>'.$label;
$i++; if (empty($i) && empty($languagecodeselected)) $out.= '<span class="fa fa-caret-down" style="padding-left: 5px;" />';
$out.= '</li></a>';
$i++;
}
} }
$out.= '</ul>'; $out.= '</ul>';