There is an error in the code, this is the right one:
echo '<select onchange="this.options[this.selectedIndex].value && (window.location = this.options[this.selectedIndex].value);">';
foreach( CMLLanguage::get_all() as $lang ) {
$img = sprintf( '<img src="%s" title="%s" alt="%s" />',
CMLLanguage::get_flag_src( $result->id, $size ),
$lang->cml_language,
sprintf( __( '%1$ flag', 'ceceppaml' ), $result->cml_language_slug ) );
echo '<option value="' . cml_get_the_link( $lang ) . '">' . $img . '</option>';
}
echo '</select>';
Anyway I sent an email to you, let me know ??