';
?>
%n'), __('Text and Image', 'qtranslate')) ?>
*/
}
}
/**
* Language Select Code for non-Widget users
* @args is a hash array of options, which accepts the following keys:
* ‘type’ – one of the values: ‘text’, ‘image’, ‘both’, ‘dropdown’ and ‘custom’, which match the choices on widget admin page.
* ‘format’ – needs to be provided if ‘type’ is ‘custom’. Read help text to this option on widget admin page.
* ‘id’ – id of widget, which is used as a distinctive string to create CSS entities.
* @since 3.4.5 type of argument is changed, compatibility with old way is preserved.
*/
function qtranxf_generateLanguageSelectCode($args = array(), $id='') {
global $q_config;
if(is_string($args)) $type = $args;
elseif(is_bool($args)&&$args) $type='image';
elseif(is_array($args)){
if(!empty($args['type'])) $type = $args['type'];
if(empty($id) && !empty($args['id'])) $id = $args['id'];
}
if(empty($type)) $type='text';
else switch($type){
case 'text':
case 'image':
case 'both':
case 'short':
case 'css_only':
case 'custom':
case 'dropdown': break;
default: $type='text';
}
if(empty($id)) $id = 'qtranslate';
$id .= '-chooser';
if(is_404()) $url = get_option('home'); else $url = '';
$flag_location=qtranxf_flag_location();
echo PHP_EOL.'
'.PHP_EOL;
switch($type) {
case 'image':
case 'text':
case 'css_only':
case 'dropdown': {
foreach(qtranxf_getSortedLanguages() as $language) {
$alt = $q_config['language_name'][$language].' ('.$language.')';
$classes = array('lang-'.$language);
if($language == $q_config['language']) $classes[] = 'active';
echo '