'widget_qtranslate', 'description' => __('Allows your visitors to choose a Language.','qtranslate') ); $this->WP_Widget('qtranslate', __('qTranslate Language Chooser','qtranslate'), $widget_ops); } function widget($args, $instance) { extract($args); echo $before_widget; $title = empty($instance['title']) ? __('Language', 'qtranslate') : apply_filters('widget_title', $instance['title']); $hide_title = empty($instance['hide-title']) ? false : 'on'; $type = $instance['type']; if($type!='text'&&$type!='image'&&$type!='both'&&$type!='dropdown') $type='text'; if($hide_title!='on') { echo $before_title . $title . $after_title; }; qtrans_generateLanguageSelectCode($type, $this->id); echo $after_widget; } function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = $new_instance['title']; if(isset($new_instance['hide-title'])) $instance['hide-title'] = $new_instance['hide-title']; $instance['type'] = $new_instance['type']; return $instance; } function form($instance) { $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'hide-title' => false, 'type' => 'text' ) ); $title = $instance['title']; $hide_title = $instance['hide-title']; $type = $instance['type']; ?>
'; foreach(qtrans_getSortedLanguages() as $language) { echo '