Google Language Translator - Version 4.0.1

Version Description

Download this release

Release Info

Developer rm2773
Plugin Icon wp plugin Google Language Translator
Version 4.0.1
Comparing to
See all releases

Code changes from version 4.0 to 4.0.1

Files changed (2) hide show
  1. google-language-translator.php +1982 -1970
  2. readme.txt +200 -195
google-language-translator.php CHANGED
@@ -1,1971 +1,1983 @@
1
- <?php
2
- /*
3
- Plugin Name: Google Language Translator
4
- Plugin URI: http://www.studio88design.com/plugins/google-language-translator
5
- Version: 4.0
6
- Description: The MOST SIMPLE Google Translator plugin. This plugin adds Google Translator to your website by using a single shortcode, [google-translator]. Settings include: layout style, hide/show specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
7
- Author: Rob Myrick
8
- Author URI: http://www.studio88design.com/
9
- */
10
-
11
- include( plugin_dir_path( __FILE__ ) . 'widget.php');
12
-
13
- class google_language_translator {
14
-
15
- public $languages_array = array(
16
- 'af' => 'Afrikaans',
17
- 'sq' => 'Albanian',
18
- 'ar' => 'Arabic',
19
- 'hy' => 'Armenian',
20
- 'az' => 'Azerbaijani',
21
- 'eu' => 'Basque',
22
- 'be' => 'Belarusian',
23
- 'bn' => 'Bengali',
24
- 'bs' => 'Bosnian',
25
- 'bg' => 'Bulgarian',
26
- 'ca' => 'Catalan',
27
- 'ceb' => 'Cebuano',
28
- 'zh-CN' => 'Chinese(Simplified)',
29
- 'zh-TW' => 'Chinese(Traditional)',
30
- 'hr' => 'Croatian',
31
- 'cs' => 'Czech',
32
- 'da' => 'Danish',
33
- 'nl' => 'Dutch',
34
- 'en' => 'English',
35
- 'eo' => 'Esperanto',
36
- 'et' => 'Estonian',
37
- 'tl' => 'Filipino',
38
- 'fi' => 'Finnish',
39
- 'fr' => 'French',
40
- 'gl' => 'Galician',
41
- 'ka' => 'Georgian',
42
- 'de' => 'German',
43
- 'el' => 'Greek',
44
- 'gu' => 'Gujarati',
45
- 'ht' => 'Haitian',
46
- 'ha' => 'Hausa',
47
- 'iw' => 'Hebrew',
48
- 'hi' => 'Hindi',
49
- 'hmn' => 'Hmong',
50
- 'hu' => 'Hungarian',
51
- 'is' => 'Icelandic',
52
- 'ig' => 'Igbo',
53
- 'id' => 'Indonesian',
54
- 'ga' => 'Irish',
55
- 'it' => 'Italian',
56
- 'ja' => 'Japanese',
57
- 'jw' => 'Javanese',
58
- 'kn' => 'Kannada',
59
- 'km' => 'Khmer',
60
- 'ko' => 'Korean',
61
- 'lo' => 'Lao',
62
- 'la' => 'Latin',
63
- 'lv' => 'Latvian',
64
- 'lt' => 'Lithuanian',
65
- 'mk' => 'Macedonian',
66
- 'ms' => 'Malay',
67
- 'mt' => 'Maltese',
68
- 'mi' => 'Maori',
69
- 'mr' => 'Marathi',
70
- 'mn' => 'Mongolian',
71
- 'ne' => 'Nepali',
72
- 'no' => 'Norwegian',
73
- 'fa' => 'Persian',
74
- 'pl' => 'Polish',
75
- 'pt' => 'Portuguese',
76
- 'pa' => 'Punjabi',
77
- 'ro' => 'Romanian',
78
- 'ru' => 'Russian',
79
- 'sr' => 'Serbian',
80
- 'sk' => 'Slovak',
81
- 'sl' => 'Slovenian',
82
- 'so' => 'Somali',
83
- 'es' => 'Spanish',
84
- 'sw' => 'Swahili',
85
- 'sv' => 'Swedish',
86
- 'ta' => 'Tamil',
87
- 'te' => 'Telugu',
88
- 'th' => 'Thai',
89
- 'tr' => 'Turkish',
90
- 'uk' => 'Ukranian',
91
- 'ur' => 'Urdu',
92
- 'vi' => 'Vietnamese',
93
- 'cy' => 'Welsh',
94
- 'yi' => 'Yiddish',
95
- 'yo' => 'Yoruba',
96
- 'zu' => 'Zulu'
97
- );
98
-
99
- public function __construct(){
100
-
101
- register_activation_hook( __FILE__, array( $this, 'glt_activate' ) );
102
-
103
- add_action('admin_menu',array(&$this, 'page_layout'));
104
- add_action('admin_init',array(&$this, 'initialize_settings'));
105
- add_action('wp_head',array(&$this, 'load_css'));
106
- add_action('admin_head',array(&$this, 'load_css'));
107
- add_shortcode( 'google-translator',array(&$this, 'google_translator_shortcode'));
108
- add_filter('widget_text','do_shortcode');
109
-
110
- if (!is_admin()) {
111
- add_action('init',array(&$this, 'flags'));
112
- }
113
- }
114
-
115
- public function glt_activate() {
116
- add_option('googlelanguagetranslator_active', 1);
117
- add_option('googlelanguagetranslator_language','en');
118
- add_option('googlelanguagetranslator_language_option','all');
119
- add_option('language_display_settings',array ('en' => 1));
120
- add_option('googlelanguagetranslator_flags','show_flags');
121
- add_option('flag_display_settings',array ('flag-en' => 1));
122
- add_option('googlelanguagetranslator_translatebox','yes');
123
- add_option('googlelanguagetranslator_display','Vertical');
124
- add_option('googlelanguagetranslator_toolbar','Yes');
125
- add_option('googlelanguagetranslator_showbranding','Yes');
126
- add_option('googlelanguagetranslator_flags_alignment','flags_left');
127
- add_option('googlelanguagetranslator_analytics',1);
128
- add_option('googlelanguagetranslator_analytics_id','');
129
- add_option('googlelanguagetranslator_css','');
130
- add_option('googlelanguagetranslator_manage_translations',0);
131
- add_option('googlelanguagetranslator_multilanguage',0);
132
- add_option('googlelanguagetranslator_floating_widget','yes');
133
- }
134
-
135
- public function load_css() {
136
- include( plugin_dir_path( __FILE__ ) . 'css/style.php');
137
- }
138
-
139
- public function scripts($hook_suffix) {
140
- global $p;
141
- if ($p == $hook_suffix) {
142
- wp_enqueue_script( 'cookie.js', plugins_url('js/cookie.js',__FILE__), array('jquery'));
143
- wp_enqueue_script( 'my-admin-script', plugins_url('js/admin.js',__FILE__), array('jquery'));
144
- wp_enqueue_script( 'my-flag-script', plugins_url('js/flags.js',__FILE__), array('jquery'));
145
- wp_enqueue_script( 'my-toolbar-script', plugins_url('js/toolbar.js',__FILE__), array('jquery'));
146
- wp_enqueue_script( 'my-load-toolbar-script', plugins_url('js/load-toolbar.js',__FILE__), array('jquery'));
147
- wp_enqueue_script( 'jquery-ui.js', plugins_url('js/jquery-ui.js',__FILE__), array('jquery'));
148
- wp_enqueue_script( 'jquery-ui-sortable.js', plugins_url('js/jquery-ui-sortable.js',__FILE__), array('jquery'));
149
- wp_enqueue_script( 'jquery-ui-widget.js', plugins_url('js/jquery-ui-widget.js',__FILE__), array('jquery'));
150
- wp_enqueue_script( 'jquery-ui-mouse.js', plugins_url('js/jquery-ui-mouse.js',__FILE__), array('jquery'));
151
- wp_enqueue_script( 'load_sortable_flags', plugins_url('js/load-sortable-flags.js',__FILE__), array('jquery'));
152
- wp_register_style( 'jquery-ui.css', plugins_url('css/jquery-ui.css',__FILE__) );
153
- wp_register_style( 'toolbar.css', plugins_url('css/toolbar.css', __FILE__) );
154
- wp_register_style( 'style.css', plugins_url('css/style.css', __FILE__) );
155
- wp_enqueue_style( 'style.css' );
156
- wp_enqueue_style( 'toolbar.css' );
157
- wp_enqueue_style( 'jquery-ui.css' );
158
- }
159
- }
160
-
161
- public function flags() {
162
- wp_enqueue_script( 'flags', plugins_url('js/flags.js',__FILE__), array('jquery'));
163
- wp_enqueue_script( 'my-toolbar-script', plugins_url('js/toolbar.js',__FILE__), array('jquery'));
164
- wp_enqueue_script( 'my-load-toolbar-script', plugins_url('js/load-toolbar.js',__FILE__), array('jquery'));
165
- wp_register_style( 'toolbar.css', plugins_url('css/toolbar.css', __FILE__) );
166
- wp_register_style( 'style.css', plugins_url('css/style.css', __FILE__) );
167
- wp_enqueue_style( 'style.css' );
168
- wp_enqueue_style( 'toolbar.css' );
169
- }
170
-
171
- public function page_layout () {
172
- global $p;
173
-
174
- add_action( 'admin_enqueue_scripts',array(&$this, 'scripts'));
175
- add_action('admin_head',array(&$this, 'load_css'));
176
-
177
- $p = add_options_page('Google Language Translator', 'Google Language Translator', 'manage_options', 'google_language_translator', array(&$this, 'page_layout_cb'));
178
- }
179
-
180
-
181
- public function google_translator_shortcode() {
182
- if (get_option('googlelanguagetranslator_display')=='Vertical'){
183
- return $this->googlelanguagetranslator_vertical();
184
- }
185
-
186
- elseif(get_option('googlelanguagetranslator_display')=='Horizontal'){
187
- return $this->googlelanguagetranslator_horizontal();
188
- }
189
- }
190
-
191
- public function googlelanguagetranslator_included_languages() {
192
- if ( get_option('googlelanguagetranslator_language_option')=='specific') {
193
- $get_language_choices = get_option ('language_display_settings');
194
-
195
- foreach ($get_language_choices as $key=>$value) {
196
- if($value == 1) {
197
- $items[] = $key;
198
- }
199
- }
200
-
201
- $comma_separated = implode(",",array_values($items));
202
-
203
- if ( get_option('googlelanguagetranslator_display') == 'Vertical') {
204
- $lang = ', includedLanguages:\''.$comma_separated.'\'';
205
- return $lang;
206
- } elseif ( get_option('googlelanguagetranslator_display') == 'Horizontal') {
207
- $lang = ', includedLanguages:\''.$comma_separated.'\'';
208
- return $lang;
209
- }
210
- }
211
- }
212
-
213
- public function analytics() {
214
- if ( get_option('googlelanguagetranslator_analytics') == 1 ) {
215
- $analytics_id = get_option('googlelanguagetranslator_analytics_id');
216
- $analytics = 'gaTrack: true, gaId: \''.$analytics_id.'\'';
217
- return ', '.$analytics;
218
- }
219
- }
220
-
221
- public function googlelanguagetranslator_vertical(){
222
- $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
223
- $new_languages_array = explode(",",$new_languages_array_string);
224
- $new_languages_array_codes = array_values($new_languages_array);
225
- $get_language_choices = get_option ('language_display_settings');
226
- $flag_width = get_option('googlelanguagetranslator_flag_size');
227
- $default_language_code = get_option('googlelanguagetranslator_language');
228
- $is_active = get_option ( 'googlelanguagetranslator_active' );
229
- $get_flag_choices = get_option ('flag_display_settings');
230
- $get_language_option = get_option('googlelanguagetranslator_language_option');
231
- $language_choices = $this->googlelanguagetranslator_included_languages();
232
- $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
233
- $str = '';
234
-
235
- if( $is_active == 1){
236
-
237
- foreach ($get_flag_choices as $flag_choice_key) {}
238
-
239
- if ($floating_widget=='yes' && $get_language_option != 'specific') {
240
- $str.='<div id="glt-translate-trigger"><span class="notranslate">Translate &raquo;</strong></div>';
241
- $str.='<div id="glt-toolbar">';
242
- $str.='<ul id="sortable" class="ui-sortable">';
243
-
244
- if (empty($new_languages_array_string)) {
245
- foreach ($this->languages_array as $key=>$value) {
246
- $language_code = $key;
247
- $language_name = $value;
248
- $language_name_flag = $language_name;
249
-
250
- if ($flag_choice_key == '1') {
251
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
252
- $str.='<a id="'.$language_name.'" href="#" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$languge_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="24" width="24" alt="'.$language_name.'"/></a>';
253
- }//isset
254
- } //$key
255
- }//foreach
256
- } else {
257
- foreach ($new_languages_array_codes as $value) {
258
- $language_name = $value;
259
- $language_code = array_search ($language_name,$this->languages_array);
260
- $language_name_flag = $language_name;
261
-
262
- if ($flag_choice_key == '1') {
263
- if (in_array($language_name,$this->languages_array)) {
264
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
265
- $str.='<a id="'.$language_name.'" href="#" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$languge_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="24" width="24" alt="'.$language_name.'"/></a>';
266
- } //isset
267
- } //in_array
268
- }//if
269
- }//foreach
270
- }
271
- $str.='</ul>';
272
- $str.='</div>';
273
- } //endif $floating_widget
274
-
275
- $str.='<div id="flags">';
276
- $str.='<ul id="sortable" class="ui-sortable" style="float:left">';
277
-
278
- if (empty($new_languages_array_string)) {
279
- foreach ($this->languages_array as $key=>$value) {
280
- $language_code = $key;
281
- $language_name = $value;
282
- $language_name_flag = $language_name;
283
-
284
- if ($flag_choice_key == '1') {
285
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
286
- $str.='<a id="'.$language_name.'" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$language_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="'.$flag_width.'" width="'.$flag_width.'" alt="'.$language_name.'"/></a>';
287
- }
288
- } //$key
289
- }//foreach
290
- } else {
291
- foreach ($new_languages_array_codes as $value) {
292
- $language_name = $value;
293
- $language_code = array_search ($language_name,$this->languages_array);
294
- $language_name_flag = $language_name;
295
-
296
- if ($flag_choice_key == '1') {
297
- if (in_array($language_name,$this->languages_array)) {
298
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
299
- $str.='<a id="'.$language_name.'" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$language_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="'.$flag_width.'" width="'.$flag_width.'" alt="'.$flag_width.'"/></a>';
300
- } //isset
301
- } //in_array
302
- }//flag_choice_key
303
- }//foreach
304
- }//else
305
-
306
- $str.='</ul>';
307
- $str.='</div>';
308
-
309
- $is_multilanguage = get_option('googlelanguagetranslator_multilanguage');
310
- $auto_display = ', autoDisplay: false';
311
-
312
- if ($is_multilanguage == 1) {
313
- $multilanguagePage = ', multilanguagePage:true';
314
-
315
- $str.='<script type="text/javascript">
316
- function GoogleLanguageTranslatorInit() {
317
- new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\''.$language_choices . $auto_display . $multilanguagePage . $this->analytics().'}, \'google_language_translator\');}
318
- </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
319
- <div id="google_language_translator"></div>';
320
- return $str;
321
- } elseif ($is_multilanguage == 0) {
322
-
323
- $str.='<script type="text/javascript">
324
- function GoogleLanguageTranslatorInit() {
325
- new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\''.$language_choices . $auto_display . $this->analytics().'}, \'google_language_translator\');}
326
- </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
327
- <div id="google_language_translator"></div>';
328
- return $str;
329
- }
330
- } //End is_active
331
- } // End glt_vertical
332
-
333
- public function googlelanguagetranslator_horizontal(){
334
- $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
335
- $new_languages_array = explode(",",$new_languages_array_string);
336
- $new_languages_array_codes = array_values($new_languages_array);
337
- $get_language_choices = get_option ('language_display_settings');
338
- $flag_width = get_option('googlelanguagetranslator_flag_size');
339
- $default_language_code = get_option('googlelanguagetranslator_language');
340
- $is_active = get_option ( 'googlelanguagetranslator_active' );
341
- $get_flag_choices = get_option ('flag_display_settings');
342
- $get_language_option = get_option('googlelanguagetranslator_language_option');
343
- $language_choices = $this->googlelanguagetranslator_included_languages();
344
- $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
345
- $str = '';
346
-
347
- if( $is_active == 1) {
348
- foreach ($get_flag_choices as $flag_choice_key) {}
349
-
350
- if ($floating_widget=='yes' && $get_language_option != 'specific') {
351
- $str.='<div id="glt-translate-trigger"><span class="notranslate">Translate &raquo;</strong></div>';
352
- $str.='<div id="glt-toolbar">';
353
- $str.='<ul id="sortable" class="ui-sortable" style="float:left">';
354
-
355
- if (empty($new_languages_array_string)) {
356
-
357
- foreach ($this->languages_array as $key=>$value) {
358
- $language_code = $key;
359
- $language_name = $value;
360
- $language_name_flag = $language_name;
361
-
362
- if ($flag_choice_key == '1') {
363
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
364
- $str.='<a id="'.$language_name.'" href="#" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$languge_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="24" width="24" alt="'.$language_name.'"/></a>';
365
- }
366
- } //$key
367
- }//foreach
368
-
369
-
370
- } elseif (!empty($new_languages_array_string)) {
371
-
372
- foreach ($new_languages_array_codes as $value) {
373
- $language_name = $value;
374
- $language_code = array_search ($language_name,$this->languages_array);
375
- $language_name_flag = $language_name;
376
-
377
- if ($flag_choice_key == '1') {
378
- if (in_array($language_name,$this->languages_array)) {
379
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
380
- $str.='<a id="'.$language_name.'" href="#" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$languge_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="24" width="24" alt="'.$language_name.'"/></a>';
381
- }
382
- } //$in_array
383
- } //$key
384
- }//foreach
385
- }//empty
386
-
387
- $str.='</ul>';
388
- $str.='</div>';
389
- }
390
-
391
- $str.='<div id="flags">';
392
- $str.='<ul id="sortable" class="ui-sortable">';
393
-
394
- if (empty($new_languages_array_string)) {
395
-
396
- foreach ($this->languages_array as $key=>$value) {
397
- $language_code = $key;
398
- $language_name = $value;
399
- $language_name_flag = $language_name;
400
-
401
- if ($flag_choice_key == '1') {
402
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
403
- $str.='<a id="'.$language_name.'" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$language_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="'.$flag_width.'" width="'.$flag_width.'" alt="'.$language_name.'"/></a>';
404
- }
405
- } //$key
406
- }//foreach
407
- } elseif (!empty($new_languages_array_string)) {
408
-
409
- foreach ($new_languages_array_codes as $value) {
410
- $language_name = $value;
411
- $language_code = array_search ($language_name,$this->languages_array);
412
- $language_name_flag = $language_name;
413
-
414
- if ($flag_choice_key == '1') {
415
- if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
416
- $str.='<a id="'.$language_name.'" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$language_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="'.$flag_width.'" width="'.$flag_width.'" alt="'.$language_name.'"/></a>';
417
- } //isset
418
- }//$flag_choice_key
419
- }//foreach
420
- }//elseif
421
-
422
- $str.='</ul>';
423
- $str.='</div>';
424
-
425
- $is_multilanguage = get_option('googlelanguagetranslator_multilanguage');
426
- $horizontal_layout = ', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL';
427
- $auto_display = ', autoDisplay: false';
428
-
429
- if ($is_multilanguage == 1) {
430
- $multilanguagePage = ', multilanguagePage:true';
431
-
432
- $str.='<script type="text/javascript">
433
- function GoogleLanguageTranslatorInit() {
434
- new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\''. $language_choices . $horizontal_layout . $auto_display . $multilanguagePage . $this->analytics().'}, \'google_language_translator\');}
435
- </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
436
- <div id="google_language_translator"></div>';
437
- return $str;
438
- } elseif ($is_multilanguage == 0) {
439
-
440
- $str.='<script type="text/javascript">
441
- function GoogleLanguageTranslatorInit() {
442
- new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\''. $language_choices . $horizontal_layout . $auto_display . $this->analytics().'}, \'google_language_translator\');}
443
- </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
444
- <div id="google_language_translator"></div>';
445
- return $str;
446
- }
447
- }
448
- } // End glt_horizontal
449
-
450
- public function initialize_settings() {
451
-
452
- // First, we register a section. This is necessary since all future options must belong to one.
453
- add_settings_section(
454
- 'glt_settings', // ID used to identify this section and with which to register options
455
- 'Settings', // Title to be displayed on the administration page
456
- '', // Callback used to render the description of the section
457
- 'google_language_translator' // Page on which to add this section of options
458
- );
459
-
460
- //Fieldset 1
461
- add_settings_field( 'googlelanguagetranslator_active','Plugin status:','googlelanguagetranslator_active_cb','google_language_translator','glt_settings');
462
- add_settings_field( 'googlelanguagetranslator_language','Choose the original language of your website','','googlelanguagetranslator_language_cb','glt_settings');
463
- add_settings_field( 'googlelanguagetranslator_language_option','What translation languages will you display to website visitors?','googlelanguagetranslator_language_option_cb','google_language_translator','glt_settings');
464
- add_settings_field( 'language_display_settings','Your language choices','language_display_settings_cb','google_language_translator','glt_settings');
465
- add_settings_field( 'googlelanguagetranslator_flags','Show Flag Images?','googlelanguagetranslator_flags_cb','google_language_translator','glt_settings');
466
- add_settings_field( 'flag_display_settings','Flag Options','flag_display_settings_cb','google_language_translator','glt_settings');
467
- add_settings_field( 'googlelanguagetranslator_translatebox','Show Translate Box?','googlelanguagetranslator_translatebox_cb','google_language_translator','glt_settings');
468
- add_settings_field( 'googlelanguagetranslator_display', 'Layout Options','googlelanguagetranslator_display_cb','google_language_translator','glt_settings');
469
- add_settings_field( 'googlelanguagetranslator_toolbar', 'Show Toolbar','googlelanguagetranslator_toolbar_cb','google_language_translator','glt_settings');
470
- add_settings_field( 'googlelanguagetranslator_showbranding', 'Show Google Branding','googlelanguagetranslator_showbranding_cb','google_language_translator','glt_settings');
471
- add_settings_field( 'googlelanguagetranslator_flags_alignment', 'Align Flags Right or Left', 'googlelanguagetranslator_flags_alignment_cb','google_language_translator','glt_settings');
472
- add_settings_field( 'googlelanguagetranslator_analytics','Activate Google Analytics tracking?','googlelanguagetranslator_analytics_cb','google_language_translator','glt_settings');
473
- add_settings_field( 'googlelanguagetranslator_analytics_id','Enter your Google Analytics ID','googlelanguagetranslator_analytics_id_cb','google_language_translator','glt_settings');
474
- add_settings_field( 'googlelanguagetranslator_css','Custom CSS Overrides','googlelanguagetranslator_css_cb','google_language_translator','glt_settings');
475
- add_settings_field( 'googlelanguagetranslator_manage_translations','Turn on translation management?','googlelanguagetranslator_manage_translations_cb','google_language_translator','glt_settings');
476
- add_settings_field( 'googlelanguagetranslator_multilanguage','Multilanguage webpages?','googlelanguagetranslator_multilanguage_cb','google_language_translator','glt_settings');
477
- add_settings_field( 'googlelanguagetranslator_floating_widget','Show floating translation widget?','googlelanguagetranslator_floating_widget_cb','google_language_translator','glt_settings');
478
- add_settings_field( 'googlelanguagetranslator_flag_size','Flag sizes:','googlelanguagetranslator_flag_size_cb','google_language_translator','glt_settings');
479
- add_settings_field( 'googlelanguagetranslator_flags_order','The order of flag positions','googlelanguagetranslator_flags_order_cb','google_language_translator','glt_settings');
480
-
481
- //Register Fieldset 1
482
- register_setting( 'google_language_translator','googlelanguagetranslator_active');
483
- register_setting( 'google_language_translator','googlelanguagetranslator_language');
484
- register_setting( 'google_language_translator','googlelanguagetranslator_language_option');
485
- register_setting( 'google_language_translator','language_display_settings');
486
- register_setting( 'google_language_translator','googlelanguagetranslator_flags');
487
- register_setting( 'google_language_translator','flag_display_settings');
488
- register_setting( 'google_language_translator','googlelanguagetranslator_translatebox');
489
- register_setting( 'google_language_translator','googlelanguagetranslator_display');
490
- register_setting( 'google_language_translator','googlelanguagetranslator_toolbar');
491
- register_setting( 'google_language_translator','googlelanguagetranslator_showbranding');
492
- register_setting( 'google_language_translator','googlelanguagetranslator_flags_alignment');
493
- register_setting( 'google_language_translator','googlelanguagetranslator_disable_mootools');
494
- register_setting( 'google_language_translator','googlelanguagetranslator_disable_modal');
495
- register_setting( 'google_language_translator','googlelanguagetranslator_analytics');
496
- register_setting( 'google_language_translator','googlelanguagetranslator_analytics_id');
497
- register_setting( 'google_language_translator','googlelanguagetranslator_css');
498
- register_setting( 'google_language_translator','googlelanguagetranslator_manage_translations');
499
- register_setting( 'google_language_translator','googlelanguagetranslator_multilanguage');
500
- register_setting( 'google_language_translator','googlelanguagetranslator_floating_widget');
501
- register_setting( 'google_language_translator','googlelanguagetranslator_flag_size');
502
- register_setting( 'google_language_translator','googlelanguagetranslator_flags_order');
503
- }
504
-
505
- public function googlelanguagetranslator_active_cb() {
506
-
507
- $option_name = 'googlelanguagetranslator_active' ;
508
- $new_value = 1;
509
-
510
- if ( get_option( $option_name ) === false ) {
511
-
512
- // The option does not exist, so we update it.
513
- update_option( $option_name, $new_value );
514
- }
515
-
516
- $options = get_option (''.$option_name.'');
517
-
518
- $html = '<input type="checkbox" name="googlelanguagetranslator_active" id="googlelanguagetranslator_active" value="1" '.checked(1,$options,false).'/> &nbsp; Activate Google Language Translator?';
519
- echo $html;
520
- }
521
-
522
- public function googlelanguagetranslator_language_cb() {
523
-
524
- $option_name = 'googlelanguagetranslator_language';
525
- $new_value = 'en';
526
-
527
- if ( get_option( $option_name ) === false ) {
528
-
529
- // The option does not exist, so we update it.
530
- update_option( $option_name, $new_value );
531
- }
532
-
533
- $options = get_option (''.$option_name.''); ?>
534
- <select name="googlelanguagetranslator_language" id="googlelanguagetranslator_language">
535
- <option value="af" <?php if($options=='af'){echo "selected";}?>>Afrikaans</option>
536
- <option value="sq" <?php if($options=='sq'){echo "selected";}?>>Albanian</option>
537
- <option value="ar" <?php if($options=='ar'){echo "selected";}?>>Arabic</option>
538
- <option value="hy" <?php if($options=='hy'){echo "selected";}?>>Armenian</option>
539
- <option value="az" <?php if($options=='az'){echo "selected";}?>>Azerbaijani</option>
540
- <option value="eu" <?php if($options=='eu'){echo "selected";}?>>Basque</option>
541
- <option value="be" <?php if($options=='be'){echo "selected";}?>>Belarusian</option>
542
- <option value="bn" <?php if($options=='bn'){echo "selected";}?>>Bengali</option>
543
- <option value="bs" <?php if($options=='bs'){echo "selected";}?>>Bosnian</option>
544
- <option value="bg" <?php if($options=='bg'){echo "selected";}?>>Bulgarian</option>
545
- <option value="ca" <?php if($options=='ca'){echo "selected";}?>>Catalan</option>
546
- <option value="ceb" <?php if($options=='ceb'){echo "selected";}?>>Cebuano</option>
547
- <option value="zh-CN" <?php if($options=='zh-CN'){echo "selected";}?>>Chinese</option>
548
- <option value="zh-TW" <?php if($options=='zh-TW'){echo "selected";}?>>Chinese (Han)</option>
549
- <option value="hr" <?php if($options=='hr'){echo "selected";}?>>Croatian</option>
550
- <option value="cs" <?php if($options=='cs'){echo "selected";}?>>Czech</option>
551
- <option value="da" <?php if($options=='da'){echo "selected";}?>>Danish</option>
552
- <option value="nl" <?php if($options=='nl'){echo "selected";}?>>Dutch</option>
553
- <option value="en" <?php if($options=='en'){echo "selected";}?>>English</option>
554
- <option value="eo" <?php if($options=='eo'){echo "selected";}?>>Esperanto</option>
555
- <option value="et" <?php if($options=='et'){echo "selected";}?>>Estonian</option>
556
- <option value="tl" <?php if($options=='tl'){echo "selected";}?>>Filipino</option>
557
- <option value="fi" <?php if($options=='fi'){echo "selected";}?>>Finnish</option>
558
- <option value="fr" <?php if($options=='fr'){echo "selected";}?>>French</option>
559
- <option value="gl" <?php if($options=='gl'){echo "selected";}?>>Galician</option>
560
- <option value="ka" <?php if($options=='ka'){echo "selected";}?>>Georgian</option>
561
- <option value="de" <?php if($options=='de'){echo "selected";}?>>German</option>
562
- <option value="el" <?php if($options=='el'){echo "selected";}?>>Greek</option>
563
- <option value="gu" <?php if($options=='gu'){echo "selected";}?>>Gujarati</option>
564
- <option value="ht" <?php if($options=='ht'){echo "selected";}?>>Haitian Creole</option>
565
- <option value="ha" <?php if($options=='ha'){echo "selected";}?>>Hausa</option>
566
- <option value="iw" <?php if($options=='iw'){echo "selected";}?>>Hebrew</option>
567
- <option value="hi" <?php if($options=='hi'){echo "selected";}?>>Hindi</option>
568
- <option value="hmn" <?php if($options=='hmn'){echo "selected";}?>>Hmong</option>
569
- <option value="hu" <?php if($options=='hu'){echo "selected";}?>>Hungarian</option>
570
- <option value="is" <?php if($options=='is'){echo "selected";}?>>Icelandic</option>
571
- <option value="ig" <?php if($options=='ig'){echo "selected";}?>>Igbo</option>
572
- <option value="id" <?php if($options=='id'){echo "selected";}?>>Indonesian</option>
573
- <option value="ga" <?php if($options=='ga'){echo "selected";}?>>Irish</option>
574
- <option value="it" <?php if($options=='it'){echo "selected";}?>>Italian</option>
575
- <option value="ja" <?php if($options=='ja'){echo "selected";}?>>Japanese</option>
576
- <option value="jw" <?php if($options=='jw'){echo "selected";}?>>Javanese</option>
577
- <option value="kn" <?php if($options=='kn'){echo "selected";}?>>Kannada</option>
578
- <option value="km" <?php if($options=='km'){echo "selected";}?>>Khmer</option>
579
- <option value="ko" <?php if($options=='ko'){echo "selected";}?>>Korean</option>
580
- <option value="lo" <?php if($options=='lo'){echo "selected";}?>>Lao</option>
581
- <option value="la" <?php if($options=='la'){echo "selected";}?>>Latin</option>
582
- <option value="lv" <?php if($options=='lv'){echo "selected";}?>>Latvian</option>
583
- <option value="lt" <?php if($options=='lt'){echo "selected";}?>>Lithuanian</option>
584
- <option value="mk" <?php if($options=='mk'){echo "selected";}?>>Macedonian</option>
585
- <option value="ms" <?php if($options=='ms'){echo "selected";}?>>Malay</option>
586
- <option value="mt" <?php if($options=='mt'){echo "selected";}?>>Maltese</option>
587
- <option value="mi" <?php if($options=='mi'){echo "selected";}?>>Maori</option>
588
- <option value="mr" <?php if($options=='mr'){echo "selected";}?>>Marathi</option>
589
- <option value="mn" <?php if($options=='mn'){echo "selected";}?>>Mongolian</option>
590
- <option value="ne" <?php if($options=='ne'){echo "selected";}?>>Nepali</option>
591
- <option value="no" <?php if($options=='no'){echo "selected";}?>>Norwegian</option>
592
- <option value="fa" <?php if($options=='fa'){echo "selected";}?>>Persian</option>
593
- <option value="pl" <?php if($options=='pl'){echo "selected";}?>>Polish</option>
594
- <option value="pt" <?php if($options=='pt'){echo "selected";}?>>Portuguese</option>
595
- <option value="pa" <?php if($options=='pa'){echo "selected";}?>>Punjabi</option>
596
- <option value="ro" <?php if($options=='ro'){echo "selected";}?>>Romanian</option>
597
- <option value="ru" <?php if($options=='ru'){echo "selected";}?>>Russian</option>
598
- <option value="sr" <?php if($options=='sr'){echo "selected";}?>>Serbian</option>
599
- <option value="sk" <?php if($options=='sk'){echo "selected";}?>>Slovak</option>
600
- <option value="sl" <?php if($options=='sl'){echo "selected";}?>>Slovenian</option>
601
- <option value="so" <?php if($options=='so'){echo "selected";}?>>Somali</option>
602
- <option value="es" <?php if($options=='es'){echo "selected";}?>>Spanish</option>
603
- <option value="sw" <?php if($options=='sw'){echo "selected";}?>>Swahili</option>
604
- <option value="sv" <?php if($options=='sv'){echo "selected";}?>>Swedish</option>
605
- <option value="ta" <?php if($options=='ta'){echo "selected";}?>>Tamil</option>
606
- <option value="te" <?php if($options=='te'){echo "selected";}?>>Telugu</option>
607
- <option value="th" <?php if($options=='th'){echo "selected";}?>>Thai</option>
608
- <option value="tr" <?php if($options=='tr'){echo "selected";}?>>Turkish</option>
609
- <option value="uk" <?php if($options=='uk'){echo "selected";}?>>Ukranian</option>
610
- <option value="ur" <?php if($options=='ur'){echo "selected";}?>>Urdu</option>
611
- <option value="vi" <?php if($options=='vi'){echo "selected";}?>>Vietnamese</option>
612
- <option value="cy" <?php if($options=='cy'){echo "selected";}?>>Welsh</option>
613
- <option value="yi" <?php if($options=='yi'){echo "selected";}?>>Yiddish</option>
614
- <option value="cy" <?php if($options=='cy'){echo "selected";}?>>Yoruba</option>
615
- <option value="yi" <?php if($options=='yi'){echo "selected";}?>>Zulu</option>
616
-
617
- </select>
618
- <?php
619
- }
620
-
621
- public function googlelanguagetranslator_language_option_cb() {
622
-
623
- $option_name = 'googlelanguagetranslator_language_option' ;
624
- $new_value = 'all';
625
-
626
- if ( get_option( $option_name ) === false ) {
627
-
628
- // The option does not exist, so we update it.
629
- update_option( $option_name, $new_value );
630
- }
631
-
632
- $options = get_option (''.$option_name.''); ?>
633
-
634
- <input type="radio" name="googlelanguagetranslator_language_option" id="googlelanguagetranslator_language_option" value="all" <?php if($options=='all'){echo "checked";}?>/> All Languages<br/>
635
- <input type="radio" name="googlelanguagetranslator_language_option" id="googlelanguagetranslator_language_option" value="specific" <?php if($options=='specific'){echo "checked";}?>/> Specific Languages
636
- <?php
637
- }
638
-
639
- public function language_display_settings_cb() {
640
- $defaults = array (
641
- 'en' => 1
642
- );
643
-
644
- $option_name = 'language_display_settings' ;
645
- $new_value = $defaults;
646
-
647
- if ( get_option( $option_name ) === false ) {
648
-
649
- // The option does not exist, so we update it.
650
- update_option( $option_name, $new_value );
651
- }
652
-
653
- $get_language_choices = get_option (''.$option_name.'');
654
-
655
- if (!isset ( $get_language_choices ['af'] ) ) {
656
- $get_language_choices['af'] = 0;
657
- }
658
-
659
- if (!isset ( $get_language_choices ['sq'] ) ) {
660
- $get_language_choices['sq'] = 0;
661
- }
662
-
663
- if (!isset ( $get_language_choices ['ar'] ) ) {
664
- $get_language_choices['ar'] = 0;
665
- }
666
-
667
- if (!isset ( $get_language_choices ['hy'] ) ) {
668
- $get_language_choices['hy'] = 0;
669
- }
670
-
671
- if (!isset ( $get_language_choices ['az'] ) ) {
672
- $get_language_choices['az'] = 0;
673
- }
674
-
675
- if (!isset ( $get_language_choices ['eu'] ) ) {
676
- $get_language_choices['eu'] = 0;
677
- }
678
-
679
- if (!isset ( $get_language_choices ['be'] ) ) {
680
- $get_language_choices['be'] = 0;
681
- }
682
-
683
- if (!isset ( $get_language_choices ['bn'] ) ) {
684
- $get_language_choices['bn'] = 0;
685
- }
686
-
687
- if (!isset ( $get_language_choices ['bs'] ) ) {
688
- $get_language_choices['bs'] = 0;
689
- }
690
-
691
- if (!isset ( $get_language_choices ['bg'] ) ) {
692
- $get_language_choices['bg'] = 0;
693
- }
694
-
695
- if (!isset ( $get_language_choices ['ca'] ) ) {
696
- $get_language_choices['ca'] = 0;
697
- }
698
-
699
- if (!isset ( $get_language_choices ['ceb'] ) ) {
700
- $get_language_choices['ceb'] = 0;
701
- }
702
-
703
- if (!isset ( $get_language_choices ['zh-CN'] ) ) {
704
- $get_language_choices['zh-CN'] = 0;
705
- }
706
-
707
- if (!isset ( $get_language_choices ['zh-TW'] ) ) {
708
- $get_language_choices['zh-TW'] = 0;
709
- }
710
-
711
- if (!isset ( $get_language_choices ['hr'] ) ) {
712
- $get_language_choices['hr'] = 0;
713
- }
714
-
715
- if (!isset ( $get_language_choices ['cs'] ) ) {
716
- $get_language_choices['cs'] = 0;
717
- }
718
-
719
- if (!isset ( $get_language_choices ['da'] ) ) {
720
- $get_language_choices['da'] = 0;
721
- }
722
-
723
- if (!isset ( $get_language_choices ['nl'] ) ) {
724
- $get_language_choices['nl'] = 0;
725
- }
726
-
727
- if (!isset ( $get_language_choices ['en'] ) ) {
728
- $get_language_choices['en'] = 1;
729
- }
730
-
731
- if (!isset ( $get_language_choices ['eo'] ) ) {
732
- $get_language_choices['eo'] = 0;
733
- }
734
-
735
- if (!isset ( $get_language_choices ['et'] ) ) {
736
- $get_language_choices['et'] = 0;
737
- }
738
-
739
- if (!isset ( $get_language_choices ['tl'] ) ) {
740
- $get_language_choices['tl'] = 0;
741
- }
742
-
743
- if (!isset ( $get_language_choices ['fi'] ) ) {
744
- $get_language_choices['fi'] = 0;
745
- }
746
-
747
- if (!isset ( $get_language_choices ['fr'] ) ) {
748
- $get_language_choices['fr'] = 0;
749
- }
750
-
751
- if (!isset ( $get_language_choices ['gl'] ) ) {
752
- $get_language_choices['gl'] = 0;
753
- }
754
-
755
- if (!isset ( $get_language_choices ['ka'] ) ) {
756
- $get_language_choices['ka'] = 0;
757
- }
758
-
759
- if (!isset ( $get_language_choices ['de'] ) ) {
760
- $get_language_choices['de'] = 0;
761
- }
762
-
763
- if (!isset ( $get_language_choices ['el'] ) ) {
764
- $get_language_choices['el'] = 0;
765
- }
766
-
767
- if (!isset ( $get_language_choices ['gu'] ) ) {
768
- $get_language_choices['gu'] = 0;
769
- }
770
-
771
- if (!isset ( $get_language_choices ['ht'] ) ) {
772
- $get_language_choices['ht'] = 0;
773
- }
774
-
775
- if (!isset ( $get_language_choices ['ha'] ) ) {
776
- $get_language_choices['ha'] = 0;
777
- }
778
-
779
- if (!isset ( $get_language_choices ['iw'] ) ) {
780
- $get_language_choices['iw'] = 0;
781
- }
782
-
783
- if (!isset ( $get_language_choices ['hi'] ) ) {
784
- $get_language_choices['hi'] = 0;
785
- }
786
-
787
- if (!isset ( $get_language_choices ['hmn'] ) ) {
788
- $get_language_choices['hmn'] = 0;
789
- }
790
-
791
- if (!isset ( $get_language_choices ['hu'] ) ) {
792
- $get_language_choices['hu'] = 0;
793
- }
794
-
795
- if (!isset ( $get_language_choices ['is'] ) ) {
796
- $get_language_choices['is'] = 0;
797
- }
798
-
799
- if (!isset ( $get_language_choices ['ig'] ) ) {
800
- $get_language_choices['ig'] = 0;
801
- }
802
-
803
- if (!isset ( $get_language_choices ['id'] ) ) {
804
- $get_language_choices['id'] = 0;
805
- }
806
-
807
- if (!isset ( $get_language_choices ['ga'] ) ) {
808
- $get_language_choices['ga'] = 0;
809
- }
810
-
811
- if (!isset ( $get_language_choices ['it'] ) ) {
812
- $get_language_choices['it'] = 0;
813
- }
814
-
815
- if (!isset ( $get_language_choices ['ja'] ) ) {
816
- $get_language_choices['ja'] = 0;
817
- }
818
-
819
- if (!isset ( $get_language_choices ['jw'] ) ) {
820
- $get_language_choices['jw'] = 0;
821
- }
822
-
823
- if (!isset ( $get_language_choices ['kn'] ) ) {
824
- $get_language_choices['kn'] = 0;
825
- }
826
-
827
- if (!isset ( $get_language_choices ['km'] ) ) {
828
- $get_language_choices['km'] = 0;
829
- }
830
-
831
- if (!isset ( $get_language_choices ['ko'] ) ) {
832
- $get_language_choices['ko'] = 0;
833
- }
834
-
835
- if (!isset ( $get_language_choices ['lo'] ) ) {
836
- $get_language_choices['lo'] = 0;
837
- }
838
-
839
- if (!isset ( $get_language_choices ['la'] ) ) {
840
- $get_language_choices['la'] = 0;
841
- }
842
-
843
- if (!isset ( $get_language_choices ['lv'] ) ) {
844
- $get_language_choices['lv'] = 0;
845
- }
846
-
847
- if (!isset ( $get_language_choices ['lt'] ) ) {
848
- $get_language_choices['lt'] = 0;
849
- }
850
-
851
- if (!isset ( $get_language_choices ['mk'] ) ) {
852
- $get_language_choices['mk'] = 0;
853
- }
854
-
855
- if (!isset ( $get_language_choices ['ms'] ) ) {
856
- $get_language_choices['ms'] = 0;
857
- }
858
-
859
- if (!isset ( $get_language_choices ['mt'] ) ) {
860
- $get_language_choices['mt'] = 0;
861
- }
862
-
863
- if (!isset ( $get_language_choices ['mi'] ) ) {
864
- $get_language_choices['mi'] = 0;
865
- }
866
-
867
- if (!isset ( $get_language_choices ['mr'] ) ) {
868
- $get_language_choices['mr'] = 0;
869
- }
870
-
871
- if (!isset ( $get_language_choices ['mn'] ) ) {
872
- $get_language_choices['mn'] = 0;
873
- }
874
-
875
- if (!isset ( $get_language_choices ['ne'] ) ) {
876
- $get_language_choices['ne'] = 0;
877
- }
878
-
879
- if (!isset ( $get_language_choices ['no'] ) ) {
880
- $get_language_choices['no'] = 0;
881
- }
882
-
883
- if (!isset ( $get_language_choices ['fa'] ) ) {
884
- $get_language_choices['fa'] = 0;
885
- }
886
-
887
- if (!isset ( $get_language_choices ['pl'] ) ) {
888
- $get_language_choices['pl'] = 0;
889
- }
890
-
891
- if (!isset ( $get_language_choices ['pt'] ) ) {
892
- $get_language_choices['pt'] = 0;
893
- }
894
-
895
- if (!isset ( $get_language_choices ['pa'] ) ) {
896
- $get_language_choices['pa'] = 0;
897
- }
898
-
899
- if (!isset ( $get_language_choices ['ro'] ) ) {
900
- $get_language_choices['ro'] = 0;
901
- }
902
-
903
- if (!isset ( $get_language_choices ['ru'] ) ) {
904
- $get_language_choices['ru'] = 0;
905
- }
906
-
907
- if (!isset ( $get_language_choices ['sr'] ) ) {
908
- $get_language_choices['sr'] = 0;
909
- }
910
-
911
- if (!isset ( $get_language_choices ['sk'] ) ) {
912
- $get_language_choices['sk'] = 0;
913
- }
914
-
915
- if (!isset ( $get_language_choices ['sl'] ) ) {
916
- $get_language_choices['sl'] = 0;
917
- }
918
-
919
- if (!isset ( $get_language_choices ['so'] ) ) {
920
- $get_language_choices['so'] = 0;
921
- }
922
-
923
- if (!isset ( $get_language_choices ['es'] ) ) {
924
- $get_language_choices['es'] = 0;
925
- }
926
-
927
- if (!isset ( $get_language_choices ['sw'] ) ) {
928
- $get_language_choices['sw'] = 0;
929
- }
930
-
931
- if (!isset ( $get_language_choices ['sv'] ) ) {
932
- $get_language_choices['sv'] = 0;
933
- }
934
-
935
- if (!isset ( $get_language_choices ['ta'] ) ) {
936
- $get_language_choices['ta'] = 0;
937
- }
938
-
939
- if (!isset ( $get_language_choices ['te'] ) ) {
940
- $get_language_choices['te'] = 0;
941
- }
942
-
943
- if (!isset ( $get_language_choices ['th'] ) ) {
944
- $get_language_choices['th'] = 0;
945
- }
946
-
947
- if (!isset ( $get_language_choices ['tr'] ) ) {
948
- $get_language_choices['tr'] = 0;
949
- }
950
-
951
- if (!isset ( $get_language_choices ['uk'] ) ) {
952
- $get_language_choices['uk'] = 0;
953
- }
954
-
955
- if (!isset ( $get_language_choices ['ur'] ) ) {
956
- $get_language_choices['ur'] = 0;
957
- }
958
-
959
- if (!isset ( $get_language_choices ['vi'] ) ) {
960
- $get_language_choices['vi'] = 0;
961
- }
962
-
963
- if (!isset ( $get_language_choices ['cy'] ) ) {
964
- $get_language_choices['cy'] = 0;
965
- }
966
-
967
- if (!isset ( $get_language_choices ['yi'] ) ) {
968
- $get_language_choices['yi'] = 0;
969
- }
970
-
971
- if (!isset ( $get_language_choices ['yo'] ) ) {
972
- $get_language_choices['yo'] = 0;
973
- }
974
-
975
- if (!isset ( $get_language_choices ['zu'] ) ) {
976
- $get_language_choices['zu'] = 0;
977
- } ?>
978
-
979
- <div class="languages" style="width:25%; float:left">
980
- <div><input type="checkbox" name="language_display_settings[af]" value="1" <?php if ( 1 == $get_language_choices['af'] ) echo 'checked="checked"'; ?>/> Afrikaans</div>
981
- <div><input type="checkbox" name="language_display_settings[sq]" value="1" <?php if ( 1 == $get_language_choices['sq'] ) echo 'checked="checked"'; ?>/> Albanian</div>
982
- <div><input type="checkbox" name="language_display_settings[ar]" value="1" <?php if ( 1 == $get_language_choices['ar'] ) echo 'checked="checked"'; ?>/> Arabic</div>
983
- <div><input type="checkbox" name="language_display_settings[hy]" value="1" <?php if ( 1 == $get_language_choices['hy'] ) echo 'checked="checked"'; ?>/> Armenian</div>
984
- <div><input type="checkbox" name="language_display_settings[az]" value="1" <?php if ( 1 == $get_language_choices['az'] ) echo 'checked="checked"'; ?>/> Azerbaijani</div>
985
- <div><input type="checkbox" name="language_display_settings[eu]" value="1" <?php if ( 1 == $get_language_choices['eu'] ) echo 'checked="checked"'; ?>/> Basque</div>
986
- <div><input type="checkbox" name="language_display_settings[be]" value="1" <?php if ( 1 == $get_language_choices['be'] ) echo 'checked="checked"'; ?>/> Belarusian</div>
987
- <div><input type="checkbox" name="language_display_settings[bn]" value="1" <?php if ( 1 == $get_language_choices['bn'] ) echo 'checked="checked"'; ?>/> Bengali</div>
988
- <div><input type="checkbox" name="language_display_settings[bs]" value="1" <?php if ( 1 == $get_language_choices['bs'] ) echo 'checked="checked"'; ?>/> Bosnian</div>
989
- <div><input type="checkbox" name="language_display_settings[bg]" value="1" <?php if ( 1 == $get_language_choices['bg'] ) echo 'checked="checked"'; ?>/> Bulgarian</div>
990
- <div><input type="checkbox" name="language_display_settings[ca]" value="1" <?php if ( 1 == $get_language_choices['ca'] ) echo 'checked="checked"'; ?>/> Catalan</div>
991
- <div><input type="checkbox" name="language_display_settings[ceb]" value="1" <?php if ( 1 == $get_language_choices['ceb'] ) echo 'checked="checked"'; ?>/> Cebuano</div>
992
- <div><input type="checkbox" name="language_display_settings[zh-CN]" value="1" <?php if ( 1 == $get_language_choices['zh-CN'] ) echo 'checked="checked"'; ?>/> Chinese</div>
993
- <div><input type="checkbox" name="language_display_settings[zh-TW]" value="1" <?php if ( 1 == $get_language_choices['zh-TW'] ) echo 'checked="checked"'; ?>/> Chinese (Han)</div>
994
- <div><input type="checkbox" name="language_display_settings[hr]" value="1" <?php if ( 1 == $get_language_choices['hr'] ) echo 'checked="checked"'; ?>/> Croatian</div>
995
- <div><input type="checkbox" name="language_display_settings[cs]" value="1" <?php if ( 1 == $get_language_choices['cs'] ) echo 'checked="checked"'; ?>/> Czech</div>
996
- <div><input type="checkbox" name="language_display_settings[da]" value="1" <?php if ( 1 == $get_language_choices['da'] ) echo 'checked="checked"'; ?>/> Danish</div>
997
- <div><input type="checkbox" name="language_display_settings[nl]" value="1" <?php if ( 1 == $get_language_choices['nl'] ) echo 'checked="checked"'; ?>/> Dutch</div>
998
- <div><input type="checkbox" name="language_display_settings[en]" value="1" <?php if ( 1 == $get_language_choices['en'] ) echo 'checked="checked"'; ?>/> English</div>
999
- <div><input type="checkbox" name="language_display_settings[eo]" value="1" <?php if ( 1 == $get_language_choices['eo'] ) echo 'checked="checked"'; ?>/> Esperanto</div>
1000
- <div><input type="checkbox" name="language_display_settings[et]" value="1" <?php if ( 1 == $get_language_choices['et'] ) echo 'checked="checked"'; ?>/> Estonian</div>
1001
- </div>
1002
-
1003
- <div class="languages" style="width:25%; float:left">
1004
- <div><input type="checkbox" name="language_display_settings[tl]" value="1" <?php if ( 1 == $get_language_choices['tl'] ) echo 'checked="checked"'; ?>/> Filipino</div>
1005
- <div><input type="checkbox" name="language_display_settings[fi]" value="1" <?php if ( 1 == $get_language_choices['fi'] ) echo 'checked="checked"'; ?>/> Finnish</div>
1006
- <div><input type="checkbox" name="language_display_settings[fr]" value="1" <?php if ( 1 == $get_language_choices['fr'] ) echo 'checked="checked"'; ?>/> French</div>
1007
- <div><input type="checkbox" name="language_display_settings[gl]" value="1" <?php if ( 1 == $get_language_choices['gl'] ) echo 'checked="checked"'; ?>/> Galician</div>
1008
- <div><input type="checkbox" name="language_display_settings[ka]" value="1" <?php if ( 1 == $get_language_choices['ka'] ) echo 'checked="checked"'; ?>/> Georgian</div>
1009
- <div><input type="checkbox" name="language_display_settings[de]" value="1" <?php if ( 1 == $get_language_choices['de'] ) echo 'checked="checked"'; ?>/> German</div>
1010
- <div><input type="checkbox" name="language_display_settings[el]" value="1" <?php if ( 1 == $get_language_choices['el'] ) echo 'checked="checked"'; ?>/> Greek</div>
1011
- <div><input type="checkbox" name="language_display_settings[gu]" value="1" <?php if ( 1 == $get_language_choices['gu'] ) echo 'checked="checked"'; ?>/> Gujarati</div>
1012
- <div><input type="checkbox" name="language_display_settings[ht]" value="1" <?php if ( 1 == $get_language_choices['ht'] ) echo 'checked="checked"'; ?>/> Haitian Creole</div>
1013
- <div><input type="checkbox" name="language_display_settings[ha]" value="1" <?php if ( 1 == $get_language_choices['ha'] ) echo 'checked="checked"'; ?>/> Hausa</div>
1014
- <div><input type="checkbox" name="language_display_settings[iw]" value="1" <?php if ( 1 == $get_language_choices['iw'] ) echo 'checked="checked"'; ?>/> Hebrew</div>
1015
- <div><input type="checkbox" name="language_display_settings[hi]" value="1" <?php if ( 1 == $get_language_choices['hi'] ) echo 'checked="checked"'; ?>/> Hindi</div>
1016
- <div><input type="checkbox" name="language_display_settings[hmn]" value="1" <?php if ( 1 == $get_language_choices['hmn'] ) echo 'checked="checked"'; ?>/> Hmong</div>
1017
- <div><input type="checkbox" name="language_display_settings[hu]" value="1" <?php if ( 1 == $get_language_choices['hu'] ) echo 'checked="checked"'; ?>/> Hungarian</div>
1018
- <div><input type="checkbox" name="language_display_settings[is]" value="1" <?php if ( 1 == $get_language_choices['is'] ) echo 'checked="checked"'; ?>/> Icelandic</div>
1019
- <div><input type="checkbox" name="language_display_settings[ig]" value="1" <?php if ( 1 == $get_language_choices['ig'] ) echo 'checked="checked"'; ?>/> Igbo</div>
1020
- <div><input type="checkbox" name="language_display_settings[id]" value="1" <?php if ( 1 == $get_language_choices['id'] ) echo 'checked="checked"'; ?>/> Indonesian</div>
1021
- <div><input type="checkbox" name="language_display_settings[ga]" value="1" <?php if ( 1 == $get_language_choices['ga'] ) echo 'checked="checked"'; ?>/> Irish</div>
1022
- <div><input type="checkbox" name="language_display_settings[it]" value="1" <?php if ( 1 == $get_language_choices['it'] ) echo 'checked="checked"'; ?>/> Italian</div>
1023
- <div><input type="checkbox" name="language_display_settings[ja]" value="1" <?php if ( 1 == $get_language_choices['ja'] ) echo 'checked="checked"'; ?>/> Japanese</div>
1024
- <div><input type="checkbox" name="language_display_settings[jw]" value="1" <?php if ( 1 == $get_language_choices['jw'] ) echo 'checked="checked"'; ?>/> Javanese</div>
1025
- </div>
1026
-
1027
- <div class="languages" style="width:25%; float:left">
1028
- <div><input type="checkbox" name="language_display_settings[kn]" value="1" <?php if ( 1 == $get_language_choices['kn'] ) echo 'checked="checked"'; ?>/> Kannada</div>
1029
- <div><input type="checkbox" name="language_display_settings[km]" value="1" <?php if ( 1 == $get_language_choices['km'] ) echo 'checked="checked"'; ?>/> Khmer</div>
1030
- <div><input type="checkbox" name="language_display_settings[ko]" value="1" <?php if ( 1 == $get_language_choices['ko'] ) echo 'checked="checked"'; ?>/> Korean</div>
1031
- <div><input type="checkbox" name="language_display_settings[lo]" value="1" <?php if ( 1 == $get_language_choices['lo'] ) echo 'checked="checked"'; ?>/> Lao</div>
1032
- <div><input type="checkbox" name="language_display_settings[la]" value="1" <?php if ( 1 == $get_language_choices['la'] ) echo 'checked="checked"'; ?>/> Latin</div>
1033
- <div><input type="checkbox" name="language_display_settings[lv]" value="1" <?php if ( 1 == $get_language_choices['lv'] ) echo 'checked="checked"'; ?>/> Latvian</div>
1034
- <div><input type="checkbox" name="language_display_settings[lt]" value="1" <?php if ( 1 == $get_language_choices['lt'] ) echo 'checked="checked"'; ?>/> Lithuanian</div>
1035
- <div><input type="checkbox" name="language_display_settings[mk]" value="1" <?php if ( 1 == $get_language_choices['mk'] ) echo 'checked="checked"'; ?>/> Macedonian</div>
1036
- <div><input type="checkbox" name="language_display_settings[ms]" value="1" <?php if ( 1 == $get_language_choices['ms'] ) echo 'checked="checked"'; ?>/> Malay</div>
1037
- <div><input type="checkbox" name="language_display_settings[mt]" value="1" <?php if ( 1 == $get_language_choices['mt'] ) echo 'checked="checked"'; ?>/> Maltese</div>
1038
- <div><input type="checkbox" name="language_display_settings[mi]" value="1" <?php if ( 1 == $get_language_choices['mi'] ) echo 'checked="checked"'; ?>/> Maori</div>
1039
- <div><input type="checkbox" name="language_display_settings[mr]" value="1" <?php if ( 1 == $get_language_choices['mr'] ) echo 'checked="checked"'; ?>/> Marathi</div>
1040
- <div><input type="checkbox" name="language_display_settings[mn]" value="1" <?php if ( 1 == $get_language_choices['mn'] ) echo 'checked="checked"'; ?>/> Mongolian</div>
1041
- <div><input type="checkbox" name="language_display_settings[ne]" value="1" <?php if ( 1 == $get_language_choices['ne'] ) echo 'checked="checked"'; ?>/> Nepali</div>
1042
- <div><input type="checkbox" name="language_display_settings[no]" value="1" <?php if ( 1 == $get_language_choices['no'] ) echo 'checked="checked"'; ?>/> Norwegian</div>
1043
- <div><input type="checkbox" name="language_display_settings[fa]" value="1" <?php if ( 1 == $get_language_choices['fa'] ) echo 'checked="checked"'; ?>/> Persian</div>
1044
- <div><input type="checkbox" name="language_display_settings[pl]" value="1" <?php if ( 1 == $get_language_choices['pl'] ) echo 'checked="checked"'; ?>/> Polish</div>
1045
- <div><input type="checkbox" name="language_display_settings[pt]" value="1" <?php if ( 1 == $get_language_choices['pt'] ) echo 'checked="checked"'; ?>/> Portuguese</div>
1046
- <div><input type="checkbox" name="language_display_settings[pa]" value="1" <?php if ( 1 == $get_language_choices['pa'] ) echo 'checked="checked"'; ?>/> Punjabi</div>
1047
- <div><input type="checkbox" name="language_display_settings[ro]" value="1" <?php if ( 1 == $get_language_choices['ro'] ) echo 'checked="checked"'; ?>/> Romanian</div>
1048
- <div><input type="checkbox" name="language_display_settings[ru]" value="1" <?php if ( 1 == $get_language_choices['ru'] ) echo 'checked="checked"'; ?>/> Russian</div>
1049
- </div>
1050
-
1051
- <div class="languages" style="width:25%; float:left">
1052
- <div><input type="checkbox" name="language_display_settings[sr]" value="1" <?php if ( 1 == $get_language_choices['sr'] ) echo 'checked="checked"'; ?>/> Serbian</div>
1053
- <div><input type="checkbox" name="language_display_settings[sk]" value="1" <?php if ( 1 == $get_language_choices['sk'] ) echo 'checked="checked"'; ?>/> Slovak</div>
1054
- <div><input type="checkbox" name="language_display_settings[sl]" value="1" <?php if ( 1 == $get_language_choices['sl'] ) echo 'checked="checked"'; ?>/> Slovenian</div>
1055
- <div><input type="checkbox" name="language_display_settings[so]" value="1" <?php if ( 1 == $get_language_choices['so'] ) echo 'checked="checked"'; ?>/> Somali</div>
1056
- <div><input type="checkbox" name="language_display_settings[es]" value="1" <?php if ( 1 == $get_language_choices['es'] ) echo 'checked="checked"'; ?>/> Spanish</div>
1057
- <div><input type="checkbox" name="language_display_settings[sw]" value="1" <?php if ( 1 == $get_language_choices['sw'] ) echo 'checked="checked"'; ?>/> Swahili</div>
1058
- <div><input type="checkbox" name="language_display_settings[sv]" value="1" <?php if ( 1 == $get_language_choices['sv'] ) echo 'checked="checked"'; ?>/> Swedish</div>
1059
- <div><input type="checkbox" name="language_display_settings[ta]" value="1" <?php if ( 1 == $get_language_choices['ta'] ) echo 'checked="checked"'; ?>/> Tamil</div>
1060
- <div><input type="checkbox" name="language_display_settings[te]" value="1" <?php if ( 1 == $get_language_choices['te'] ) echo 'checked="checked"'; ?>/> Telugu</div>
1061
- <div><input type="checkbox" name="language_display_settings[th]" value="1" <?php if ( 1 == $get_language_choices['th'] ) echo 'checked="checked"'; ?>/> Thai</div>
1062
- <div><input type="checkbox" name="language_display_settings[tr]" value="1" <?php if ( 1 == $get_language_choices['tr'] ) echo 'checked="checked"'; ?>/> Turkish</div>
1063
- <div><input type="checkbox" name="language_display_settings[uk]" value="1" <?php if ( 1 == $get_language_choices['uk'] ) echo 'checked="checked"'; ?>/> Ukranian</div>
1064
- <div><input type="checkbox" name="language_display_settings[ur]" value="1" <?php if ( 1 == $get_language_choices['ur'] ) echo 'checked="checked"'; ?>/> Urdu</div>
1065
- <div><input type="checkbox" name="language_display_settings[vi]" value="1" <?php if ( 1 == $get_language_choices['vi'] ) echo 'checked="checked"'; ?>/> Vietnamese</div>
1066
- <div><input type="checkbox" name="language_display_settings[cy]" value="1" <?php if ( 1 == $get_language_choices['cy'] ) echo 'checked="checked"'; ?>/> Welsh</div>
1067
- <div><input type="checkbox" name="language_display_settings[yi]" value="1" <?php if ( 1 == $get_language_choices['yi'] ) echo 'checked="checked"'; ?>/> Yiddish</div>
1068
- <div><input type="checkbox" name="language_display_settings[yo]" value="1" <?php if ( 1 == $get_language_choices['yo'] ) echo 'checked="checked"'; ?>/> Yoruba</div>
1069
- <div><input type="checkbox" name="language_display_settings[zu]" value="1" <?php if ( 1 == $get_language_choices['zu'] ) echo 'checked="checked"'; ?>/> Zulu</div>
1070
-
1071
- </div>
1072
-
1073
- <div style="clear:both"></div>
1074
- <?php }
1075
-
1076
- public function googlelanguagetranslator_flags_cb() {
1077
-
1078
- $option_name = 'googlelanguagetranslator_flags' ;
1079
- $new_value = 'show_flags';
1080
-
1081
- if ( get_option( $option_name ) === false ) {
1082
-
1083
- // The option does not exist, so we update it.
1084
- update_option( $option_name, $new_value );
1085
- }
1086
-
1087
- $options = get_option (''.$option_name.''); ?>
1088
-
1089
- <input type="radio" name="googlelanguagetranslator_flags" id="googlelanguagetranslator_flags" value="show_flags" <?php if($options=='show_flags'){echo "checked";}?>/> Yes, show flag images<br/>
1090
- <input type="radio" name="googlelanguagetranslator_flags" id="googlelanguagetranslator_flags" value="hide_flags" <?php if($options=='hide_flags'){echo "checked";}?>/> No, hide flag images
1091
- <?php
1092
- }
1093
-
1094
- public function flag_display_settings_cb() {
1095
- $defaults = array(
1096
- 'flag-en' => 1
1097
- );
1098
-
1099
- $option_name = 'flag_display_settings' ;
1100
- $new_value = $defaults;
1101
-
1102
- if ( get_option( $option_name ) === false ) {
1103
-
1104
- // The option does not exist, so we update it.
1105
- update_option( $option_name, $new_value );
1106
- }
1107
-
1108
- $get_flag_choices = get_option (''.$option_name.'');
1109
-
1110
- if (!isset ( $get_flag_choices ['flag-af'] ) ) {
1111
- $get_flag_choices['flag-af'] = 0;
1112
- }
1113
-
1114
- if (!isset ( $get_flag_choices ['flag-sq'] ) ) {
1115
- $get_flag_choices['flag-sq'] = 0;
1116
- }
1117
-
1118
- if (!isset ( $get_flag_choices ['flag-ar'] ) ) {
1119
- $get_flag_choices['flag-ar'] = 0;
1120
- }
1121
-
1122
- if (!isset ( $get_flag_choices ['flag-hy'] ) ) {
1123
- $get_flag_choices['flag-hy'] = 0;
1124
- }
1125
-
1126
- if (!isset ( $get_flag_choices ['flag-az'] ) ) {
1127
- $get_flag_choices['flag-az'] = 0;
1128
- }
1129
-
1130
- if (!isset ( $get_flag_choices ['flag-eu'] ) ) {
1131
- $get_flag_choices['flag-eu'] = 0;
1132
- }
1133
-
1134
- if (!isset ( $get_flag_choices ['flag-be'] ) ) {
1135
- $get_flag_choices['flag-be'] = 0;
1136
- }
1137
-
1138
- if (!isset ( $get_flag_choices ['flag-bn'] ) ) {
1139
- $get_flag_choices['flag-bn'] = 0;
1140
- }
1141
-
1142
- if (!isset ( $get_flag_choices ['flag-bs'] ) ) {
1143
- $get_flag_choices['flag-bs'] = 0;
1144
- }
1145
-
1146
- if (!isset ( $get_flag_choices ['flag-bg'] ) ) {
1147
- $get_flag_choices['flag-bg'] = 0;
1148
- }
1149
-
1150
- if (!isset ( $get_flag_choices ['flag-ca'] ) ) {
1151
- $get_flag_choices['flag-ca'] = 0;
1152
- }
1153
-
1154
- if (!isset ( $get_flag_choices ['flag-ceb'] ) ) {
1155
- $get_flag_choices['flag-ceb'] = 0;
1156
- }
1157
-
1158
- if (!isset ( $get_flag_choices ['flag-zh-CN'] ) ) {
1159
- $get_flag_choices['flag-zh-CN'] = 0;
1160
- }
1161
-
1162
- if (!isset ( $get_flag_choices ['flag-zh-TW'] ) ) {
1163
- $get_flag_choices['flag-zh-TW'] = 0;
1164
- }
1165
-
1166
- if (!isset ( $get_flag_choices ['flag-hr'] ) ) {
1167
- $get_flag_choices['flag-hr'] = 0;
1168
- }
1169
-
1170
- if (!isset ( $get_flag_choices ['flag-cs'] ) ) {
1171
- $get_flag_choices['flag-cs'] = 0;
1172
- }
1173
-
1174
- if (!isset ( $get_flag_choices ['flag-da'] ) ) {
1175
- $get_flag_choices['flag-da'] = 0;
1176
- }
1177
-
1178
- if (!isset ( $get_flag_choices ['flag-nl'] ) ) {
1179
- $get_flag_choices['flag-nl'] = 0;
1180
- }
1181
-
1182
- if (!isset ( $get_flag_choices ['flag-en'] ) ) {
1183
- $get_flag_choices['flag-en'] = 1;
1184
- }
1185
-
1186
- if (!isset ( $get_flag_choices ['flag-eo'] ) ) {
1187
- $get_flag_choices['flag-eo'] = 0;
1188
- }
1189
-
1190
- if (!isset ( $get_flag_choices ['flag-et'] ) ) {
1191
- $get_flag_choices['flag-et'] = 0;
1192
- }
1193
-
1194
- if (!isset ( $get_flag_choices ['flag-tl'] ) ) {
1195
- $get_flag_choices['flag-tl'] = 0;
1196
- }
1197
-
1198
- if (!isset ( $get_flag_choices ['flag-fi'] ) ) {
1199
- $get_flag_choices['flag-fi'] = 0;
1200
- }
1201
-
1202
- if (!isset ( $get_flag_choices ['flag-fr'] ) ) {
1203
- $get_flag_choices['flag-fr'] = 0;
1204
- }
1205
-
1206
- if (!isset ( $get_flag_choices ['flag-gl'] ) ) {
1207
- $get_flag_choices['flag-gl'] = 0;
1208
- }
1209
-
1210
- if (!isset ( $get_flag_choices ['flag-ka'] ) ) {
1211
- $get_flag_choices['flag-ka'] = 0;
1212
- }
1213
-
1214
- if (!isset ( $get_flag_choices ['flag-de'] ) ) {
1215
- $get_flag_choices['flag-de'] = 0;
1216
- }
1217
-
1218
- if (!isset ( $get_flag_choices ['flag-el'] ) ) {
1219
- $get_flag_choices['flag-el'] = 0;
1220
- }
1221
-
1222
- if (!isset ( $get_flag_choices ['flag-gu'] ) ) {
1223
- $get_flag_choices['flag-gu'] = 0;
1224
- }
1225
-
1226
- if (!isset ( $get_flag_choices ['flag-ht'] ) ) {
1227
- $get_flag_choices['flag-ht'] = 0;
1228
- }
1229
-
1230
- if (!isset ( $get_flag_choices ['flag-ha'] ) ) {
1231
- $get_flag_choices['flag-ha'] = 0;
1232
- }
1233
-
1234
- if (!isset ( $get_flag_choices ['flag-iw'] ) ) {
1235
- $get_flag_choices['flag-iw'] = 0;
1236
- }
1237
-
1238
- if (!isset ( $get_flag_choices ['flag-hi'] ) ) {
1239
- $get_flag_choices['flag-hi'] = 0;
1240
- }
1241
-
1242
- if (!isset ( $get_flag_choices ['flag-hmn'] ) ) {
1243
- $get_flag_choices['flag-hmn'] = 0;
1244
- }
1245
-
1246
- if (!isset ( $get_flag_choices ['flag-hu'] ) ) {
1247
- $get_flag_choices['flag-hu'] = 0;
1248
- }
1249
-
1250
- if (!isset ( $get_flag_choices ['flag-is'] ) ) {
1251
- $get_flag_choices['flag-is'] = 0;
1252
- }
1253
-
1254
- if (!isset ( $get_flag_choices ['flag-ig'] ) ) {
1255
- $get_flag_choices['flag-ig'] = 0;
1256
- }
1257
-
1258
- if (!isset ( $get_flag_choices ['flag-id'] ) ) {
1259
- $get_flag_choices['flag-id'] = 0;
1260
- }
1261
-
1262
- if (!isset ( $get_flag_choices ['flag-ga'] ) ) {
1263
- $get_flag_choices['flag-ga'] = 0;
1264
- }
1265
-
1266
- if (!isset ( $get_flag_choices ['flag-it'] ) ) {
1267
- $get_flag_choices['flag-it'] = 0;
1268
- }
1269
-
1270
- if (!isset ( $get_flag_choices ['flag-ja'] ) ) {
1271
- $get_flag_choices['flag-ja'] = 0;
1272
- }
1273
-
1274
- if (!isset ( $get_flag_choices ['flag-jw'] ) ) {
1275
- $get_flag_choices['flag-jw'] = 0;
1276
- }
1277
-
1278
- if (!isset ( $get_flag_choices ['flag-kn'] ) ) {
1279
- $get_flag_choices['flag-kn'] = 0;
1280
- }
1281
-
1282
- if (!isset ( $get_flag_choices ['flag-km'] ) ) {
1283
- $get_flag_choices['flag-km'] = 0;
1284
- }
1285
-
1286
- if (!isset ( $get_flag_choices ['flag-ko'] ) ) {
1287
- $get_flag_choices['flag-ko'] = 0;
1288
- }
1289
-
1290
- if (!isset ( $get_flag_choices ['flag-lo'] ) ) {
1291
- $get_flag_choices['flag-lo'] = 0;
1292
- }
1293
-
1294
- if (!isset ( $get_flag_choices ['flag-la'] ) ) {
1295
- $get_flag_choices['flag-la'] = 0;
1296
- }
1297
-
1298
- if (!isset ( $get_flag_choices ['flag-lv'] ) ) {
1299
- $get_flag_choices['flag-lv'] = 0;
1300
- }
1301
-
1302
- if (!isset ( $get_flag_choices ['flag-lt'] ) ) {
1303
- $get_flag_choices['flag-lt'] = 0;
1304
- }
1305
-
1306
- if (!isset ( $get_flag_choices ['flag-mk'] ) ) {
1307
- $get_flag_choices['flag-mk'] = 0;
1308
- }
1309
-
1310
- if (!isset ( $get_flag_choices ['flag-ms'] ) ) {
1311
- $get_flag_choices['flag-ms'] = 0;
1312
- }
1313
-
1314
- if (!isset ( $get_flag_choices ['flag-mt'] ) ) {
1315
- $get_flag_choices['flag-mt'] = 0;
1316
- }
1317
-
1318
- if (!isset ( $get_flag_choices ['flag-mi'] ) ) {
1319
- $get_flag_choices['flag-mi'] = 0;
1320
- }
1321
-
1322
- if (!isset ( $get_flag_choices ['flag-mr'] ) ) {
1323
- $get_flag_choices['flag-mr'] = 0;
1324
- }
1325
-
1326
- if (!isset ( $get_flag_choices ['flag-mn'] ) ) {
1327
- $get_flag_choices['flag-mn'] = 0;
1328
- }
1329
-
1330
- if (!isset ( $get_flag_choices ['flag-ne'] ) ) {
1331
- $get_flag_choices['flag-ne'] = 0;
1332
- }
1333
-
1334
- if (!isset ( $get_flag_choices ['flag-no'] ) ) {
1335
- $get_flag_choices['flag-no'] = 0;
1336
- }
1337
-
1338
- if (!isset ( $get_flag_choices ['flag-fa'] ) ) {
1339
- $get_flag_choices['flag-fa'] = 0;
1340
- }
1341
-
1342
- if (!isset ( $get_flag_choices ['flag-pl'] ) ) {
1343
- $get_flag_choices['flag-pl'] = 0;
1344
- }
1345
-
1346
- if (!isset ( $get_flag_choices ['flag-pt'] ) ) {
1347
- $get_flag_choices['flag-pt'] = 0;
1348
- }
1349
-
1350
- if (!isset ( $get_flag_choices ['flag-pa'] ) ) {
1351
- $get_flag_choices['flag-pa'] = 0;
1352
- }
1353
-
1354
- if (!isset ( $get_flag_choices ['flag-ro'] ) ) {
1355
- $get_flag_choices['flag-ro'] = 0;
1356
- }
1357
-
1358
- if (!isset ( $get_flag_choices ['flag-ru'] ) ) {
1359
- $get_flag_choices['flag-ru'] = 0;
1360
- }
1361
-
1362
- if (!isset ( $get_flag_choices ['flag-sr'] ) ) {
1363
- $get_flag_choices['flag-sr'] = 0;
1364
- }
1365
-
1366
- if (!isset ( $get_flag_choices ['flag-sk'] ) ) {
1367
- $get_flag_choices['flag-sk'] = 0;
1368
- }
1369
-
1370
- if (!isset ( $get_flag_choices ['flag-sl'] ) ) {
1371
- $get_flag_choices['flag-sl'] = 0;
1372
- }
1373
-
1374
- if (!isset ( $get_flag_choices ['flag-so'] ) ) {
1375
- $get_flag_choices['flag-so'] = 0;
1376
- }
1377
-
1378
- if (!isset ( $get_flag_choices ['flag-so'] ) ) {
1379
- $get_flag_choices['flag-so'] = 0;
1380
- }
1381
-
1382
- if (!isset ( $get_flag_choices ['flag-es'] ) ) {
1383
- $get_flag_choices['flag-es'] = 0;
1384
- }
1385
-
1386
- if (!isset ( $get_flag_choices ['flag-sw'] ) ) {
1387
- $get_flag_choices['flag-sw'] = 0;
1388
- }
1389
-
1390
- if (!isset ( $get_flag_choices ['flag-sv'] ) ) {
1391
- $get_flag_choices['flag-sv'] = 0;
1392
- }
1393
-
1394
- if (!isset ( $get_flag_choices ['flag-ta'] ) ) {
1395
- $get_flag_choices['flag-ta'] = 0;
1396
- }
1397
-
1398
- if (!isset ( $get_flag_choices ['flag-te'] ) ) {
1399
- $get_flag_choices['flag-te'] = 0;
1400
- }
1401
-
1402
- if (!isset ( $get_flag_choices ['flag-th'] ) ) {
1403
- $get_flag_choices['flag-th'] = 0;
1404
- }
1405
-
1406
- if (!isset ( $get_flag_choices ['flag-tr'] ) ) {
1407
- $get_flag_choices['flag-tr'] = 0;
1408
- }
1409
-
1410
- if (!isset ( $get_flag_choices ['flag-uk'] ) ) {
1411
- $get_flag_choices['flag-uk'] = 0;
1412
- }
1413
-
1414
- if (!isset ( $get_flag_choices ['flag-ur'] ) ) {
1415
- $get_flag_choices['flag-ur'] = 0;
1416
- }
1417
-
1418
- if (!isset ( $get_flag_choices ['flag-vi'] ) ) {
1419
- $get_flag_choices['flag-vi'] = 0;
1420
- }
1421
-
1422
- if (!isset ( $get_flag_choices ['flag-cy'] ) ) {
1423
- $get_flag_choices['flag-cy'] = 0;
1424
- }
1425
-
1426
- if (!isset ( $get_flag_choices ['flag-yi'] ) ) {
1427
- $get_flag_choices['flag-yi'] = 0;
1428
- }
1429
-
1430
- if (!isset ( $get_flag_choices ['flag-yo'] ) ) {
1431
- $get_flag_choices['flag-yo'] = 0;
1432
- }
1433
-
1434
- ?>
1435
- <div class="flagdisplay" style="width:25%; float:left">
1436
- <div><input type="checkbox" name="flag_display_settings[flag-af]" value="1" <?php checked( 1,$get_flag_choices['flag-af']); ?>/> Afrikaans</div>
1437
- <div><input type="checkbox" name="flag_display_settings[flag-sq]" value="1" <?php checked( 1,$get_flag_choices['flag-sq']); ?>/> Albanian</div>
1438
- <div><input type="checkbox" name="flag_display_settings[flag-ar]" value="1" <?php checked( 1,$get_flag_choices['flag-ar']); ?>/> Arabic</div>
1439
- <div><input type="checkbox" name="flag_display_settings[flag-hy]" value="1" <?php checked( 1,$get_flag_choices['flag-hy']); ?>/> Armenian</div>
1440
- <div><input type="checkbox" name="flag_display_settings[flag-az]" value="1" <?php checked( 1,$get_flag_choices['flag-az']); ?>/> Azerbaijani</div>
1441
- <div><input type="checkbox" name="flag_display_settings[flag-eu]" value="1" <?php checked( 1,$get_flag_choices['flag-eu']); ?>/> Basque</div>
1442
- <div><input type="checkbox" name="flag_display_settings[flag-be]" value="1" <?php checked( 1,$get_flag_choices['flag-be']); ?>/> Belarusian</div>
1443
- <div><input type="checkbox" name="flag_display_settings[flag-bn]" value="1" <?php checked( 1,$get_flag_choices['flag-bn']); ?>/> Bengali</div>
1444
- <div><input type="checkbox" name="flag_display_settings[flag-bs]" value="1" <?php checked( 1,$get_flag_choices['flag-bs']); ?>/> Bosnian</div>
1445
- <div><input type="checkbox" name="flag_display_settings[flag-bg]" value="1" <?php checked( 1,$get_flag_choices['flag-bg']); ?>/> Bulgarian</div>
1446
- <div><input type="checkbox" name="flag_display_settings[flag-ca]" value="1" <?php checked( 1,$get_flag_choices['flag-ca']); ?>/> Catalan</div>
1447
- <div><input type="checkbox" name="flag_display_settings[flag-ceb]" value="1" <?php checked( 1,$get_flag_choices['flag-ceb']); ?>/> Cebuano</div>
1448
- <div><input type="checkbox" name="flag_display_settings[flag-zh-CN]" value="1" <?php checked( 1,$get_flag_choices['flag-zh-CN']); ?>/> Chinese</div>
1449
- <div><input type="checkbox" name="flag_display_settings[flag-zh-TW]" value="1" <?php checked( 1,$get_flag_choices['flag-zh-TW']); ?>/> Chinese (Han)</div>
1450
- <div><input type="checkbox" name="flag_display_settings[flag-hr]" value="1" <?php checked( 1,$get_flag_choices['flag-hr']); ?>/> Croatian</div>
1451
- <div><input type="checkbox" name="flag_display_settings[flag-cs]" value="1" <?php checked( 1,$get_flag_choices['flag-cs']); ?>/> Czech</div>
1452
- <div><input type="checkbox" name="flag_display_settings[flag-da]" value="1" <?php checked( 1,$get_flag_choices['flag-da']); ?>/> Danish</div>
1453
- <div><input type="checkbox" name="flag_display_settings[flag-nl]" value="1" <?php checked( 1,$get_flag_choices['flag-nl']); ?>/> Dutch</div>
1454
- <div><input type="checkbox" name="flag_display_settings[flag-en]" value="1" <?php checked(1,$get_flag_choices['flag-en']); ?>/> English</div>
1455
- <div><input type="checkbox" name="flag_display_settings[flag-eo]" value="1" <?php checked( 1,$get_flag_choices['flag-eo']); ?>/> Esperanto</div>
1456
- <div><input type="checkbox" name="flag_display_settings[flag-et]" value="1" <?php checked( 1,$get_flag_choices['flag-et']); ?>/> Estonian</div>
1457
- </div>
1458
-
1459
- <div class="flagdisplay" style="width:25%; float:left">
1460
- <div><input type="checkbox" name="flag_display_settings[flag-tl]" value="1" <?php checked( 1,$get_flag_choices['flag-tl']); ?>/> Filipino</div>
1461
- <div><input type="checkbox" name="flag_display_settings[flag-fi]" value="1" <?php checked( 1,$get_flag_choices['flag-fi']); ?>/> Finnish</div>
1462
- <div><input type="checkbox" name="flag_display_settings[flag-fr]" value="1" <?php checked( 1,$get_flag_choices['flag-fr']); ?>/> French</div>
1463
- <div><input type="checkbox" name="flag_display_settings[flag-gl]" value="1" <?php checked( 1,$get_flag_choices['flag-gl']); ?>/> Galician</div>
1464
- <div><input type="checkbox" name="flag_display_settings[flag-ka]" value="1" <?php checked( 1,$get_flag_choices['flag-ka']); ?>/> Georgian</div>
1465
- <div><input type="checkbox" name="flag_display_settings[flag-de]" value="1" <?php checked( 1,$get_flag_choices['flag-de']); ?>/> German</div>
1466
- <div><input type="checkbox" name="flag_display_settings[flag-el]" value="1" <?php checked( 1,$get_flag_choices['flag-el']); ?>/> Greek</div>
1467
- <div><input type="checkbox" name="flag_display_settings[flag-gu]" value="1" <?php checked( 1,$get_flag_choices['flag-gu']); ?>/> Gujarati</div>
1468
- <div><input type="checkbox" name="flag_display_settings[flag-ht]" value="1" <?php checked( 1,$get_flag_choices['flag-ht']); ?>/> Haitian Creole</div>
1469
- <div><input type="checkbox" name="flag_display_settings[flag-ha]" value="1" <?php checked( 1,$get_flag_choices['flag-ha']); ?>/> Hausa</div>
1470
- <div><input type="checkbox" name="flag_display_settings[flag-iw]" value="1" <?php checked( 1,$get_flag_choices['flag-iw']); ?>/> Hebrew</div>
1471
- <div><input type="checkbox" name="flag_display_settings[flag-hi]" value="1" <?php checked( 1,$get_flag_choices['flag-hi']); ?>/> Hindi</div>
1472
- <div><input type="checkbox" name="flag_display_settings[flag-hmn]" value="1" <?php checked( 1,$get_flag_choices['flag-hmn']); ?>/> Hmong</div>
1473
- <div><input type="checkbox" name="flag_display_settings[flag-hu]" value="1" <?php checked( 1,$get_flag_choices['flag-hu']); ?>/> Hungarian</div>
1474
- <div><input type="checkbox" name="flag_display_settings[flag-is]" value="1" <?php checked( 1,$get_flag_choices['flag-is']); ?>/> Icelandic</div>
1475
- <div><input type="checkbox" name="flag_display_settings[flag-ig]" value="1" <?php checked( 1,$get_flag_choices['flag-ig']); ?>/> Igbo</div>
1476
- <div><input type="checkbox" name="flag_display_settings[flag-id]" value="1" <?php checked( 1,$get_flag_choices['flag-id']); ?>/> Indonesian</div>
1477
- <div><input type="checkbox" name="flag_display_settings[flag-ga]" value="1" <?php checked( 1,$get_flag_choices['flag-ga']); ?>/> Irish</div>
1478
- <div><input type="checkbox" name="flag_display_settings[flag-it]" value="1" <?php checked( 1,$get_flag_choices['flag-it']); ?>/> Italian</div>
1479
- <div><input type="checkbox" name="flag_display_settings[flag-ja]" value="1" <?php checked( 1,$get_flag_choices['flag-ja']); ?>/> Japanese</div>
1480
- <div><input type="checkbox" name="flag_display_settings[flag-jw]" value="1" <?php checked( 1,$get_flag_choices['flag-jw']); ?>/> Javanese</div>
1481
- </div>
1482
-
1483
- <div class="flagdisplay" style="width:25%; float:left">
1484
- <div><input type="checkbox" name="flag_display_settings[flag-kn]" value="1" <?php checked( 1,$get_flag_choices['flag-kn']); ?>/> Kannada</div>
1485
- <div><input type="checkbox" name="flag_display_settings[flag-km]" value="1" <?php checked( 1,$get_flag_choices['flag-km']); ?>/> Khmer</div>
1486
- <div><input type="checkbox" name="flag_display_settings[flag-ko]" value="1" <?php checked( 1,$get_flag_choices['flag-ko']); ?>/> Korean</div>
1487
- <div><input type="checkbox" name="flag_display_settings[flag-lo]" value="1" <?php checked( 1,$get_flag_choices['flag-lo']); ?>/> Lao</div>
1488
- <div><input type="checkbox" name="flag_display_settings[flag-la]" value="1" <?php checked( 1,$get_flag_choices['flag-la']); ?>/> Latin</div>
1489
- <div><input type="checkbox" name="flag_display_settings[flag-lv]" value="1" <?php checked( 1,$get_flag_choices['flag-lv']); ?>/> Latvian</div>
1490
- <div><input type="checkbox" name="flag_display_settings[flag-lt]" value="1" <?php checked( 1,$get_flag_choices['flag-lt']); ?>/> Lithuanian</div>
1491
- <div><input type="checkbox" name="flag_display_settings[flag-mk]" value="1" <?php checked( 1,$get_flag_choices['flag-mk']); ?>/> Macedonian</div>
1492
- <div><input type="checkbox" name="flag_display_settings[flag-ms]" value="1" <?php checked( 1,$get_flag_choices['flag-ms']); ?>/> Malay</div>
1493
- <div><input type="checkbox" name="flag_display_settings[flag-mt]" value="1" <?php checked( 1,$get_flag_choices['flag-mt']); ?>/> Maltese</div>
1494
- <div><input type="checkbox" name="flag_display_settings[flag-mi]" value="1" <?php checked( 1,$get_flag_choices['flag-mi']); ?>/> Maori</div>
1495
- <div><input type="checkbox" name="flag_display_settings[flag-mr]" value="1" <?php checked( 1,$get_flag_choices['flag-mr']); ?>/> Marathi</div>
1496
- <div><input type="checkbox" name="flag_display_settings[flag-mn]" value="1" <?php checked( 1,$get_flag_choices['flag-mn']); ?>/> Mongolian</div>
1497
- <div><input type="checkbox" name="flag_display_settings[flag-ne]" value="1" <?php checked( 1,$get_flag_choices['flag-ne']); ?>/> Nepali</div>
1498
- <div><input type="checkbox" name="flag_display_settings[flag-no]" value="1" <?php checked( 1,$get_flag_choices['flag-no']); ?>/> Norwegian</div>
1499
- <div><input type="checkbox" name="flag_display_settings[flag-fa]" value="1" <?php checked( 1,$get_flag_choices['flag-fa']); ?>/> Persian</div>
1500
- <div><input type="checkbox" name="flag_display_settings[flag-pl]" value="1" <?php checked( 1,$get_flag_choices['flag-pl']); ?>/> Polish</div>
1501
- <div><input type="checkbox" name="flag_display_settings[flag-pt]" value="1" <?php checked( 1,$get_flag_choices['flag-pt']); ?>/> Portuguese</div>
1502
- <div><input type="checkbox" name="flag_display_settings[flag-pa]" value="1" <?php checked( 1,$get_flag_choices['flag-pa']); ?>/> Punjabi</div>
1503
- <div><input type="checkbox" name="flag_display_settings[flag-ro]" value="1" <?php checked( 1,$get_flag_choices['flag-ro']); ?>/> Romanian</div>
1504
- <div><input type="checkbox" name="flag_display_settings[flag-ru]" value="1" <?php checked( 1,$get_flag_choices['flag-ru']); ?>/> Russian</div>
1505
- </div>
1506
-
1507
- <div class="flagdisplay" style="width:25%; float:left">
1508
- <div><input type="checkbox" name="flag_display_settings[flag-sr]" value="1" <?php checked( 1,$get_flag_choices['flag-sr']); ?>/> Serbian</div>
1509
- <div><input type="checkbox" name="flag_display_settings[flag-sk]" value="1" <?php checked( 1,$get_flag_choices['flag-sk']); ?>/> Slovak</div>
1510
- <div><input type="checkbox" name="flag_display_settings[flag-sl]" value="1" <?php checked( 1,$get_flag_choices['flag-sl']); ?>/> Slovenian</div>
1511
- <div><input type="checkbox" name="flag_display_settings[flag-so]" value="1" <?php checked( 1,$get_flag_choices['flag-so']); ?>/> Somali</div>
1512
- <div><input type="checkbox" name="flag_display_settings[flag-es]" value="1" <?php checked( 1,$get_flag_choices['flag-es']); ?>/> Spanish</div>
1513
- <div><input type="checkbox" name="flag_display_settings[flag-sw]" value="1" <?php checked( 1,$get_flag_choices['flag-sw']); ?>/> Swahili</div>
1514
- <div><input type="checkbox" name="flag_display_settings[flag-sv]" value="1" <?php checked( 1,$get_flag_choices['flag-sv']); ?>/> Swedish</div>
1515
- <div><input type="checkbox" name="flag_display_settings[flag-ta]" value="1" <?php checked( 1,$get_flag_choices['flag-ta']); ?>/> Tamil</div>
1516
- <div><input type="checkbox" name="flag_display_settings[flag-te]" value="1" <?php checked( 1,$get_flag_choices['flag-te']); ?>/> Telugu</div>
1517
- <div><input type="checkbox" name="flag_display_settings[flag-th]" value="1" <?php checked( 1,$get_flag_choices['flag-th']); ?>/> Thai</div>
1518
- <div><input type="checkbox" name="flag_display_settings[flag-tr]" value="1" <?php checked( 1,$get_flag_choices['flag-tr']); ?>/> Turkish</div>
1519
- <div><input type="checkbox" name="flag_display_settings[flag-uk]" value="1" <?php checked( 1,$get_flag_choices['flag-uk']); ?>/> Ukranian</div>
1520
- <div><input type="checkbox" name="flag_display_settings[flag-ur]" value="1" <?php checked( 1,$get_flag_choices['flag-ur']); ?>/> Urdu</div>
1521
- <div><input type="checkbox" name="flag_display_settings[flag-vi]" value="1" <?php checked( 1,$get_flag_choices['flag-vi']); ?>/> Vietnamese</div>
1522
- <div><input type="checkbox" name="flag_display_settings[flag-cy]" value="1" <?php checked( 1,$get_flag_choices['flag-cy']); ?>/> Welsh</div>
1523
- <div><input type="checkbox" name="flag_display_settings[flag-yi]" value="1" <?php checked( 1,$get_flag_choices['flag-yi']); ?>/> Yiddish</div>
1524
- <div><input type="checkbox" name="flag_display_settings[flag-yo]" value="1" <?php checked( 1,$get_flag_choices['flag-yo']); ?>/> Yoruba</div>
1525
- <div><input type="checkbox" name="flag_display_settings[flag-zu]" value="1" <?php checked( 1,$get_flag_choices['flag-zu']); ?>/> Zulu</div>
1526
-
1527
- </div>
1528
- <div style="clear:both"></div>
1529
- <?php }
1530
-
1531
- public function googlelanguagetranslator_floating_widget_cb() {
1532
-
1533
- $option_name = 'googlelanguagetranslator_floating_widget' ;
1534
- $new_value = 'yes';
1535
-
1536
- if ( get_option( $option_name ) === false ) {
1537
-
1538
- // The option does not exist, so we update it.
1539
- update_option( $option_name, $new_value );
1540
- }
1541
-
1542
- $options = get_option (''.$option_name.''); ?>
1543
-
1544
- <select name="googlelanguagetranslator_floating_widget" id="googlelanguagetranslator_floating_widget" style="width:170px">
1545
- <option value="yes" <?php if($options=='yes'){echo "selected";}?>>Yes, show widget</option>
1546
- <option value="no" <?php if($options=='no'){echo "selected";}?>>No, hide widget</option>
1547
- </select>
1548
- <?php }
1549
-
1550
- public function googlelanguagetranslator_translatebox_cb() {
1551
-
1552
- $option_name = 'googlelanguagetranslator_translatebox' ;
1553
- $new_value = 'yes';
1554
-
1555
- if ( get_option( $option_name ) === false ) {
1556
-
1557
- // The option does not exist, so we update it.
1558
- update_option( $option_name, $new_value );
1559
- }
1560
-
1561
- $options = get_option (''.$option_name.''); ?>
1562
-
1563
- <select name="googlelanguagetranslator_translatebox" id="googlelanguagetranslator_translatebox" style="width:190px">
1564
- <option value="yes" <?php if($options=='yes'){echo "selected";}?>>Yes, show language box</option>
1565
- <option value="no" <?php if($options=='no'){echo "selected";}?>>No, hide language box</option>
1566
- </select>
1567
- <?php }
1568
-
1569
- public function googlelanguagetranslator_display_cb() {
1570
-
1571
- $option_name = 'googlelanguagetranslator_display' ;
1572
- $new_value = 'Vertical';
1573
-
1574
- if ( get_option( $option_name ) === false ) {
1575
-
1576
- // The option does not exist, so we update it.
1577
- update_option( $option_name, $new_value );
1578
- }
1579
-
1580
- $options = get_option (''.$option_name.''); ?>
1581
-
1582
- <select name="googlelanguagetranslator_display" id="googlelanguagetranslator_display" style="width:170px;">
1583
- <option value="Vertical" <?php if(get_option('googlelanguagetranslator_display')=='Vertical'){echo "selected";}?>>Vertical</option>
1584
- <option value="Horizontal" <?php if(get_option('googlelanguagetranslator_display')=='Horizontal'){echo "selected";}?>>Horizontal</option>
1585
- </select>
1586
- <?php }
1587
-
1588
- public function googlelanguagetranslator_toolbar_cb() {
1589
-
1590
- $option_name = 'googlelanguagetranslator_toolbar' ;
1591
- $new_value = 'Yes';
1592
-
1593
- if ( get_option( $option_name ) === false ) {
1594
-
1595
- // The option does not exist, so we update it.
1596
- update_option( $option_name, $new_value );
1597
- }
1598
-
1599
- $options = get_option (''.$option_name.''); ?>
1600
-
1601
- <select name="googlelanguagetranslator_toolbar" id="googlelanguagetranslator_toolbar" style="width:170px;">
1602
- <option value="Yes" <?php if(get_option('googlelanguagetranslator_toolbar')=='Yes'){echo "selected";}?>>Yes</option>
1603
- <option value="No" <?php if(get_option('googlelanguagetranslator_toolbar')=='No'){echo "selected";}?>>No</option>
1604
- </select>
1605
- <?php }
1606
-
1607
- public function googlelanguagetranslator_showbranding_cb() {
1608
-
1609
- $option_name = 'googlelanguagetranslator_showbranding' ;
1610
- $new_value = 'Yes';
1611
-
1612
- if ( get_option( $option_name ) === false ) {
1613
-
1614
- // The option does not exist, so we update it.
1615
- update_option( $option_name, $new_value );
1616
- }
1617
-
1618
- $options = get_option (''.$option_name.''); ?>
1619
-
1620
- <select name="googlelanguagetranslator_showbranding" id="googlelanguagetranslator_showbranding" style="width:170px;">
1621
- <option value="Yes" <?php if(get_option('googlelanguagetranslator_showbranding')=='Yes'){echo "selected";}?>>Yes</option>
1622
- <option value="No" <?php if(get_option('googlelanguagetranslator_showbranding')=='No'){echo "selected";}?>>No</option>
1623
- </select>
1624
- <?php }
1625
-
1626
- public function googlelanguagetranslator_flags_alignment_cb() {
1627
-
1628
- $option_name = 'googlelanguagetranslator_flags_alignment' ;
1629
- $new_value = 'flags_left';
1630
-
1631
- if ( get_option( $option_name ) === false ) {
1632
-
1633
- // The option does not exist, so we update it.
1634
- update_option( $option_name, 'flags_left' );
1635
- }
1636
-
1637
- $options = get_option (''.$option_name.''); ?>
1638
-
1639
- <input type="radio" name="googlelanguagetranslator_flags_alignment" id="flags_left" value="flags_left" <?php if($options=='flags_left'){echo "checked";}?>/> Align Left<br/>
1640
- <input type="radio" name="googlelanguagetranslator_flags_alignment" id="flags_right" value="flags_right" <?php if($options=='flags_right'){echo "checked";}?>/> Align Right
1641
- <?php }
1642
-
1643
- public function googlelanguagetranslator_analytics_cb() {
1644
-
1645
- $option_name = 'googlelanguagetranslator_analytics' ;
1646
- $new_value = 0;
1647
-
1648
- if ( get_option( $option_name ) === false ) {
1649
-
1650
- // The option does not exist, so we update it.
1651
- update_option( $option_name, $new_value );
1652
- }
1653
-
1654
- $options = get_option (''.$option_name.'');
1655
-
1656
- $html = '<input type="checkbox" name="googlelanguagetranslator_analytics" id="googlelanguagetranslator_analytics" value="1" '.checked(1,$options,false).'/> &nbsp; Activate Google Analytics tracking?';
1657
- echo $html;
1658
- }
1659
-
1660
- public function googlelanguagetranslator_analytics_id_cb() {
1661
-
1662
- $option_name = 'googlelanguagetranslator_analytics_id' ;
1663
- $new_value = '';
1664
-
1665
- if ( get_option( $option_name ) === false ) {
1666
-
1667
- // The option does not exist, so we update it.
1668
- update_option( $option_name, $new_value );
1669
- }
1670
-
1671
- $options = get_option (''.$option_name.'');
1672
-
1673
- $html = '<input type="text" name="googlelanguagetranslator_analytics_id" id="googlelanguagetranslator_analytics_id" value="'.$options.'" />';
1674
- echo $html;
1675
- }
1676
-
1677
- public function googlelanguagetranslator_flag_size_cb() {
1678
-
1679
- $option_name = 'googlelanguagetranslator_flag_size' ;
1680
- $new_value = '16px';
1681
-
1682
- if ( get_option( $option_name ) === false ) {
1683
-
1684
- // The option does not exist, so we update it.
1685
- update_option( $option_name, $new_value );
1686
- }
1687
-
1688
- $options = get_option (''.$option_name.''); ?>
1689
-
1690
- <select name="googlelanguagetranslator_flag_size" id="googlelanguagetranslator_flag_size" style="width:110px;">
1691
- <option value="16px" <?php if($options=='16px'){echo "selected";}?>>16px</option>
1692
- <option value="18px" <?php if($options=='18px'){echo "selected";}?>>18px</option>
1693
- <option value="20px" <?php if($options=='20px'){echo "selected";}?>>20px</option>
1694
- <option value="22px" <?php if($options=='22px'){echo "selected";}?>>22px</option>
1695
- <option value="24px" <?php if($options=='24px'){echo "selected";}?>>24px</option>
1696
- </select>
1697
- <?php }
1698
-
1699
- public function googlelanguagetranslator_flags_order_cb() {
1700
- $option_name = 'googlelanguagetranslator_flags_order';
1701
- $new_value = '';
1702
-
1703
- if ( get_option ( $option_name ) === false ) {
1704
-
1705
- // The option does not exist, so we update it.
1706
- update_option( $option_name, $new_value );
1707
- }
1708
-
1709
- $options = get_option ( ''.$option_name.'' ); ?>
1710
-
1711
- <input type="hidden" id="order" name="googlelanguagetranslator_flags_order" value="<?php print_r(get_option('googlelanguagetranslator_flags_order')); ?>" />
1712
- <?php
1713
- }
1714
-
1715
- public function googlelanguagetranslator_css_cb() {
1716
-
1717
- $option_name = 'googlelanguagetranslator_css' ;
1718
- $new_value = '';
1719
-
1720
- if ( get_option( $option_name ) === false ) {
1721
-
1722
- // The option does not exist, so we update it.
1723
- update_option( $option_name, $new_value );
1724
- }
1725
-
1726
- $options = get_option (''.$option_name.'');
1727
-
1728
- $html = '<textarea style="width:100%; height:200px" name="googlelanguagetranslator_css" id="googlelanguagetranslator_css">'.$options.'</textarea>';
1729
- echo $html;
1730
- }
1731
-
1732
- public function googlelanguagetranslator_manage_translations_cb() {
1733
- $option_name = 'googlelanguagetranslator_manage_translations' ;
1734
- $new_value = 0;
1735
-
1736
- if ( get_option( $option_name ) === false ) {
1737
-
1738
- // The option does not exist, so we update it.
1739
- update_option( $option_name, $new_value );
1740
- }
1741
-
1742
- $options = get_option (''.$option_name.'');
1743
-
1744
- $html = '<input type="checkbox" name="googlelanguagetranslator_manage_translations" id="googlelanguagetranslator_manage_translations" value="1" '.checked(1,$options,false).'/> &nbsp; Turn on translation management?';
1745
- echo $html;
1746
- }
1747
-
1748
- public function googlelanguagetranslator_multilanguage_cb() {
1749
-
1750
- $option_name = 'googlelanguagetranslator_multilanguage' ;
1751
- $new_value = 0;
1752
-
1753
- if ( get_option( $option_name ) === false ) {
1754
-
1755
- // The option does not exist, so we update it.
1756
- update_option( $option_name, $new_value );
1757
- }
1758
-
1759
- $options = get_option (''.$option_name.'');
1760
-
1761
- $html = '<input type="checkbox" name="googlelanguagetranslator_multilanguage" id="googlelanguagetranslator_multilanguage" value="1" '.checked(1,$options,false).'/> &nbsp; Turn on multilanguage mode?';
1762
- echo $html;
1763
- }
1764
-
1765
- public function page_layout_cb() { ?>
1766
- <div class="wrap">
1767
- <div id="icon-options-general" class="icon32"></div>
1768
- <h2><span class="notranslate">Google Language Translator</span></h2>
1769
- <form action="<?php echo admin_url('options.php'); ?>" method="post">
1770
- <div class="metabox-holder has-right-sidebar" style="float:left; width:65%">
1771
- <div class="postbox" style="width: 100%">
1772
- <h3 class="notranslate">Settings</h3>
1773
-
1774
- <?php settings_fields('google_language_translator'); ?>
1775
- <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1776
- <tr>
1777
- <td style="width:60%" class="notranslate">Plugin Status:</td>
1778
- <td class="notranslate"><?php $this->googlelanguagetranslator_active_cb(); ?></td>
1779
- </tr>
1780
-
1781
- <tr class="notranslate">
1782
- <td>Choose the original language of your website</td>
1783
- <td><?php $this->googlelanguagetranslator_language_cb(); ?></td>
1784
- </tr>
1785
-
1786
- <tr class="notranslate">
1787
- <td>What translation languages will display in the language box?<br/>("All Languages" option <strong><u>must</u></strong> be chosen to show flags.)</td>
1788
- <td><?php $this->googlelanguagetranslator_language_option_cb(); ?></td>
1789
- </tr>
1790
-
1791
- <tr class="notranslate">
1792
- <td colspan="2"><?php $this->language_display_settings_cb(); ?></td>
1793
- </tr>
1794
-
1795
- <tr class="notranslate">
1796
- <td class="choose_flags_intro">Show flag images?<br/>(Display up to 81 flags above the translator)</td>
1797
- <td class="choose_flags_intro"><?php $this->googlelanguagetranslator_flags_cb(); ?></td>
1798
- </tr>
1799
-
1800
- <tr class="notranslate">
1801
- <td class="choose_flags">Choose the flags you want to display:</td>
1802
- <td></td>
1803
- </tr>
1804
-
1805
- <tr class="notranslate">
1806
- <td colspan="2" class="choose_flags"><?php $this->flag_display_settings_cb(); ?></td>
1807
- </tr>
1808
-
1809
- <tr class="notranslate">
1810
- <td>Show floating translation widget? <strong style="color:red">(New!)</strong><br/>
1811
- <span>("All Languages" option <strong><u>must</u></strong> be chosen to show widget.)</span>
1812
- </td>
1813
- <td><?php $this->googlelanguagetranslator_floating_widget_cb(); ?></td>
1814
- </tr>
1815
-
1816
- <tr class="notranslate">
1817
- <td>Show translate box?</td>
1818
- <td><?php $this->googlelanguagetranslator_translatebox_cb(); ?></td>
1819
- </tr>
1820
-
1821
- <tr class="notranslate">
1822
- <td>Layout options:</td>
1823
- <td><?php $this->googlelanguagetranslator_display_cb(); ?></td>
1824
- </tr>
1825
-
1826
- <tr class="notranslate">
1827
- <td>Show Google Toolbar?</td>
1828
- <td><?php $this->googlelanguagetranslator_toolbar_cb(); ?></td>
1829
- </tr>
1830
-
1831
- <tr class="notranslate">
1832
- <td>Show Google Branding?<br/>
1833
- <span>(<a href="https://developers.google.com/translate/v2/attribution" target="_blank">Learn more</a> about Google's Attribution Requirements.)</span>
1834
- </td>
1835
- <td><?php $this->googlelanguagetranslator_showbranding_cb(); ?></td>
1836
- </tr>
1837
-
1838
- <tr class="alignment notranslate">
1839
- <td class="flagdisplay">Align the translator left or right?</td>
1840
- <td class="flagdisplay"><?php $this->googlelanguagetranslator_flags_alignment_cb(); ?></td>
1841
- </tr>
1842
-
1843
- <tr class="manage_translations notranslate">
1844
- <td>Turn on translation management?<br/>(Managed directly through your Google account. Requires <a href="http://translate.google.com/manager/website/settings" target="_blank">Google Translate</a> meta tag installed in header.)</td>
1845
- <td><?php $this->googlelanguagetranslator_manage_translations_cb(); ?></td>
1846
- </tr>
1847
-
1848
- <tr class="multilanguage notranslate">
1849
- <td>Multilanguage Page Option?: (<em>not recommended)</em><br/>(If checked, a "forced" translation of your webpage will be served when returned to the default language, instead of delivering original content.)</td>
1850
- <td><?php $this->googlelanguagetranslator_multilanguage_cb(); ?></td>
1851
- </tr>
1852
-
1853
- <tr class="notranslate">
1854
- <td>Google Analytics:</td>
1855
- <td><?php $this->googlelanguagetranslator_analytics_cb(); ?></td>
1856
- </tr>
1857
-
1858
- <tr class="analytics notranslate">
1859
- <td>Google Analytics ID (Ex. 'UA-11117410-2')</td>
1860
- <td><?php $this->googlelanguagetranslator_analytics_id_cb(); ?></td>
1861
- </tr>
1862
-
1863
- <tr class="notranslate">
1864
- <td>Copy/Paste this shortcode if adding to pages/posts:</td>
1865
- <td><code>[google-translator]</code></td>
1866
- </tr>
1867
- </table>
1868
-
1869
- <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1870
- <tr class="notranslate">
1871
- <td style="width:40%">For usage in header/footer:</td>
1872
- <td style="width:60%"><code>&lt;?php echo do_shortcode('[google-translator]'); ?&gt;</code></td>
1873
- </tr>
1874
-
1875
- <tr class="notranslate">
1876
- <td><?php submit_button(); ?></td>
1877
- <td></td>
1878
- </tr>
1879
- </table>
1880
-
1881
- </div> <!-- .postbox -->
1882
- </div> <!-- .metbox-holder -->
1883
-
1884
- <div class="metabox-holder" style="float:right; clear:right; width:33%">
1885
- <div class="postbox">
1886
- <h3 class="notranslate">Preview</h3>
1887
- <table style="width:100%">
1888
- <tr>
1889
- <td style="box-sizing:border-box; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; padding:15px 15px; margin:0px"><span style="color:red; font-weight:bold" class="notranslate">(New!)</span><span class="notranslate"> Drag &amp; drop flags to change their position.</span><br/><br/><?php echo do_shortcode('[google-translator]'); ?><p class="hello"><span class="notranslate">Translated text:</span> &nbsp; <span>Hello</span></p></td>
1890
- </tr>
1891
-
1892
- <tr>
1893
- <td><?php echo $_POST['googlelanguagetranslator_flags_order']; ?></td>
1894
- </tr>
1895
-
1896
-
1897
- </table>
1898
- </div> <!-- .postbox -->
1899
- </div> <!-- .metabox-holder -->
1900
-
1901
- <div id="glt_advanced_settings" class="metabox-holder notranslate" style="float: right; width: 33%;">
1902
- <div class="postbox">
1903
- <h3>Advanced Settings</h3>
1904
- <div class="inside">
1905
- <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1906
- <tr class="notranslate">
1907
- <td class="advanced">Select flag size:</td>
1908
- <td class="advanced"><?php $this->googlelanguagetranslator_flag_size_cb(); ?></td>
1909
- </tr>
1910
- </table>
1911
- </div>
1912
- </div>
1913
- </div>
1914
-
1915
-
1916
- <div class="metabox-holder notranslate" style="float: right; width: 33%;">
1917
- <div class="postbox">
1918
- <h3>Add CSS Styles</h3>
1919
- <div class="inside">
1920
- <p>You can apply any necessary CSS styles below:</p>
1921
- <?php $this->googlelanguagetranslator_css_cb(); ?>
1922
- </div>
1923
- </div>
1924
- </div>
1925
- <?php $this->googlelanguagetranslator_flags_order_cb(); ?>
1926
- </form>
1927
-
1928
- <div class="metabox-holder notranslate" style="float: right; width: 33%;">
1929
- <div class="postbox">
1930
- <h3>GLT Premium 3.0.6 is Here! $15</h3>
1931
- <div class="inside"><a href="http://www.wp-studio.net/" target="_blank"><img style="background:#444; border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px" src="<?php echo plugins_url('google-language-translator/images/logo.png'); ?>"></a><br />
1932
- <ul id="features">
1933
- <li>81 Languages</li>
1934
- <li>"Elegant" language switcher theme</li>
1935
- <li>Loads inline with page content</li>
1936
- <li>Custom flag choices for English, Spanish and Portuguese</li>
1937
- <li>User-friendly URLs, reloads with <code>lang</code> attribute</li>
1938
- <li>Drag/drop flags to re-arrange their order</li>
1939
- <li>Full access to our support forum</li>
1940
- <li>Full access to all future updates</li>
1941
- </ul>
1942
- </div>
1943
- </div>
1944
- </div>
1945
-
1946
- <div class="metabox-holder notranslate" style="float: right; width: 33%;">
1947
- <div class="postbox">
1948
- <h3>Please Consider A Donation</h3>
1949
- <div class="inside">If you like this plugin and find it useful, help keep this plugin actively developed by clicking the donate button <br /><br />
1950
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
1951
- <input type="hidden" name="cmd" value="_donations">
1952
- <input type="hidden" name="business" value="robertmyrick@hotmail.com">
1953
- <input type="hidden" name="lc" value="US">
1954
- <input type="hidden" name="item_name" value="Support Studio 88 Design and help us bring you more Wordpress goodies! Any donation is kindly appreciated. Thank you!">
1955
- <input type="hidden" name="no_note" value="0">
1956
- <input type="hidden" name="currency_code" value="USD">
1957
- <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHostedGuest">
1958
- <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
1959
- <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
1960
- </form>
1961
- <br />
1962
- <br />
1963
- </div>
1964
- </div>
1965
- </div>
1966
- </div> <!-- .wrap -->
1967
- <?php
1968
- }
1969
- }
1970
-
 
 
 
 
 
 
 
 
 
 
 
 
1971
  $google_language_translator = new google_language_translator();
1
+ <?php
2
+ /*
3
+ Plugin Name: Google Language Translator
4
+ Plugin URI: http://www.studio88design.com/plugins/google-language-translator
5
+ Version: 4.0.1
6
+ Description: The MOST SIMPLE Google Translator plugin. This plugin adds Google Translator to your website by using a single shortcode, [google-translator]. Settings include: layout style, hide/show specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
7
+ Author: Rob Myrick
8
+ Author URI: http://www.studio88design.com/
9
+ */
10
+
11
+ include( plugin_dir_path( __FILE__ ) . 'widget.php');
12
+
13
+ class google_language_translator {
14
+
15
+ public $languages_array = array(
16
+ 'af' => 'Afrikaans',
17
+ 'sq' => 'Albanian',
18
+ 'ar' => 'Arabic',
19
+ 'hy' => 'Armenian',
20
+ 'az' => 'Azerbaijani',
21
+ 'eu' => 'Basque',
22
+ 'be' => 'Belarusian',
23
+ 'bn' => 'Bengali',
24
+ 'bs' => 'Bosnian',
25
+ 'bg' => 'Bulgarian',
26
+ 'ca' => 'Catalan',
27
+ 'ceb' => 'Cebuano',
28
+ 'zh-CN' => 'Chinese(Simplified)',
29
+ 'zh-TW' => 'Chinese(Traditional)',
30
+ 'hr' => 'Croatian',
31
+ 'cs' => 'Czech',
32
+ 'da' => 'Danish',
33
+ 'nl' => 'Dutch',
34
+ 'en' => 'English',
35
+ 'eo' => 'Esperanto',
36
+ 'et' => 'Estonian',
37
+ 'tl' => 'Filipino',
38
+ 'fi' => 'Finnish',
39
+ 'fr' => 'French',
40
+ 'gl' => 'Galician',
41
+ 'ka' => 'Georgian',
42
+ 'de' => 'German',
43
+ 'el' => 'Greek',
44
+ 'gu' => 'Gujarati',
45
+ 'ht' => 'Haitian',
46
+ 'ha' => 'Hausa',
47
+ 'iw' => 'Hebrew',
48
+ 'hi' => 'Hindi',
49
+ 'hmn' => 'Hmong',
50
+ 'hu' => 'Hungarian',
51
+ 'is' => 'Icelandic',
52
+ 'ig' => 'Igbo',
53
+ 'id' => 'Indonesian',
54
+ 'ga' => 'Irish',
55
+ 'it' => 'Italian',
56
+ 'ja' => 'Japanese',
57
+ 'jw' => 'Javanese',
58
+ 'kn' => 'Kannada',
59
+ 'km' => 'Khmer',
60
+ 'ko' => 'Korean',
61
+ 'lo' => 'Lao',
62
+ 'la' => 'Latin',
63
+ 'lv' => 'Latvian',
64
+ 'lt' => 'Lithuanian',
65
+ 'mk' => 'Macedonian',
66
+ 'ms' => 'Malay',
67
+ 'mt' => 'Maltese',
68
+ 'mi' => 'Maori',
69
+ 'mr' => 'Marathi',
70
+ 'mn' => 'Mongolian',
71
+ 'ne' => 'Nepali',
72
+ 'no' => 'Norwegian',
73
+ 'fa' => 'Persian',
74
+ 'pl' => 'Polish',
75
+ 'pt' => 'Portuguese',
76
+ 'pa' => 'Punjabi',
77
+ 'ro' => 'Romanian',
78
+ 'ru' => 'Russian',
79
+ 'sr' => 'Serbian',
80
+ 'sk' => 'Slovak',
81
+ 'sl' => 'Slovenian',
82
+ 'so' => 'Somali',
83
+ 'es' => 'Spanish',
84
+ 'sw' => 'Swahili',
85
+ 'sv' => 'Swedish',
86
+ 'ta' => 'Tamil',
87
+ 'te' => 'Telugu',
88
+ 'th' => 'Thai',
89
+ 'tr' => 'Turkish',
90
+ 'uk' => 'Ukranian',
91
+ 'ur' => 'Urdu',
92
+ 'vi' => 'Vietnamese',
93
+ 'cy' => 'Welsh',
94
+ 'yi' => 'Yiddish',
95
+ 'yo' => 'Yoruba',
96
+ 'zu' => 'Zulu'
97
+ );
98
+
99
+ public function __construct(){
100
+
101
+ register_activation_hook( __FILE__, array( $this, 'glt_activate' ) );
102
+
103
+ add_action('admin_menu',array(&$this, 'page_layout'));
104
+ add_action('admin_init',array(&$this, 'initialize_settings'));
105
+ add_action('wp_head',array(&$this, 'load_css'));
106
+ add_action('admin_head',array(&$this, 'load_css'));
107
+ add_shortcode( 'google-translator',array(&$this, 'google_translator_shortcode'));
108
+ add_filter('widget_text','do_shortcode');
109
+
110
+ if (!is_admin()) {
111
+ add_action('init',array(&$this, 'flags'));
112
+ }
113
+ }
114
+
115
+ public function glt_activate() {
116
+ add_option('googlelanguagetranslator_active', 1);
117
+ add_option('googlelanguagetranslator_language','en');
118
+ add_option('googlelanguagetranslator_language_option','all');
119
+ add_option('language_display_settings',array ('en' => 1));
120
+ add_option('googlelanguagetranslator_flags','show_flags');
121
+ add_option('flag_display_settings',array ('flag-en' => 1));
122
+ add_option('googlelanguagetranslator_translatebox','yes');
123
+ add_option('googlelanguagetranslator_display','Vertical');
124
+ add_option('googlelanguagetranslator_toolbar','Yes');
125
+ add_option('googlelanguagetranslator_showbranding','Yes');
126
+ add_option('googlelanguagetranslator_flags_alignment','flags_left');
127
+ add_option('googlelanguagetranslator_analytics',1);
128
+ add_option('googlelanguagetranslator_analytics_id','');
129
+ add_option('googlelanguagetranslator_css','');
130
+ add_option('googlelanguagetranslator_manage_translations',0);
131
+ add_option('googlelanguagetranslator_multilanguage',0);
132
+ add_option('googlelanguagetranslator_floating_widget','yes');
133
+ }
134
+
135
+ public function load_css() {
136
+ include( plugin_dir_path( __FILE__ ) . 'css/style.php');
137
+ }
138
+
139
+ public function scripts($hook_suffix) {
140
+ global $p;
141
+ if ($p == $hook_suffix) {
142
+ wp_enqueue_script( 'cookie.js', plugins_url('js/cookie.js',__FILE__), array('jquery'));
143
+ wp_enqueue_script( 'my-admin-script', plugins_url('js/admin.js',__FILE__), array('jquery'));
144
+ wp_enqueue_script( 'my-flag-script', plugins_url('js/flags.js',__FILE__), array('jquery'));
145
+
146
+ if (get_option ('googlelanguagetranslator_floating_widget') == 'yes') {
147
+ wp_enqueue_script( 'my-toolbar-script', plugins_url('js/toolbar.js',__FILE__), array('jquery'));
148
+ wp_enqueue_script( 'my-load-toolbar-script', plugins_url('js/load-toolbar.js',__FILE__), array('jquery'));
149
+ wp_register_style( 'toolbar.css', plugins_url('css/toolbar.css', __FILE__) );
150
+ wp_enqueue_style( 'toolbar.css' );
151
+ }
152
+
153
+ wp_enqueue_script( 'jquery-ui.js', plugins_url('js/jquery-ui.js',__FILE__), array('jquery'));
154
+ wp_enqueue_script( 'jquery-ui-sortable.js', plugins_url('js/jquery-ui-sortable.js',__FILE__), array('jquery'));
155
+ wp_enqueue_script( 'jquery-ui-widget.js', plugins_url('js/jquery-ui-widget.js',__FILE__), array('jquery'));
156
+ wp_enqueue_script( 'jquery-ui-mouse.js', plugins_url('js/jquery-ui-mouse.js',__FILE__), array('jquery'));
157
+ wp_enqueue_script( 'load_sortable_flags', plugins_url('js/load-sortable-flags.js',__FILE__), array('jquery'));
158
+ wp_register_style( 'jquery-ui.css', plugins_url('css/jquery-ui.css',__FILE__) );
159
+ wp_register_style( 'style.css', plugins_url('css/style.css', __FILE__) );
160
+ wp_enqueue_style( 'style.css' );
161
+ wp_enqueue_style( 'jquery-ui.css' );
162
+ }
163
+ }
164
+
165
+ public function flags() {
166
+ wp_enqueue_script( 'flags', plugins_url('js/flags.js',__FILE__), array('jquery'));
167
+
168
+ if (get_option ('googlelanguagetranslator_floating_widget') == 'yes') {
169
+ wp_enqueue_script( 'my-toolbar-script', plugins_url('js/toolbar.js',__FILE__), array('jquery'));
170
+ wp_enqueue_script( 'my-load-toolbar-script', plugins_url('js/load-toolbar.js',__FILE__), array('jquery'));
171
+ wp_register_style( 'toolbar.css', plugins_url('css/toolbar.css', __FILE__) );
172
+ wp_enqueue_style( 'toolbar.css' );
173
+ }
174
+
175
+ wp_register_style( 'style.css', plugins_url('css/style.css', __FILE__) );
176
+ wp_enqueue_style( 'style.css' );
177
+ }
178
+
179
+ public function page_layout () {
180
+ global $p;
181
+
182
+ add_action( 'admin_enqueue_scripts',array(&$this, 'scripts'));
183
+ add_action('admin_head',array(&$this, 'load_css'));
184
+
185
+ $p = add_options_page('Google Language Translator', 'Google Language Translator', 'manage_options', 'google_language_translator', array(&$this, 'page_layout_cb'));
186
+ }
187
+
188
+
189
+ public function google_translator_shortcode() {
190
+ if (get_option('googlelanguagetranslator_display')=='Vertical'){
191
+ return $this->googlelanguagetranslator_vertical();
192
+ }
193
+
194
+ elseif(get_option('googlelanguagetranslator_display')=='Horizontal'){
195
+ return $this->googlelanguagetranslator_horizontal();
196
+ }
197
+ }
198
+
199
+ public function googlelanguagetranslator_included_languages() {
200
+ if ( get_option('googlelanguagetranslator_language_option')=='specific') {
201
+ $get_language_choices = get_option ('language_display_settings');
202
+
203
+ foreach ($get_language_choices as $key=>$value) {
204
+ if($value == 1) {
205
+ $items[] = $key;
206
+ }
207
+ }
208
+
209
+ $comma_separated = implode(",",array_values($items));
210
+
211
+ if ( get_option('googlelanguagetranslator_display') == 'Vertical') {
212
+ $lang = ', includedLanguages:\''.$comma_separated.'\'';
213
+ return $lang;
214
+ } elseif ( get_option('googlelanguagetranslator_display') == 'Horizontal') {
215
+ $lang = ', includedLanguages:\''.$comma_separated.'\'';
216
+ return $lang;
217
+ }
218
+ }
219
+ }
220
+
221
+ public function analytics() {
222
+ if ( get_option('googlelanguagetranslator_analytics') == 1 ) {
223
+ $analytics_id = get_option('googlelanguagetranslator_analytics_id');
224
+ $analytics = 'gaTrack: true, gaId: \''.$analytics_id.'\'';
225
+ return ', '.$analytics;
226
+ }
227
+ }
228
+
229
+ public function googlelanguagetranslator_vertical(){
230
+ $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
231
+ $new_languages_array = explode(",",$new_languages_array_string);
232
+ $new_languages_array_codes = array_values($new_languages_array);
233
+ $get_language_choices = get_option ('language_display_settings');
234
+ $flag_width = get_option('googlelanguagetranslator_flag_size');
235
+ $default_language_code = get_option('googlelanguagetranslator_language');
236
+ $is_active = get_option ( 'googlelanguagetranslator_active' );
237
+ $get_flag_choices = get_option ('flag_display_settings');
238
+ $get_language_option = get_option('googlelanguagetranslator_language_option');
239
+ $language_choices = $this->googlelanguagetranslator_included_languages();
240
+ $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
241
+ $str = '';
242
+
243
+ if( $is_active == 1){
244
+
245
+ foreach ($get_flag_choices as $flag_choice_key) {}
246
+
247
+ if ($floating_widget=='yes' && $get_language_option != 'specific') {
248
+ $str.='<div id="glt-translate-trigger"><span class="notranslate">Translate &raquo;</strong></div>';
249
+ $str.='<div id="glt-toolbar">';
250
+ $str.='<ul id="sortable" class="ui-sortable">';
251
+
252
+ if (empty($new_languages_array_string)) {
253
+ foreach ($this->languages_array as $key=>$value) {
254
+ $language_code = $key;
255
+ $language_name = $value;
256
+ $language_name_flag = $language_name;
257
+
258
+ if ($flag_choice_key == '1') {
259
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
260
+ $str.='<a id="'.$language_name.'" href="#" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$languge_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="24" width="24" alt="'.$language_name.'"/></a>';
261
+ }//isset
262
+ } //$key
263
+ }//foreach
264
+ } else {
265
+ foreach ($new_languages_array_codes as $value) {
266
+ $language_name = $value;
267
+ $language_code = array_search ($language_name,$this->languages_array);
268
+ $language_name_flag = $language_name;
269
+
270
+ if ($flag_choice_key == '1') {
271
+ if (in_array($language_name,$this->languages_array)) {
272
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
273
+ $str.='<a id="'.$language_name.'" href="#" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$language_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="24" width="24" alt="'.$language_name.'"/></a>';
274
+ } //isset
275
+ } //in_array
276
+ }//if
277
+ }//foreach
278
+ }
279
+ $str.='</ul>';
280
+ $str.='</div>';
281
+ } //endif $floating_widget
282
+
283
+ $str.='<div id="flags">';
284
+ $str.='<ul id="sortable" class="ui-sortable" style="float:left">';
285
+
286
+ if (empty($new_languages_array_string)) {
287
+ foreach ($this->languages_array as $key=>$value) {
288
+ $language_code = $key;
289
+ $language_name = $value;
290
+ $language_name_flag = $language_name;
291
+
292
+ if ($flag_choice_key == '1') {
293
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
294
+ $str.='<a id="'.$language_name.'" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$language_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="'.$flag_width.'" width="'.$flag_width.'" alt="'.$language_name.'"/></a>';
295
+ }
296
+ } //$key
297
+ }//foreach
298
+ } else {
299
+ foreach ($new_languages_array_codes as $value) {
300
+ $language_name = $value;
301
+ $language_code = array_search ($language_name,$this->languages_array);
302
+ $language_name_flag = $language_name;
303
+
304
+ if ($flag_choice_key == '1') {
305
+ if (in_array($language_name,$this->languages_array)) {
306
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
307
+ $str.='<a id="'.$language_name.'" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$language_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="'.$flag_width.'" width="'.$flag_width.'" alt="'.$flag_width.'"/></a>';
308
+ } //isset
309
+ } //in_array
310
+ }//flag_choice_key
311
+ }//foreach
312
+ }//else
313
+
314
+ $str.='</ul>';
315
+ $str.='</div>';
316
+
317
+ $is_multilanguage = get_option('googlelanguagetranslator_multilanguage');
318
+ $auto_display = ', autoDisplay: false';
319
+
320
+ if ($is_multilanguage == 1) {
321
+ $multilanguagePage = ', multilanguagePage:true';
322
+
323
+ $str.='<script type="text/javascript">
324
+ function GoogleLanguageTranslatorInit() {
325
+ new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\''.$language_choices . $auto_display . $multilanguagePage . $this->analytics().'}, \'google_language_translator\');}
326
+ </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
327
+ <div id="google_language_translator"></div>';
328
+ return $str;
329
+ } elseif ($is_multilanguage == 0) {
330
+
331
+ $str.='<script type="text/javascript">
332
+ function GoogleLanguageTranslatorInit() {
333
+ new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\''.$language_choices . $auto_display . $this->analytics().'}, \'google_language_translator\');}
334
+ </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
335
+ <div id="google_language_translator"></div>';
336
+ return $str;
337
+ }
338
+ } //End is_active
339
+ } // End glt_vertical
340
+
341
+ public function googlelanguagetranslator_horizontal(){
342
+ $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
343
+ $new_languages_array = explode(",",$new_languages_array_string);
344
+ $new_languages_array_codes = array_values($new_languages_array);
345
+ $get_language_choices = get_option ('language_display_settings');
346
+ $flag_width = get_option('googlelanguagetranslator_flag_size');
347
+ $default_language_code = get_option('googlelanguagetranslator_language');
348
+ $is_active = get_option ( 'googlelanguagetranslator_active' );
349
+ $get_flag_choices = get_option ('flag_display_settings');
350
+ $get_language_option = get_option('googlelanguagetranslator_language_option');
351
+ $language_choices = $this->googlelanguagetranslator_included_languages();
352
+ $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
353
+ $str = '';
354
+
355
+ if( $is_active == 1) {
356
+ foreach ($get_flag_choices as $flag_choice_key) {}
357
+
358
+ if ($floating_widget=='yes' && $get_language_option != 'specific') {
359
+ $str.='<div id="glt-translate-trigger"><span class="notranslate">Translate &raquo;</strong></div>';
360
+ $str.='<div id="glt-toolbar">';
361
+ $str.='<ul id="sortable" class="ui-sortable" style="float:left">';
362
+
363
+ if (empty($new_languages_array_string)) {
364
+
365
+ foreach ($this->languages_array as $key=>$value) {
366
+ $language_code = $key;
367
+ $language_name = $value;
368
+ $language_name_flag = $language_name;
369
+
370
+ if ($flag_choice_key == '1') {
371
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
372
+ $str.='<a id="'.$language_name.'" href="#" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$languge_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="24" width="24" alt="'.$language_name.'"/></a>';
373
+ }
374
+ } //$key
375
+ }//foreach
376
+
377
+
378
+ } elseif (!empty($new_languages_array_string)) {
379
+
380
+ foreach ($new_languages_array_codes as $value) {
381
+ $language_name = $value;
382
+ $language_code = array_search ($language_name,$this->languages_array);
383
+ $language_name_flag = $language_name;
384
+
385
+ if ($flag_choice_key == '1') {
386
+ if (in_array($language_name,$this->languages_array)) {
387
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
388
+ $str.='<a id="'.$language_name.'" href="#" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$languge_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="24" width="24" alt="'.$language_name.'"/></a>';
389
+ }
390
+ } //$in_array
391
+ } //$key
392
+ }//foreach
393
+ }//empty
394
+
395
+ $str.='</ul>';
396
+ $str.='</div>';
397
+ }
398
+
399
+ $str.='<div id="flags">';
400
+ $str.='<ul id="sortable" class="ui-sortable">';
401
+
402
+ if (empty($new_languages_array_string)) {
403
+
404
+ foreach ($this->languages_array as $key=>$value) {
405
+ $language_code = $key;
406
+ $language_name = $value;
407
+ $language_name_flag = $language_name;
408
+
409
+ if ($flag_choice_key == '1') {
410
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
411
+ $str.='<a id="'.$language_name.'" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$language_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="'.$flag_width.'" width="'.$flag_width.'" alt="'.$language_name.'"/></a>';
412
+ }
413
+ } //$key
414
+ }//foreach
415
+ } elseif (!empty($new_languages_array_string)) {
416
+
417
+ foreach ($new_languages_array_codes as $value) {
418
+ $language_name = $value;
419
+ $language_code = array_search ($language_name,$this->languages_array);
420
+ $language_name_flag = $language_name;
421
+
422
+ if ($flag_choice_key == '1') {
423
+ if ( isset ( $get_flag_choices['flag-'.$language_code.''] ) ) {
424
+ $str.='<a id="'.$language_name.'" onclick="doGoogleLanguageTranslator(\''.$default_language_code.'|'.$language_code.'\'); return false;" title="'.$language_name.'" class="notranslate flag '.$language_code.'"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/'.$language_name_flag.'.png" height="'.$flag_width.'" width="'.$flag_width.'" alt="'.$language_name.'"/></a>';
425
+ } //isset
426
+ }//$flag_choice_key
427
+ }//foreach
428
+ }//elseif
429
+
430
+ $str.='</ul>';
431
+ $str.='</div>';
432
+
433
+ $is_multilanguage = get_option('googlelanguagetranslator_multilanguage');
434
+ $horizontal_layout = ', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL';
435
+ $auto_display = ', autoDisplay: false';
436
+
437
+ if ($is_multilanguage == 1) {
438
+ $multilanguagePage = ', multilanguagePage:true';
439
+
440
+ $str.='<script type="text/javascript">
441
+ function GoogleLanguageTranslatorInit() {
442
+ new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\''. $language_choices . $horizontal_layout . $auto_display . $multilanguagePage . $this->analytics().'}, \'google_language_translator\');}
443
+ </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
444
+ <div id="google_language_translator"></div>';
445
+ return $str;
446
+ } elseif ($is_multilanguage == 0) {
447
+
448
+ $str.='<script type="text/javascript">
449
+ function GoogleLanguageTranslatorInit() {
450
+ new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\''. $language_choices . $horizontal_layout . $auto_display . $this->analytics().'}, \'google_language_translator\');}
451
+ </script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
452
+ <div id="google_language_translator"></div>';
453
+ return $str;
454
+ }
455
+ }
456
+ } // End glt_horizontal
457
+
458
+ public function initialize_settings() {
459
+
460
+ // First, we register a section. This is necessary since all future options must belong to one.
461
+ add_settings_section(
462
+ 'glt_settings', // ID used to identify this section and with which to register options
463
+ 'Settings', // Title to be displayed on the administration page
464
+ '', // Callback used to render the description of the section
465
+ 'google_language_translator' // Page on which to add this section of options
466
+ );
467
+
468
+ //Fieldset 1
469
+ add_settings_field( 'googlelanguagetranslator_active','Plugin status:','googlelanguagetranslator_active_cb','google_language_translator','glt_settings');
470
+ add_settings_field( 'googlelanguagetranslator_language','Choose the original language of your website','','googlelanguagetranslator_language_cb','glt_settings');
471
+ add_settings_field( 'googlelanguagetranslator_language_option','What translation languages will you display to website visitors?','googlelanguagetranslator_language_option_cb','google_language_translator','glt_settings');
472
+ add_settings_field( 'language_display_settings','Your language choices','language_display_settings_cb','google_language_translator','glt_settings');
473
+ add_settings_field( 'googlelanguagetranslator_flags','Show Flag Images?','googlelanguagetranslator_flags_cb','google_language_translator','glt_settings');
474
+ add_settings_field( 'flag_display_settings','Flag Options','flag_display_settings_cb','google_language_translator','glt_settings');
475
+ add_settings_field( 'googlelanguagetranslator_translatebox','Show Translate Box?','googlelanguagetranslator_translatebox_cb','google_language_translator','glt_settings');
476
+ add_settings_field( 'googlelanguagetranslator_display', 'Layout Options','googlelanguagetranslator_display_cb','google_language_translator','glt_settings');
477
+ add_settings_field( 'googlelanguagetranslator_toolbar', 'Show Toolbar','googlelanguagetranslator_toolbar_cb','google_language_translator','glt_settings');
478
+ add_settings_field( 'googlelanguagetranslator_showbranding', 'Show Google Branding','googlelanguagetranslator_showbranding_cb','google_language_translator','glt_settings');
479
+ add_settings_field( 'googlelanguagetranslator_flags_alignment', 'Align Flags Right or Left', 'googlelanguagetranslator_flags_alignment_cb','google_language_translator','glt_settings');
480
+ add_settings_field( 'googlelanguagetranslator_analytics','Activate Google Analytics tracking?','googlelanguagetranslator_analytics_cb','google_language_translator','glt_settings');
481
+ add_settings_field( 'googlelanguagetranslator_analytics_id','Enter your Google Analytics ID','googlelanguagetranslator_analytics_id_cb','google_language_translator','glt_settings');
482
+ add_settings_field( 'googlelanguagetranslator_css','Custom CSS Overrides','googlelanguagetranslator_css_cb','google_language_translator','glt_settings');
483
+ add_settings_field( 'googlelanguagetranslator_manage_translations','Turn on translation management?','googlelanguagetranslator_manage_translations_cb','google_language_translator','glt_settings');
484
+ add_settings_field( 'googlelanguagetranslator_multilanguage','Multilanguage webpages?','googlelanguagetranslator_multilanguage_cb','google_language_translator','glt_settings');
485
+ add_settings_field( 'googlelanguagetranslator_floating_widget','Show floating translation widget?','googlelanguagetranslator_floating_widget_cb','google_language_translator','glt_settings');
486
+ add_settings_field( 'googlelanguagetranslator_flag_size','Flag sizes:','googlelanguagetranslator_flag_size_cb','google_language_translator','glt_settings');
487
+ add_settings_field( 'googlelanguagetranslator_flags_order','The order of flag positions','googlelanguagetranslator_flags_order_cb','google_language_translator','glt_settings');
488
+
489
+ //Register Fieldset 1
490
+ register_setting( 'google_language_translator','googlelanguagetranslator_active');
491
+ register_setting( 'google_language_translator','googlelanguagetranslator_language');
492
+ register_setting( 'google_language_translator','googlelanguagetranslator_language_option');
493
+ register_setting( 'google_language_translator','language_display_settings');
494
+ register_setting( 'google_language_translator','googlelanguagetranslator_flags');
495
+ register_setting( 'google_language_translator','flag_display_settings');
496
+ register_setting( 'google_language_translator','googlelanguagetranslator_translatebox');
497
+ register_setting( 'google_language_translator','googlelanguagetranslator_display');
498
+ register_setting( 'google_language_translator','googlelanguagetranslator_toolbar');
499
+ register_setting( 'google_language_translator','googlelanguagetranslator_showbranding');
500
+ register_setting( 'google_language_translator','googlelanguagetranslator_flags_alignment');
501
+ register_setting( 'google_language_translator','googlelanguagetranslator_disable_mootools');
502
+ register_setting( 'google_language_translator','googlelanguagetranslator_disable_modal');
503
+ register_setting( 'google_language_translator','googlelanguagetranslator_analytics');
504
+ register_setting( 'google_language_translator','googlelanguagetranslator_analytics_id');
505
+ register_setting( 'google_language_translator','googlelanguagetranslator_css');
506
+ register_setting( 'google_language_translator','googlelanguagetranslator_manage_translations');
507
+ register_setting( 'google_language_translator','googlelanguagetranslator_multilanguage');
508
+ register_setting( 'google_language_translator','googlelanguagetranslator_floating_widget');
509
+ register_setting( 'google_language_translator','googlelanguagetranslator_flag_size');
510
+ register_setting( 'google_language_translator','googlelanguagetranslator_flags_order');
511
+ }
512
+
513
+ public function googlelanguagetranslator_active_cb() {
514
+
515
+ $option_name = 'googlelanguagetranslator_active' ;
516
+ $new_value = 1;
517
+
518
+ if ( get_option( $option_name ) === false ) {
519
+
520
+ // The option does not exist, so we update it.
521
+ update_option( $option_name, $new_value );
522
+ }
523
+
524
+ $options = get_option (''.$option_name.'');
525
+
526
+ $html = '<input type="checkbox" name="googlelanguagetranslator_active" id="googlelanguagetranslator_active" value="1" '.checked(1,$options,false).'/> &nbsp; Activate Google Language Translator?';
527
+ echo $html;
528
+ }
529
+
530
+ public function googlelanguagetranslator_language_cb() {
531
+
532
+ $option_name = 'googlelanguagetranslator_language';
533
+ $new_value = 'en';
534
+
535
+ if ( get_option( $option_name ) === false ) {
536
+
537
+ // The option does not exist, so we update it.
538
+ update_option( $option_name, $new_value );
539
+ }
540
+
541
+ $options = get_option (''.$option_name.''); ?>
542
+ <select name="googlelanguagetranslator_language" id="googlelanguagetranslator_language">
543
+ <option value="af" <?php if($options=='af'){echo "selected";}?>>Afrikaans</option>
544
+ <option value="sq" <?php if($options=='sq'){echo "selected";}?>>Albanian</option>
545
+ <option value="ar" <?php if($options=='ar'){echo "selected";}?>>Arabic</option>
546
+ <option value="hy" <?php if($options=='hy'){echo "selected";}?>>Armenian</option>
547
+ <option value="az" <?php if($options=='az'){echo "selected";}?>>Azerbaijani</option>
548
+ <option value="eu" <?php if($options=='eu'){echo "selected";}?>>Basque</option>
549
+ <option value="be" <?php if($options=='be'){echo "selected";}?>>Belarusian</option>
550
+ <option value="bn" <?php if($options=='bn'){echo "selected";}?>>Bengali</option>
551
+ <option value="bs" <?php if($options=='bs'){echo "selected";}?>>Bosnian</option>
552
+ <option value="bg" <?php if($options=='bg'){echo "selected";}?>>Bulgarian</option>
553
+ <option value="ca" <?php if($options=='ca'){echo "selected";}?>>Catalan</option>
554
+ <option value="ceb" <?php if($options=='ceb'){echo "selected";}?>>Cebuano</option>
555
+ <option value="zh-CN" <?php if($options=='zh-CN'){echo "selected";}?>>Chinese</option>
556
+ <option value="zh-TW" <?php if($options=='zh-TW'){echo "selected";}?>>Chinese (Han)</option>
557
+ <option value="hr" <?php if($options=='hr'){echo "selected";}?>>Croatian</option>
558
+ <option value="cs" <?php if($options=='cs'){echo "selected";}?>>Czech</option>
559
+ <option value="da" <?php if($options=='da'){echo "selected";}?>>Danish</option>
560
+ <option value="nl" <?php if($options=='nl'){echo "selected";}?>>Dutch</option>
561
+ <option value="en" <?php if($options=='en'){echo "selected";}?>>English</option>
562
+ <option value="eo" <?php if($options=='eo'){echo "selected";}?>>Esperanto</option>
563
+ <option value="et" <?php if($options=='et'){echo "selected";}?>>Estonian</option>
564
+ <option value="tl" <?php if($options=='tl'){echo "selected";}?>>Filipino</option>
565
+ <option value="fi" <?php if($options=='fi'){echo "selected";}?>>Finnish</option>
566
+ <option value="fr" <?php if($options=='fr'){echo "selected";}?>>French</option>
567
+ <option value="gl" <?php if($options=='gl'){echo "selected";}?>>Galician</option>
568
+ <option value="ka" <?php if($options=='ka'){echo "selected";}?>>Georgian</option>
569
+ <option value="de" <?php if($options=='de'){echo "selected";}?>>German</option>
570
+ <option value="el" <?php if($options=='el'){echo "selected";}?>>Greek</option>
571
+ <option value="gu" <?php if($options=='gu'){echo "selected";}?>>Gujarati</option>
572
+ <option value="ht" <?php if($options=='ht'){echo "selected";}?>>Haitian Creole</option>
573
+ <option value="ha" <?php if($options=='ha'){echo "selected";}?>>Hausa</option>
574
+ <option value="iw" <?php if($options=='iw'){echo "selected";}?>>Hebrew</option>
575
+ <option value="hi" <?php if($options=='hi'){echo "selected";}?>>Hindi</option>
576
+ <option value="hmn" <?php if($options=='hmn'){echo "selected";}?>>Hmong</option>
577
+ <option value="hu" <?php if($options=='hu'){echo "selected";}?>>Hungarian</option>
578
+ <option value="is" <?php if($options=='is'){echo "selected";}?>>Icelandic</option>
579
+ <option value="ig" <?php if($options=='ig'){echo "selected";}?>>Igbo</option>
580
+ <option value="id" <?php if($options=='id'){echo "selected";}?>>Indonesian</option>
581
+ <option value="ga" <?php if($options=='ga'){echo "selected";}?>>Irish</option>
582
+ <option value="it" <?php if($options=='it'){echo "selected";}?>>Italian</option>
583
+ <option value="ja" <?php if($options=='ja'){echo "selected";}?>>Japanese</option>
584
+ <option value="jw" <?php if($options=='jw'){echo "selected";}?>>Javanese</option>
585
+ <option value="kn" <?php if($options=='kn'){echo "selected";}?>>Kannada</option>
586
+ <option value="km" <?php if($options=='km'){echo "selected";}?>>Khmer</option>
587
+ <option value="ko" <?php if($options=='ko'){echo "selected";}?>>Korean</option>
588
+ <option value="lo" <?php if($options=='lo'){echo "selected";}?>>Lao</option>
589
+ <option value="la" <?php if($options=='la'){echo "selected";}?>>Latin</option>
590
+ <option value="lv" <?php if($options=='lv'){echo "selected";}?>>Latvian</option>
591
+ <option value="lt" <?php if($options=='lt'){echo "selected";}?>>Lithuanian</option>
592
+ <option value="mk" <?php if($options=='mk'){echo "selected";}?>>Macedonian</option>
593
+ <option value="ms" <?php if($options=='ms'){echo "selected";}?>>Malay</option>
594
+ <option value="mt" <?php if($options=='mt'){echo "selected";}?>>Maltese</option>
595
+ <option value="mi" <?php if($options=='mi'){echo "selected";}?>>Maori</option>
596
+ <option value="mr" <?php if($options=='mr'){echo "selected";}?>>Marathi</option>
597
+ <option value="mn" <?php if($options=='mn'){echo "selected";}?>>Mongolian</option>
598
+ <option value="ne" <?php if($options=='ne'){echo "selected";}?>>Nepali</option>
599
+ <option value="no" <?php if($options=='no'){echo "selected";}?>>Norwegian</option>
600
+ <option value="fa" <?php if($options=='fa'){echo "selected";}?>>Persian</option>
601
+ <option value="pl" <?php if($options=='pl'){echo "selected";}?>>Polish</option>
602
+ <option value="pt" <?php if($options=='pt'){echo "selected";}?>>Portuguese</option>
603
+ <option value="pa" <?php if($options=='pa'){echo "selected";}?>>Punjabi</option>
604
+ <option value="ro" <?php if($options=='ro'){echo "selected";}?>>Romanian</option>
605
+ <option value="ru" <?php if($options=='ru'){echo "selected";}?>>Russian</option>
606
+ <option value="sr" <?php if($options=='sr'){echo "selected";}?>>Serbian</option>
607
+ <option value="sk" <?php if($options=='sk'){echo "selected";}?>>Slovak</option>
608
+ <option value="sl" <?php if($options=='sl'){echo "selected";}?>>Slovenian</option>
609
+ <option value="so" <?php if($options=='so'){echo "selected";}?>>Somali</option>
610
+ <option value="es" <?php if($options=='es'){echo "selected";}?>>Spanish</option>
611
+ <option value="sw" <?php if($options=='sw'){echo "selected";}?>>Swahili</option>
612
+ <option value="sv" <?php if($options=='sv'){echo "selected";}?>>Swedish</option>
613
+ <option value="ta" <?php if($options=='ta'){echo "selected";}?>>Tamil</option>
614
+ <option value="te" <?php if($options=='te'){echo "selected";}?>>Telugu</option>
615
+ <option value="th" <?php if($options=='th'){echo "selected";}?>>Thai</option>
616
+ <option value="tr" <?php if($options=='tr'){echo "selected";}?>>Turkish</option>
617
+ <option value="uk" <?php if($options=='uk'){echo "selected";}?>>Ukranian</option>
618
+ <option value="ur" <?php if($options=='ur'){echo "selected";}?>>Urdu</option>
619
+ <option value="vi" <?php if($options=='vi'){echo "selected";}?>>Vietnamese</option>
620
+ <option value="cy" <?php if($options=='cy'){echo "selected";}?>>Welsh</option>
621
+ <option value="yi" <?php if($options=='yi'){echo "selected";}?>>Yiddish</option>
622
+ <option value="cy" <?php if($options=='cy'){echo "selected";}?>>Yoruba</option>
623
+ <option value="yi" <?php if($options=='yi'){echo "selected";}?>>Zulu</option>
624
+
625
+ </select>
626
+ <?php
627
+ }
628
+
629
+ public function googlelanguagetranslator_language_option_cb() {
630
+
631
+ $option_name = 'googlelanguagetranslator_language_option' ;
632
+ $new_value = 'all';
633
+
634
+ if ( get_option( $option_name ) === false ) {
635
+
636
+ // The option does not exist, so we update it.
637
+ update_option( $option_name, $new_value );
638
+ }
639
+
640
+ $options = get_option (''.$option_name.''); ?>
641
+
642
+ <input type="radio" name="googlelanguagetranslator_language_option" id="googlelanguagetranslator_language_option" value="all" <?php if($options=='all'){echo "checked";}?>/> All Languages<br/>
643
+ <input type="radio" name="googlelanguagetranslator_language_option" id="googlelanguagetranslator_language_option" value="specific" <?php if($options=='specific'){echo "checked";}?>/> Specific Languages
644
+ <?php
645
+ }
646
+
647
+ public function language_display_settings_cb() {
648
+ $defaults = array (
649
+ 'en' => 1
650
+ );
651
+
652
+ $option_name = 'language_display_settings' ;
653
+ $new_value = $defaults;
654
+
655
+ if ( get_option( $option_name ) === false ) {
656
+
657
+ // The option does not exist, so we update it.
658
+ update_option( $option_name, $new_value );
659
+ }
660
+
661
+ $get_language_choices = get_option (''.$option_name.'');
662
+
663
+ if (!isset ( $get_language_choices ['af'] ) ) {
664
+ $get_language_choices['af'] = 0;
665
+ }
666
+
667
+ if (!isset ( $get_language_choices ['sq'] ) ) {
668
+ $get_language_choices['sq'] = 0;
669
+ }
670
+
671
+ if (!isset ( $get_language_choices ['ar'] ) ) {
672
+ $get_language_choices['ar'] = 0;
673
+ }
674
+
675
+ if (!isset ( $get_language_choices ['hy'] ) ) {
676
+ $get_language_choices['hy'] = 0;
677
+ }
678
+
679
+ if (!isset ( $get_language_choices ['az'] ) ) {
680
+ $get_language_choices['az'] = 0;
681
+ }
682
+
683
+ if (!isset ( $get_language_choices ['eu'] ) ) {
684
+ $get_language_choices['eu'] = 0;
685
+ }
686
+
687
+ if (!isset ( $get_language_choices ['be'] ) ) {
688
+ $get_language_choices['be'] = 0;
689
+ }
690
+
691
+ if (!isset ( $get_language_choices ['bn'] ) ) {
692
+ $get_language_choices['bn'] = 0;
693
+ }
694
+
695
+ if (!isset ( $get_language_choices ['bs'] ) ) {
696
+ $get_language_choices['bs'] = 0;
697
+ }
698
+
699
+ if (!isset ( $get_language_choices ['bg'] ) ) {
700
+ $get_language_choices['bg'] = 0;
701
+ }
702
+
703
+ if (!isset ( $get_language_choices ['ca'] ) ) {
704
+ $get_language_choices['ca'] = 0;
705
+ }
706
+
707
+ if (!isset ( $get_language_choices ['ceb'] ) ) {
708
+ $get_language_choices['ceb'] = 0;
709
+ }
710
+
711
+ if (!isset ( $get_language_choices ['zh-CN'] ) ) {
712
+ $get_language_choices['zh-CN'] = 0;
713
+ }
714
+
715
+ if (!isset ( $get_language_choices ['zh-TW'] ) ) {
716
+ $get_language_choices['zh-TW'] = 0;
717
+ }
718
+
719
+ if (!isset ( $get_language_choices ['hr'] ) ) {
720
+ $get_language_choices['hr'] = 0;
721
+ }
722
+
723
+ if (!isset ( $get_language_choices ['cs'] ) ) {
724
+ $get_language_choices['cs'] = 0;
725
+ }
726
+
727
+ if (!isset ( $get_language_choices ['da'] ) ) {
728
+ $get_language_choices['da'] = 0;
729
+ }
730
+
731
+ if (!isset ( $get_language_choices ['nl'] ) ) {
732
+ $get_language_choices['nl'] = 0;
733
+ }
734
+
735
+ if (!isset ( $get_language_choices ['en'] ) ) {
736
+ $get_language_choices['en'] = 1;
737
+ }
738
+
739
+ if (!isset ( $get_language_choices ['eo'] ) ) {
740
+ $get_language_choices['eo'] = 0;
741
+ }
742
+
743
+ if (!isset ( $get_language_choices ['et'] ) ) {
744
+ $get_language_choices['et'] = 0;
745
+ }
746
+
747
+ if (!isset ( $get_language_choices ['tl'] ) ) {
748
+ $get_language_choices['tl'] = 0;
749
+ }
750
+
751
+ if (!isset ( $get_language_choices ['fi'] ) ) {
752
+ $get_language_choices['fi'] = 0;
753
+ }
754
+
755
+ if (!isset ( $get_language_choices ['fr'] ) ) {
756
+ $get_language_choices['fr'] = 0;
757
+ }
758
+
759
+ if (!isset ( $get_language_choices ['gl'] ) ) {
760
+ $get_language_choices['gl'] = 0;
761
+ }
762
+
763
+ if (!isset ( $get_language_choices ['ka'] ) ) {
764
+ $get_language_choices['ka'] = 0;
765
+ }
766
+
767
+ if (!isset ( $get_language_choices ['de'] ) ) {
768
+ $get_language_choices['de'] = 0;
769
+ }
770
+
771
+ if (!isset ( $get_language_choices ['el'] ) ) {
772
+ $get_language_choices['el'] = 0;
773
+ }
774
+
775
+ if (!isset ( $get_language_choices ['gu'] ) ) {
776
+ $get_language_choices['gu'] = 0;
777
+ }
778
+
779
+ if (!isset ( $get_language_choices ['ht'] ) ) {
780
+ $get_language_choices['ht'] = 0;
781
+ }
782
+
783
+ if (!isset ( $get_language_choices ['ha'] ) ) {
784
+ $get_language_choices['ha'] = 0;
785
+ }
786
+
787
+ if (!isset ( $get_language_choices ['iw'] ) ) {
788
+ $get_language_choices['iw'] = 0;
789
+ }
790
+
791
+ if (!isset ( $get_language_choices ['hi'] ) ) {
792
+ $get_language_choices['hi'] = 0;
793
+ }
794
+
795
+ if (!isset ( $get_language_choices ['hmn'] ) ) {
796
+ $get_language_choices['hmn'] = 0;
797
+ }
798
+
799
+ if (!isset ( $get_language_choices ['hu'] ) ) {
800
+ $get_language_choices['hu'] = 0;
801
+ }
802
+
803
+ if (!isset ( $get_language_choices ['is'] ) ) {
804
+ $get_language_choices['is'] = 0;
805
+ }
806
+
807
+ if (!isset ( $get_language_choices ['ig'] ) ) {
808
+ $get_language_choices['ig'] = 0;
809
+ }
810
+
811
+ if (!isset ( $get_language_choices ['id'] ) ) {
812
+ $get_language_choices['id'] = 0;
813
+ }
814
+
815
+ if (!isset ( $get_language_choices ['ga'] ) ) {
816
+ $get_language_choices['ga'] = 0;
817
+ }
818
+
819
+ if (!isset ( $get_language_choices ['it'] ) ) {
820
+ $get_language_choices['it'] = 0;
821
+ }
822
+
823
+ if (!isset ( $get_language_choices ['ja'] ) ) {
824
+ $get_language_choices['ja'] = 0;
825
+ }
826
+
827
+ if (!isset ( $get_language_choices ['jw'] ) ) {
828
+ $get_language_choices['jw'] = 0;
829
+ }
830
+
831
+ if (!isset ( $get_language_choices ['kn'] ) ) {
832
+ $get_language_choices['kn'] = 0;
833
+ }
834
+
835
+ if (!isset ( $get_language_choices ['km'] ) ) {
836
+ $get_language_choices['km'] = 0;
837
+ }
838
+
839
+ if (!isset ( $get_language_choices ['ko'] ) ) {
840
+ $get_language_choices['ko'] = 0;
841
+ }
842
+
843
+ if (!isset ( $get_language_choices ['lo'] ) ) {
844
+ $get_language_choices['lo'] = 0;
845
+ }
846
+
847
+ if (!isset ( $get_language_choices ['la'] ) ) {
848
+ $get_language_choices['la'] = 0;
849
+ }
850
+
851
+ if (!isset ( $get_language_choices ['lv'] ) ) {
852
+ $get_language_choices['lv'] = 0;
853
+ }
854
+
855
+ if (!isset ( $get_language_choices ['lt'] ) ) {
856
+ $get_language_choices['lt'] = 0;
857
+ }
858
+
859
+ if (!isset ( $get_language_choices ['mk'] ) ) {
860
+ $get_language_choices['mk'] = 0;
861
+ }
862
+
863
+ if (!isset ( $get_language_choices ['ms'] ) ) {
864
+ $get_language_choices['ms'] = 0;
865
+ }
866
+
867
+ if (!isset ( $get_language_choices ['mt'] ) ) {
868
+ $get_language_choices['mt'] = 0;
869
+ }
870
+
871
+ if (!isset ( $get_language_choices ['mi'] ) ) {
872
+ $get_language_choices['mi'] = 0;
873
+ }
874
+
875
+ if (!isset ( $get_language_choices ['mr'] ) ) {
876
+ $get_language_choices['mr'] = 0;
877
+ }
878
+
879
+ if (!isset ( $get_language_choices ['mn'] ) ) {
880
+ $get_language_choices['mn'] = 0;
881
+ }
882
+
883
+ if (!isset ( $get_language_choices ['ne'] ) ) {
884
+ $get_language_choices['ne'] = 0;
885
+ }
886
+
887
+ if (!isset ( $get_language_choices ['no'] ) ) {
888
+ $get_language_choices['no'] = 0;
889
+ }
890
+
891
+ if (!isset ( $get_language_choices ['fa'] ) ) {
892
+ $get_language_choices['fa'] = 0;
893
+ }
894
+
895
+ if (!isset ( $get_language_choices ['pl'] ) ) {
896
+ $get_language_choices['pl'] = 0;
897
+ }
898
+
899
+ if (!isset ( $get_language_choices ['pt'] ) ) {
900
+ $get_language_choices['pt'] = 0;
901
+ }
902
+
903
+ if (!isset ( $get_language_choices ['pa'] ) ) {
904
+ $get_language_choices['pa'] = 0;
905
+ }
906
+
907
+ if (!isset ( $get_language_choices ['ro'] ) ) {
908
+ $get_language_choices['ro'] = 0;
909
+ }
910
+
911
+ if (!isset ( $get_language_choices ['ru'] ) ) {
912
+ $get_language_choices['ru'] = 0;
913
+ }
914
+
915
+ if (!isset ( $get_language_choices ['sr'] ) ) {
916
+ $get_language_choices['sr'] = 0;
917
+ }
918
+
919
+ if (!isset ( $get_language_choices ['sk'] ) ) {
920
+ $get_language_choices['sk'] = 0;
921
+ }
922
+
923
+ if (!isset ( $get_language_choices ['sl'] ) ) {
924
+ $get_language_choices['sl'] = 0;
925
+ }
926
+
927
+ if (!isset ( $get_language_choices ['so'] ) ) {
928
+ $get_language_choices['so'] = 0;
929
+ }
930
+
931
+ if (!isset ( $get_language_choices ['es'] ) ) {
932
+ $get_language_choices['es'] = 0;
933
+ }
934
+
935
+ if (!isset ( $get_language_choices ['sw'] ) ) {
936
+ $get_language_choices['sw'] = 0;
937
+ }
938
+
939
+ if (!isset ( $get_language_choices ['sv'] ) ) {
940
+ $get_language_choices['sv'] = 0;
941
+ }
942
+
943
+ if (!isset ( $get_language_choices ['ta'] ) ) {
944
+ $get_language_choices['ta'] = 0;
945
+ }
946
+
947
+ if (!isset ( $get_language_choices ['te'] ) ) {
948
+ $get_language_choices['te'] = 0;
949
+ }
950
+
951
+ if (!isset ( $get_language_choices ['th'] ) ) {
952
+ $get_language_choices['th'] = 0;
953
+ }
954
+
955
+ if (!isset ( $get_language_choices ['tr'] ) ) {
956
+ $get_language_choices['tr'] = 0;
957
+ }
958
+
959
+ if (!isset ( $get_language_choices ['uk'] ) ) {
960
+ $get_language_choices['uk'] = 0;
961
+ }
962
+
963
+ if (!isset ( $get_language_choices ['ur'] ) ) {
964
+ $get_language_choices['ur'] = 0;
965
+ }
966
+
967
+ if (!isset ( $get_language_choices ['vi'] ) ) {
968
+ $get_language_choices['vi'] = 0;
969
+ }
970
+
971
+ if (!isset ( $get_language_choices ['cy'] ) ) {
972
+ $get_language_choices['cy'] = 0;
973
+ }
974
+
975
+ if (!isset ( $get_language_choices ['yi'] ) ) {
976
+ $get_language_choices['yi'] = 0;
977
+ }
978
+
979
+ if (!isset ( $get_language_choices ['yo'] ) ) {
980
+ $get_language_choices['yo'] = 0;
981
+ }
982
+
983
+ if (!isset ( $get_language_choices ['zu'] ) ) {
984
+ $get_language_choices['zu'] = 0;
985
+ } ?>
986
+
987
+ <div class="languages" style="width:25%; float:left">
988
+ <div><input type="checkbox" name="language_display_settings[af]" value="1" <?php if ( 1 == $get_language_choices['af'] ) echo 'checked="checked"'; ?>/> Afrikaans</div>
989
+ <div><input type="checkbox" name="language_display_settings[sq]" value="1" <?php if ( 1 == $get_language_choices['sq'] ) echo 'checked="checked"'; ?>/> Albanian</div>
990
+ <div><input type="checkbox" name="language_display_settings[ar]" value="1" <?php if ( 1 == $get_language_choices['ar'] ) echo 'checked="checked"'; ?>/> Arabic</div>
991
+ <div><input type="checkbox" name="language_display_settings[hy]" value="1" <?php if ( 1 == $get_language_choices['hy'] ) echo 'checked="checked"'; ?>/> Armenian</div>
992
+ <div><input type="checkbox" name="language_display_settings[az]" value="1" <?php if ( 1 == $get_language_choices['az'] ) echo 'checked="checked"'; ?>/> Azerbaijani</div>
993
+ <div><input type="checkbox" name="language_display_settings[eu]" value="1" <?php if ( 1 == $get_language_choices['eu'] ) echo 'checked="checked"'; ?>/> Basque</div>
994
+ <div><input type="checkbox" name="language_display_settings[be]" value="1" <?php if ( 1 == $get_language_choices['be'] ) echo 'checked="checked"'; ?>/> Belarusian</div>
995
+ <div><input type="checkbox" name="language_display_settings[bn]" value="1" <?php if ( 1 == $get_language_choices['bn'] ) echo 'checked="checked"'; ?>/> Bengali</div>
996
+ <div><input type="checkbox" name="language_display_settings[bs]" value="1" <?php if ( 1 == $get_language_choices['bs'] ) echo 'checked="checked"'; ?>/> Bosnian</div>
997
+ <div><input type="checkbox" name="language_display_settings[bg]" value="1" <?php if ( 1 == $get_language_choices['bg'] ) echo 'checked="checked"'; ?>/> Bulgarian</div>
998
+ <div><input type="checkbox" name="language_display_settings[ca]" value="1" <?php if ( 1 == $get_language_choices['ca'] ) echo 'checked="checked"'; ?>/> Catalan</div>
999
+ <div><input type="checkbox" name="language_display_settings[ceb]" value="1" <?php if ( 1 == $get_language_choices['ceb'] ) echo 'checked="checked"'; ?>/> Cebuano</div>
1000
+ <div><input type="checkbox" name="language_display_settings[zh-CN]" value="1" <?php if ( 1 == $get_language_choices['zh-CN'] ) echo 'checked="checked"'; ?>/> Chinese</div>
1001
+ <div><input type="checkbox" name="language_display_settings[zh-TW]" value="1" <?php if ( 1 == $get_language_choices['zh-TW'] ) echo 'checked="checked"'; ?>/> Chinese (Han)</div>
1002
+ <div><input type="checkbox" name="language_display_settings[hr]" value="1" <?php if ( 1 == $get_language_choices['hr'] ) echo 'checked="checked"'; ?>/> Croatian</div>
1003
+ <div><input type="checkbox" name="language_display_settings[cs]" value="1" <?php if ( 1 == $get_language_choices['cs'] ) echo 'checked="checked"'; ?>/> Czech</div>
1004
+ <div><input type="checkbox" name="language_display_settings[da]" value="1" <?php if ( 1 == $get_language_choices['da'] ) echo 'checked="checked"'; ?>/> Danish</div>
1005
+ <div><input type="checkbox" name="language_display_settings[nl]" value="1" <?php if ( 1 == $get_language_choices['nl'] ) echo 'checked="checked"'; ?>/> Dutch</div>
1006
+ <div><input type="checkbox" name="language_display_settings[en]" value="1" <?php if ( 1 == $get_language_choices['en'] ) echo 'checked="checked"'; ?>/> English</div>
1007
+ <div><input type="checkbox" name="language_display_settings[eo]" value="1" <?php if ( 1 == $get_language_choices['eo'] ) echo 'checked="checked"'; ?>/> Esperanto</div>
1008
+ <div><input type="checkbox" name="language_display_settings[et]" value="1" <?php if ( 1 == $get_language_choices['et'] ) echo 'checked="checked"'; ?>/> Estonian</div>
1009
+ </div>
1010
+
1011
+ <div class="languages" style="width:25%; float:left">
1012
+ <div><input type="checkbox" name="language_display_settings[tl]" value="1" <?php if ( 1 == $get_language_choices['tl'] ) echo 'checked="checked"'; ?>/> Filipino</div>
1013
+ <div><input type="checkbox" name="language_display_settings[fi]" value="1" <?php if ( 1 == $get_language_choices['fi'] ) echo 'checked="checked"'; ?>/> Finnish</div>
1014
+ <div><input type="checkbox" name="language_display_settings[fr]" value="1" <?php if ( 1 == $get_language_choices['fr'] ) echo 'checked="checked"'; ?>/> French</div>
1015
+ <div><input type="checkbox" name="language_display_settings[gl]" value="1" <?php if ( 1 == $get_language_choices['gl'] ) echo 'checked="checked"'; ?>/> Galician</div>
1016
+ <div><input type="checkbox" name="language_display_settings[ka]" value="1" <?php if ( 1 == $get_language_choices['ka'] ) echo 'checked="checked"'; ?>/> Georgian</div>
1017
+ <div><input type="checkbox" name="language_display_settings[de]" value="1" <?php if ( 1 == $get_language_choices['de'] ) echo 'checked="checked"'; ?>/> German</div>
1018
+ <div><input type="checkbox" name="language_display_settings[el]" value="1" <?php if ( 1 == $get_language_choices['el'] ) echo 'checked="checked"'; ?>/> Greek</div>
1019
+ <div><input type="checkbox" name="language_display_settings[gu]" value="1" <?php if ( 1 == $get_language_choices['gu'] ) echo 'checked="checked"'; ?>/> Gujarati</div>
1020
+ <div><input type="checkbox" name="language_display_settings[ht]" value="1" <?php if ( 1 == $get_language_choices['ht'] ) echo 'checked="checked"'; ?>/> Haitian Creole</div>
1021
+ <div><input type="checkbox" name="language_display_settings[ha]" value="1" <?php if ( 1 == $get_language_choices['ha'] ) echo 'checked="checked"'; ?>/> Hausa</div>
1022
+ <div><input type="checkbox" name="language_display_settings[iw]" value="1" <?php if ( 1 == $get_language_choices['iw'] ) echo 'checked="checked"'; ?>/> Hebrew</div>
1023
+ <div><input type="checkbox" name="language_display_settings[hi]" value="1" <?php if ( 1 == $get_language_choices['hi'] ) echo 'checked="checked"'; ?>/> Hindi</div>
1024
+ <div><input type="checkbox" name="language_display_settings[hmn]" value="1" <?php if ( 1 == $get_language_choices['hmn'] ) echo 'checked="checked"'; ?>/> Hmong</div>
1025
+ <div><input type="checkbox" name="language_display_settings[hu]" value="1" <?php if ( 1 == $get_language_choices['hu'] ) echo 'checked="checked"'; ?>/> Hungarian</div>
1026
+ <div><input type="checkbox" name="language_display_settings[is]" value="1" <?php if ( 1 == $get_language_choices['is'] ) echo 'checked="checked"'; ?>/> Icelandic</div>
1027
+ <div><input type="checkbox" name="language_display_settings[ig]" value="1" <?php if ( 1 == $get_language_choices['ig'] ) echo 'checked="checked"'; ?>/> Igbo</div>
1028
+ <div><input type="checkbox" name="language_display_settings[id]" value="1" <?php if ( 1 == $get_language_choices['id'] ) echo 'checked="checked"'; ?>/> Indonesian</div>
1029
+ <div><input type="checkbox" name="language_display_settings[ga]" value="1" <?php if ( 1 == $get_language_choices['ga'] ) echo 'checked="checked"'; ?>/> Irish</div>
1030
+ <div><input type="checkbox" name="language_display_settings[it]" value="1" <?php if ( 1 == $get_language_choices['it'] ) echo 'checked="checked"'; ?>/> Italian</div>
1031
+ <div><input type="checkbox" name="language_display_settings[ja]" value="1" <?php if ( 1 == $get_language_choices['ja'] ) echo 'checked="checked"'; ?>/> Japanese</div>
1032
+ <div><input type="checkbox" name="language_display_settings[jw]" value="1" <?php if ( 1 == $get_language_choices['jw'] ) echo 'checked="checked"'; ?>/> Javanese</div>
1033
+ </div>
1034
+
1035
+ <div class="languages" style="width:25%; float:left">
1036
+ <div><input type="checkbox" name="language_display_settings[kn]" value="1" <?php if ( 1 == $get_language_choices['kn'] ) echo 'checked="checked"'; ?>/> Kannada</div>
1037
+ <div><input type="checkbox" name="language_display_settings[km]" value="1" <?php if ( 1 == $get_language_choices['km'] ) echo 'checked="checked"'; ?>/> Khmer</div>
1038
+ <div><input type="checkbox" name="language_display_settings[ko]" value="1" <?php if ( 1 == $get_language_choices['ko'] ) echo 'checked="checked"'; ?>/> Korean</div>
1039
+ <div><input type="checkbox" name="language_display_settings[lo]" value="1" <?php if ( 1 == $get_language_choices['lo'] ) echo 'checked="checked"'; ?>/> Lao</div>
1040
+ <div><input type="checkbox" name="language_display_settings[la]" value="1" <?php if ( 1 == $get_language_choices['la'] ) echo 'checked="checked"'; ?>/> Latin</div>
1041
+ <div><input type="checkbox" name="language_display_settings[lv]" value="1" <?php if ( 1 == $get_language_choices['lv'] ) echo 'checked="checked"'; ?>/> Latvian</div>
1042
+ <div><input type="checkbox" name="language_display_settings[lt]" value="1" <?php if ( 1 == $get_language_choices['lt'] ) echo 'checked="checked"'; ?>/> Lithuanian</div>
1043
+ <div><input type="checkbox" name="language_display_settings[mk]" value="1" <?php if ( 1 == $get_language_choices['mk'] ) echo 'checked="checked"'; ?>/> Macedonian</div>
1044
+ <div><input type="checkbox" name="language_display_settings[ms]" value="1" <?php if ( 1 == $get_language_choices['ms'] ) echo 'checked="checked"'; ?>/> Malay</div>
1045
+ <div><input type="checkbox" name="language_display_settings[mt]" value="1" <?php if ( 1 == $get_language_choices['mt'] ) echo 'checked="checked"'; ?>/> Maltese</div>
1046
+ <div><input type="checkbox" name="language_display_settings[mi]" value="1" <?php if ( 1 == $get_language_choices['mi'] ) echo 'checked="checked"'; ?>/> Maori</div>
1047
+ <div><input type="checkbox" name="language_display_settings[mr]" value="1" <?php if ( 1 == $get_language_choices['mr'] ) echo 'checked="checked"'; ?>/> Marathi</div>
1048
+ <div><input type="checkbox" name="language_display_settings[mn]" value="1" <?php if ( 1 == $get_language_choices['mn'] ) echo 'checked="checked"'; ?>/> Mongolian</div>
1049
+ <div><input type="checkbox" name="language_display_settings[ne]" value="1" <?php if ( 1 == $get_language_choices['ne'] ) echo 'checked="checked"'; ?>/> Nepali</div>
1050
+ <div><input type="checkbox" name="language_display_settings[no]" value="1" <?php if ( 1 == $get_language_choices['no'] ) echo 'checked="checked"'; ?>/> Norwegian</div>
1051
+ <div><input type="checkbox" name="language_display_settings[fa]" value="1" <?php if ( 1 == $get_language_choices['fa'] ) echo 'checked="checked"'; ?>/> Persian</div>
1052
+ <div><input type="checkbox" name="language_display_settings[pl]" value="1" <?php if ( 1 == $get_language_choices['pl'] ) echo 'checked="checked"'; ?>/> Polish</div>
1053
+ <div><input type="checkbox" name="language_display_settings[pt]" value="1" <?php if ( 1 == $get_language_choices['pt'] ) echo 'checked="checked"'; ?>/> Portuguese</div>
1054
+ <div><input type="checkbox" name="language_display_settings[pa]" value="1" <?php if ( 1 == $get_language_choices['pa'] ) echo 'checked="checked"'; ?>/> Punjabi</div>
1055
+ <div><input type="checkbox" name="language_display_settings[ro]" value="1" <?php if ( 1 == $get_language_choices['ro'] ) echo 'checked="checked"'; ?>/> Romanian</div>
1056
+ <div><input type="checkbox" name="language_display_settings[ru]" value="1" <?php if ( 1 == $get_language_choices['ru'] ) echo 'checked="checked"'; ?>/> Russian</div>
1057
+ </div>
1058
+
1059
+ <div class="languages" style="width:25%; float:left">
1060
+ <div><input type="checkbox" name="language_display_settings[sr]" value="1" <?php if ( 1 == $get_language_choices['sr'] ) echo 'checked="checked"'; ?>/> Serbian</div>
1061
+ <div><input type="checkbox" name="language_display_settings[sk]" value="1" <?php if ( 1 == $get_language_choices['sk'] ) echo 'checked="checked"'; ?>/> Slovak</div>
1062
+ <div><input type="checkbox" name="language_display_settings[sl]" value="1" <?php if ( 1 == $get_language_choices['sl'] ) echo 'checked="checked"'; ?>/> Slovenian</div>
1063
+ <div><input type="checkbox" name="language_display_settings[so]" value="1" <?php if ( 1 == $get_language_choices['so'] ) echo 'checked="checked"'; ?>/> Somali</div>
1064
+ <div><input type="checkbox" name="language_display_settings[es]" value="1" <?php if ( 1 == $get_language_choices['es'] ) echo 'checked="checked"'; ?>/> Spanish</div>
1065
+ <div><input type="checkbox" name="language_display_settings[sw]" value="1" <?php if ( 1 == $get_language_choices['sw'] ) echo 'checked="checked"'; ?>/> Swahili</div>
1066
+ <div><input type="checkbox" name="language_display_settings[sv]" value="1" <?php if ( 1 == $get_language_choices['sv'] ) echo 'checked="checked"'; ?>/> Swedish</div>
1067
+ <div><input type="checkbox" name="language_display_settings[ta]" value="1" <?php if ( 1 == $get_language_choices['ta'] ) echo 'checked="checked"'; ?>/> Tamil</div>
1068
+ <div><input type="checkbox" name="language_display_settings[te]" value="1" <?php if ( 1 == $get_language_choices['te'] ) echo 'checked="checked"'; ?>/> Telugu</div>
1069
+ <div><input type="checkbox" name="language_display_settings[th]" value="1" <?php if ( 1 == $get_language_choices['th'] ) echo 'checked="checked"'; ?>/> Thai</div>
1070
+ <div><input type="checkbox" name="language_display_settings[tr]" value="1" <?php if ( 1 == $get_language_choices['tr'] ) echo 'checked="checked"'; ?>/> Turkish</div>
1071
+ <div><input type="checkbox" name="language_display_settings[uk]" value="1" <?php if ( 1 == $get_language_choices['uk'] ) echo 'checked="checked"'; ?>/> Ukranian</div>
1072
+ <div><input type="checkbox" name="language_display_settings[ur]" value="1" <?php if ( 1 == $get_language_choices['ur'] ) echo 'checked="checked"'; ?>/> Urdu</div>
1073
+ <div><input type="checkbox" name="language_display_settings[vi]" value="1" <?php if ( 1 == $get_language_choices['vi'] ) echo 'checked="checked"'; ?>/> Vietnamese</div>
1074
+ <div><input type="checkbox" name="language_display_settings[cy]" value="1" <?php if ( 1 == $get_language_choices['cy'] ) echo 'checked="checked"'; ?>/> Welsh</div>
1075
+ <div><input type="checkbox" name="language_display_settings[yi]" value="1" <?php if ( 1 == $get_language_choices['yi'] ) echo 'checked="checked"'; ?>/> Yiddish</div>
1076
+ <div><input type="checkbox" name="language_display_settings[yo]" value="1" <?php if ( 1 == $get_language_choices['yo'] ) echo 'checked="checked"'; ?>/> Yoruba</div>
1077
+ <div><input type="checkbox" name="language_display_settings[zu]" value="1" <?php if ( 1 == $get_language_choices['zu'] ) echo 'checked="checked"'; ?>/> Zulu</div>
1078
+
1079
+ </div>
1080
+
1081
+ <div style="clear:both"></div>
1082
+ <?php }
1083
+
1084
+ public function googlelanguagetranslator_flags_cb() {
1085
+
1086
+ $option_name = 'googlelanguagetranslator_flags' ;
1087
+ $new_value = 'show_flags';
1088
+
1089
+ if ( get_option( $option_name ) === false ) {
1090
+
1091
+ // The option does not exist, so we update it.
1092
+ update_option( $option_name, $new_value );
1093
+ }
1094
+
1095
+ $options = get_option (''.$option_name.''); ?>
1096
+
1097
+ <input type="radio" name="googlelanguagetranslator_flags" id="googlelanguagetranslator_flags" value="show_flags" <?php if($options=='show_flags'){echo "checked";}?>/> Yes, show flag images<br/>
1098
+ <input type="radio" name="googlelanguagetranslator_flags" id="googlelanguagetranslator_flags" value="hide_flags" <?php if($options=='hide_flags'){echo "checked";}?>/> No, hide flag images
1099
+ <?php
1100
+ }
1101
+
1102
+ public function flag_display_settings_cb() {
1103
+ $defaults = array(
1104
+ 'flag-en' => 1
1105
+ );
1106
+
1107
+ $option_name = 'flag_display_settings' ;
1108
+ $new_value = $defaults;
1109
+
1110
+ if ( get_option( $option_name ) === false ) {
1111
+
1112
+ // The option does not exist, so we update it.
1113
+ update_option( $option_name, $new_value );
1114
+ }
1115
+
1116
+ $get_flag_choices = get_option (''.$option_name.'');
1117
+
1118
+ if (!isset ( $get_flag_choices ['flag-af'] ) ) {
1119
+ $get_flag_choices['flag-af'] = 0;
1120
+ }
1121
+
1122
+ if (!isset ( $get_flag_choices ['flag-sq'] ) ) {
1123
+ $get_flag_choices['flag-sq'] = 0;
1124
+ }
1125
+
1126
+ if (!isset ( $get_flag_choices ['flag-ar'] ) ) {
1127
+ $get_flag_choices['flag-ar'] = 0;
1128
+ }
1129
+
1130
+ if (!isset ( $get_flag_choices ['flag-hy'] ) ) {
1131
+ $get_flag_choices['flag-hy'] = 0;
1132
+ }
1133
+
1134
+ if (!isset ( $get_flag_choices ['flag-az'] ) ) {
1135
+ $get_flag_choices['flag-az'] = 0;
1136
+ }
1137
+
1138
+ if (!isset ( $get_flag_choices ['flag-eu'] ) ) {
1139
+ $get_flag_choices['flag-eu'] = 0;
1140
+ }
1141
+
1142
+ if (!isset ( $get_flag_choices ['flag-be'] ) ) {
1143
+ $get_flag_choices['flag-be'] = 0;
1144
+ }
1145
+
1146
+ if (!isset ( $get_flag_choices ['flag-bn'] ) ) {
1147
+ $get_flag_choices['flag-bn'] = 0;
1148
+ }
1149
+
1150
+ if (!isset ( $get_flag_choices ['flag-bs'] ) ) {
1151
+ $get_flag_choices['flag-bs'] = 0;
1152
+ }
1153
+
1154
+ if (!isset ( $get_flag_choices ['flag-bg'] ) ) {
1155
+ $get_flag_choices['flag-bg'] = 0;
1156
+ }
1157
+
1158
+ if (!isset ( $get_flag_choices ['flag-ca'] ) ) {
1159
+ $get_flag_choices['flag-ca'] = 0;
1160
+ }
1161
+
1162
+ if (!isset ( $get_flag_choices ['flag-ceb'] ) ) {
1163
+ $get_flag_choices['flag-ceb'] = 0;
1164
+ }
1165
+
1166
+ if (!isset ( $get_flag_choices ['flag-zh-CN'] ) ) {
1167
+ $get_flag_choices['flag-zh-CN'] = 0;
1168
+ }
1169
+
1170
+ if (!isset ( $get_flag_choices ['flag-zh-TW'] ) ) {
1171
+ $get_flag_choices['flag-zh-TW'] = 0;
1172
+ }
1173
+
1174
+ if (!isset ( $get_flag_choices ['flag-hr'] ) ) {
1175
+ $get_flag_choices['flag-hr'] = 0;
1176
+ }
1177
+
1178
+ if (!isset ( $get_flag_choices ['flag-cs'] ) ) {
1179
+ $get_flag_choices['flag-cs'] = 0;
1180
+ }
1181
+
1182
+ if (!isset ( $get_flag_choices ['flag-da'] ) ) {
1183
+ $get_flag_choices['flag-da'] = 0;
1184
+ }
1185
+
1186
+ if (!isset ( $get_flag_choices ['flag-nl'] ) ) {
1187
+ $get_flag_choices['flag-nl'] = 0;
1188
+ }
1189
+
1190
+ if (!isset ( $get_flag_choices ['flag-en'] ) ) {
1191
+ $get_flag_choices['flag-en'] = 1;
1192
+ }
1193
+
1194
+ if (!isset ( $get_flag_choices ['flag-eo'] ) ) {
1195
+ $get_flag_choices['flag-eo'] = 0;
1196
+ }
1197
+
1198
+ if (!isset ( $get_flag_choices ['flag-et'] ) ) {
1199
+ $get_flag_choices['flag-et'] = 0;
1200
+ }
1201
+
1202
+ if (!isset ( $get_flag_choices ['flag-tl'] ) ) {
1203
+ $get_flag_choices['flag-tl'] = 0;
1204
+ }
1205
+
1206
+ if (!isset ( $get_flag_choices ['flag-fi'] ) ) {
1207
+ $get_flag_choices['flag-fi'] = 0;
1208
+ }
1209
+
1210
+ if (!isset ( $get_flag_choices ['flag-fr'] ) ) {
1211
+ $get_flag_choices['flag-fr'] = 0;
1212
+ }
1213
+
1214
+ if (!isset ( $get_flag_choices ['flag-gl'] ) ) {
1215
+ $get_flag_choices['flag-gl'] = 0;
1216
+ }
1217
+
1218
+ if (!isset ( $get_flag_choices ['flag-ka'] ) ) {
1219
+ $get_flag_choices['flag-ka'] = 0;
1220
+ }
1221
+
1222
+ if (!isset ( $get_flag_choices ['flag-de'] ) ) {
1223
+ $get_flag_choices['flag-de'] = 0;
1224
+ }
1225
+
1226
+ if (!isset ( $get_flag_choices ['flag-el'] ) ) {
1227
+ $get_flag_choices['flag-el'] = 0;
1228
+ }
1229
+
1230
+ if (!isset ( $get_flag_choices ['flag-gu'] ) ) {
1231
+ $get_flag_choices['flag-gu'] = 0;
1232
+ }
1233
+
1234
+ if (!isset ( $get_flag_choices ['flag-ht'] ) ) {
1235
+ $get_flag_choices['flag-ht'] = 0;
1236
+ }
1237
+
1238
+ if (!isset ( $get_flag_choices ['flag-ha'] ) ) {
1239
+ $get_flag_choices['flag-ha'] = 0;
1240
+ }
1241
+
1242
+ if (!isset ( $get_flag_choices ['flag-iw'] ) ) {
1243
+ $get_flag_choices['flag-iw'] = 0;
1244
+ }
1245
+
1246
+ if (!isset ( $get_flag_choices ['flag-hi'] ) ) {
1247
+ $get_flag_choices['flag-hi'] = 0;
1248
+ }
1249
+
1250
+ if (!isset ( $get_flag_choices ['flag-hmn'] ) ) {
1251
+ $get_flag_choices['flag-hmn'] = 0;
1252
+ }
1253
+
1254
+ if (!isset ( $get_flag_choices ['flag-hu'] ) ) {
1255
+ $get_flag_choices['flag-hu'] = 0;
1256
+ }
1257
+
1258
+ if (!isset ( $get_flag_choices ['flag-is'] ) ) {
1259
+ $get_flag_choices['flag-is'] = 0;
1260
+ }
1261
+
1262
+ if (!isset ( $get_flag_choices ['flag-ig'] ) ) {
1263
+ $get_flag_choices['flag-ig'] = 0;
1264
+ }
1265
+
1266
+ if (!isset ( $get_flag_choices ['flag-id'] ) ) {
1267
+ $get_flag_choices['flag-id'] = 0;
1268
+ }
1269
+
1270
+ if (!isset ( $get_flag_choices ['flag-ga'] ) ) {
1271
+ $get_flag_choices['flag-ga'] = 0;
1272
+ }
1273
+
1274
+ if (!isset ( $get_flag_choices ['flag-it'] ) ) {
1275
+ $get_flag_choices['flag-it'] = 0;
1276
+ }
1277
+
1278
+ if (!isset ( $get_flag_choices ['flag-ja'] ) ) {
1279
+ $get_flag_choices['flag-ja'] = 0;
1280
+ }
1281
+
1282
+ if (!isset ( $get_flag_choices ['flag-jw'] ) ) {
1283
+ $get_flag_choices['flag-jw'] = 0;
1284
+ }
1285
+
1286
+ if (!isset ( $get_flag_choices ['flag-kn'] ) ) {
1287
+ $get_flag_choices['flag-kn'] = 0;
1288
+ }
1289
+
1290
+ if (!isset ( $get_flag_choices ['flag-km'] ) ) {
1291
+ $get_flag_choices['flag-km'] = 0;
1292
+ }
1293
+
1294
+ if (!isset ( $get_flag_choices ['flag-ko'] ) ) {
1295
+ $get_flag_choices['flag-ko'] = 0;
1296
+ }
1297
+
1298
+ if (!isset ( $get_flag_choices ['flag-lo'] ) ) {
1299
+ $get_flag_choices['flag-lo'] = 0;
1300
+ }
1301
+
1302
+ if (!isset ( $get_flag_choices ['flag-la'] ) ) {
1303
+ $get_flag_choices['flag-la'] = 0;
1304
+ }
1305
+
1306
+ if (!isset ( $get_flag_choices ['flag-lv'] ) ) {
1307
+ $get_flag_choices['flag-lv'] = 0;
1308
+ }
1309
+
1310
+ if (!isset ( $get_flag_choices ['flag-lt'] ) ) {
1311
+ $get_flag_choices['flag-lt'] = 0;
1312
+ }
1313
+
1314
+ if (!isset ( $get_flag_choices ['flag-mk'] ) ) {
1315
+ $get_flag_choices['flag-mk'] = 0;
1316
+ }
1317
+
1318
+ if (!isset ( $get_flag_choices ['flag-ms'] ) ) {
1319
+ $get_flag_choices['flag-ms'] = 0;
1320
+ }
1321
+
1322
+ if (!isset ( $get_flag_choices ['flag-mt'] ) ) {
1323
+ $get_flag_choices['flag-mt'] = 0;
1324
+ }
1325
+
1326
+ if (!isset ( $get_flag_choices ['flag-mi'] ) ) {
1327
+ $get_flag_choices['flag-mi'] = 0;
1328
+ }
1329
+
1330
+ if (!isset ( $get_flag_choices ['flag-mr'] ) ) {
1331
+ $get_flag_choices['flag-mr'] = 0;
1332
+ }
1333
+
1334
+ if (!isset ( $get_flag_choices ['flag-mn'] ) ) {
1335
+ $get_flag_choices['flag-mn'] = 0;
1336
+ }
1337
+
1338
+ if (!isset ( $get_flag_choices ['flag-ne'] ) ) {
1339
+ $get_flag_choices['flag-ne'] = 0;
1340
+ }
1341
+
1342
+ if (!isset ( $get_flag_choices ['flag-no'] ) ) {
1343
+ $get_flag_choices['flag-no'] = 0;
1344
+ }
1345
+
1346
+ if (!isset ( $get_flag_choices ['flag-fa'] ) ) {
1347
+ $get_flag_choices['flag-fa'] = 0;
1348
+ }
1349
+
1350
+ if (!isset ( $get_flag_choices ['flag-pl'] ) ) {
1351
+ $get_flag_choices['flag-pl'] = 0;
1352
+ }
1353
+
1354
+ if (!isset ( $get_flag_choices ['flag-pt'] ) ) {
1355
+ $get_flag_choices['flag-pt'] = 0;
1356
+ }
1357
+
1358
+ if (!isset ( $get_flag_choices ['flag-pa'] ) ) {
1359
+ $get_flag_choices['flag-pa'] = 0;
1360
+ }
1361
+
1362
+ if (!isset ( $get_flag_choices ['flag-ro'] ) ) {
1363
+ $get_flag_choices['flag-ro'] = 0;
1364
+ }
1365
+
1366
+ if (!isset ( $get_flag_choices ['flag-ru'] ) ) {
1367
+ $get_flag_choices['flag-ru'] = 0;
1368
+ }
1369
+
1370
+ if (!isset ( $get_flag_choices ['flag-sr'] ) ) {
1371
+ $get_flag_choices['flag-sr'] = 0;
1372
+ }
1373
+
1374
+ if (!isset ( $get_flag_choices ['flag-sk'] ) ) {
1375
+ $get_flag_choices['flag-sk'] = 0;
1376
+ }
1377
+
1378
+ if (!isset ( $get_flag_choices ['flag-sl'] ) ) {
1379
+ $get_flag_choices['flag-sl'] = 0;
1380
+ }
1381
+
1382
+ if (!isset ( $get_flag_choices ['flag-so'] ) ) {
1383
+ $get_flag_choices['flag-so'] = 0;
1384
+ }
1385
+
1386
+ if (!isset ( $get_flag_choices ['flag-so'] ) ) {
1387
+ $get_flag_choices['flag-so'] = 0;
1388
+ }
1389
+
1390
+ if (!isset ( $get_flag_choices ['flag-es'] ) ) {
1391
+ $get_flag_choices['flag-es'] = 0;
1392
+ }
1393
+
1394
+ if (!isset ( $get_flag_choices ['flag-sw'] ) ) {
1395
+ $get_flag_choices['flag-sw'] = 0;
1396
+ }
1397
+
1398
+ if (!isset ( $get_flag_choices ['flag-sv'] ) ) {
1399
+ $get_flag_choices['flag-sv'] = 0;
1400
+ }
1401
+
1402
+ if (!isset ( $get_flag_choices ['flag-ta'] ) ) {
1403
+ $get_flag_choices['flag-ta'] = 0;
1404
+ }
1405
+
1406
+ if (!isset ( $get_flag_choices ['flag-te'] ) ) {
1407
+ $get_flag_choices['flag-te'] = 0;
1408
+ }
1409
+
1410
+ if (!isset ( $get_flag_choices ['flag-th'] ) ) {
1411
+ $get_flag_choices['flag-th'] = 0;
1412
+ }
1413
+
1414
+ if (!isset ( $get_flag_choices ['flag-tr'] ) ) {
1415
+ $get_flag_choices['flag-tr'] = 0;
1416
+ }
1417
+
1418
+ if (!isset ( $get_flag_choices ['flag-uk'] ) ) {
1419
+ $get_flag_choices['flag-uk'] = 0;
1420
+ }
1421
+
1422
+ if (!isset ( $get_flag_choices ['flag-ur'] ) ) {
1423
+ $get_flag_choices['flag-ur'] = 0;
1424
+ }
1425
+
1426
+ if (!isset ( $get_flag_choices ['flag-vi'] ) ) {
1427
+ $get_flag_choices['flag-vi'] = 0;
1428
+ }
1429
+
1430
+ if (!isset ( $get_flag_choices ['flag-cy'] ) ) {
1431
+ $get_flag_choices['flag-cy'] = 0;
1432
+ }
1433
+
1434
+ if (!isset ( $get_flag_choices ['flag-yi'] ) ) {
1435
+ $get_flag_choices['flag-yi'] = 0;
1436
+ }
1437
+
1438
+ if (!isset ( $get_flag_choices ['flag-yo'] ) ) {
1439
+ $get_flag_choices['flag-yo'] = 0;
1440
+ }
1441
+
1442
+ if (!isset ( $get_flag_choices ['flag-zu'] ) ) {
1443
+ $get_flag_choices['flag-zu'] = 0;
1444
+ }
1445
+
1446
+ ?>
1447
+ <div class="flagdisplay" style="width:25%; float:left">
1448
+ <div><input type="checkbox" name="flag_display_settings[flag-af]" value="1" <?php checked( 1,$get_flag_choices['flag-af']); ?>/> Afrikaans</div>
1449
+ <div><input type="checkbox" name="flag_display_settings[flag-sq]" value="1" <?php checked( 1,$get_flag_choices['flag-sq']); ?>/> Albanian</div>
1450
+ <div><input type="checkbox" name="flag_display_settings[flag-ar]" value="1" <?php checked( 1,$get_flag_choices['flag-ar']); ?>/> Arabic</div>
1451
+ <div><input type="checkbox" name="flag_display_settings[flag-hy]" value="1" <?php checked( 1,$get_flag_choices['flag-hy']); ?>/> Armenian</div>
1452
+ <div><input type="checkbox" name="flag_display_settings[flag-az]" value="1" <?php checked( 1,$get_flag_choices['flag-az']); ?>/> Azerbaijani</div>
1453
+ <div><input type="checkbox" name="flag_display_settings[flag-eu]" value="1" <?php checked( 1,$get_flag_choices['flag-eu']); ?>/> Basque</div>
1454
+ <div><input type="checkbox" name="flag_display_settings[flag-be]" value="1" <?php checked( 1,$get_flag_choices['flag-be']); ?>/> Belarusian</div>
1455
+ <div><input type="checkbox" name="flag_display_settings[flag-bn]" value="1" <?php checked( 1,$get_flag_choices['flag-bn']); ?>/> Bengali</div>
1456
+ <div><input type="checkbox" name="flag_display_settings[flag-bs]" value="1" <?php checked( 1,$get_flag_choices['flag-bs']); ?>/> Bosnian</div>
1457
+ <div><input type="checkbox" name="flag_display_settings[flag-bg]" value="1" <?php checked( 1,$get_flag_choices['flag-bg']); ?>/> Bulgarian</div>
1458
+ <div><input type="checkbox" name="flag_display_settings[flag-ca]" value="1" <?php checked( 1,$get_flag_choices['flag-ca']); ?>/> Catalan</div>
1459
+ <div><input type="checkbox" name="flag_display_settings[flag-ceb]" value="1" <?php checked( 1,$get_flag_choices['flag-ceb']); ?>/> Cebuano</div>
1460
+ <div><input type="checkbox" name="flag_display_settings[flag-zh-CN]" value="1" <?php checked( 1,$get_flag_choices['flag-zh-CN']); ?>/> Chinese</div>
1461
+ <div><input type="checkbox" name="flag_display_settings[flag-zh-TW]" value="1" <?php checked( 1,$get_flag_choices['flag-zh-TW']); ?>/> Chinese (Han)</div>
1462
+ <div><input type="checkbox" name="flag_display_settings[flag-hr]" value="1" <?php checked( 1,$get_flag_choices['flag-hr']); ?>/> Croatian</div>
1463
+ <div><input type="checkbox" name="flag_display_settings[flag-cs]" value="1" <?php checked( 1,$get_flag_choices['flag-cs']); ?>/> Czech</div>
1464
+ <div><input type="checkbox" name="flag_display_settings[flag-da]" value="1" <?php checked( 1,$get_flag_choices['flag-da']); ?>/> Danish</div>
1465
+ <div><input type="checkbox" name="flag_display_settings[flag-nl]" value="1" <?php checked( 1,$get_flag_choices['flag-nl']); ?>/> Dutch</div>
1466
+ <div><input type="checkbox" name="flag_display_settings[flag-en]" value="1" <?php checked(1,$get_flag_choices['flag-en']); ?>/> English</div>
1467
+ <div><input type="checkbox" name="flag_display_settings[flag-eo]" value="1" <?php checked( 1,$get_flag_choices['flag-eo']); ?>/> Esperanto</div>
1468
+ <div><input type="checkbox" name="flag_display_settings[flag-et]" value="1" <?php checked( 1,$get_flag_choices['flag-et']); ?>/> Estonian</div>
1469
+ </div>
1470
+
1471
+ <div class="flagdisplay" style="width:25%; float:left">
1472
+ <div><input type="checkbox" name="flag_display_settings[flag-tl]" value="1" <?php checked( 1,$get_flag_choices['flag-tl']); ?>/> Filipino</div>
1473
+ <div><input type="checkbox" name="flag_display_settings[flag-fi]" value="1" <?php checked( 1,$get_flag_choices['flag-fi']); ?>/> Finnish</div>
1474
+ <div><input type="checkbox" name="flag_display_settings[flag-fr]" value="1" <?php checked( 1,$get_flag_choices['flag-fr']); ?>/> French</div>
1475
+ <div><input type="checkbox" name="flag_display_settings[flag-gl]" value="1" <?php checked( 1,$get_flag_choices['flag-gl']); ?>/> Galician</div>
1476
+ <div><input type="checkbox" name="flag_display_settings[flag-ka]" value="1" <?php checked( 1,$get_flag_choices['flag-ka']); ?>/> Georgian</div>
1477
+ <div><input type="checkbox" name="flag_display_settings[flag-de]" value="1" <?php checked( 1,$get_flag_choices['flag-de']); ?>/> German</div>
1478
+ <div><input type="checkbox" name="flag_display_settings[flag-el]" value="1" <?php checked( 1,$get_flag_choices['flag-el']); ?>/> Greek</div>
1479
+ <div><input type="checkbox" name="flag_display_settings[flag-gu]" value="1" <?php checked( 1,$get_flag_choices['flag-gu']); ?>/> Gujarati</div>
1480
+ <div><input type="checkbox" name="flag_display_settings[flag-ht]" value="1" <?php checked( 1,$get_flag_choices['flag-ht']); ?>/> Haitian Creole</div>
1481
+ <div><input type="checkbox" name="flag_display_settings[flag-ha]" value="1" <?php checked( 1,$get_flag_choices['flag-ha']); ?>/> Hausa</div>
1482
+ <div><input type="checkbox" name="flag_display_settings[flag-iw]" value="1" <?php checked( 1,$get_flag_choices['flag-iw']); ?>/> Hebrew</div>
1483
+ <div><input type="checkbox" name="flag_display_settings[flag-hi]" value="1" <?php checked( 1,$get_flag_choices['flag-hi']); ?>/> Hindi</div>
1484
+ <div><input type="checkbox" name="flag_display_settings[flag-hmn]" value="1" <?php checked( 1,$get_flag_choices['flag-hmn']); ?>/> Hmong</div>
1485
+ <div><input type="checkbox" name="flag_display_settings[flag-hu]" value="1" <?php checked( 1,$get_flag_choices['flag-hu']); ?>/> Hungarian</div>
1486
+ <div><input type="checkbox" name="flag_display_settings[flag-is]" value="1" <?php checked( 1,$get_flag_choices['flag-is']); ?>/> Icelandic</div>
1487
+ <div><input type="checkbox" name="flag_display_settings[flag-ig]" value="1" <?php checked( 1,$get_flag_choices['flag-ig']); ?>/> Igbo</div>
1488
+ <div><input type="checkbox" name="flag_display_settings[flag-id]" value="1" <?php checked( 1,$get_flag_choices['flag-id']); ?>/> Indonesian</div>
1489
+ <div><input type="checkbox" name="flag_display_settings[flag-ga]" value="1" <?php checked( 1,$get_flag_choices['flag-ga']); ?>/> Irish</div>
1490
+ <div><input type="checkbox" name="flag_display_settings[flag-it]" value="1" <?php checked( 1,$get_flag_choices['flag-it']); ?>/> Italian</div>
1491
+ <div><input type="checkbox" name="flag_display_settings[flag-ja]" value="1" <?php checked( 1,$get_flag_choices['flag-ja']); ?>/> Japanese</div>
1492
+ <div><input type="checkbox" name="flag_display_settings[flag-jw]" value="1" <?php checked( 1,$get_flag_choices['flag-jw']); ?>/> Javanese</div>
1493
+ </div>
1494
+
1495
+ <div class="flagdisplay" style="width:25%; float:left">
1496
+ <div><input type="checkbox" name="flag_display_settings[flag-kn]" value="1" <?php checked( 1,$get_flag_choices['flag-kn']); ?>/> Kannada</div>
1497
+ <div><input type="checkbox" name="flag_display_settings[flag-km]" value="1" <?php checked( 1,$get_flag_choices['flag-km']); ?>/> Khmer</div>
1498
+ <div><input type="checkbox" name="flag_display_settings[flag-ko]" value="1" <?php checked( 1,$get_flag_choices['flag-ko']); ?>/> Korean</div>
1499
+ <div><input type="checkbox" name="flag_display_settings[flag-lo]" value="1" <?php checked( 1,$get_flag_choices['flag-lo']); ?>/> Lao</div>
1500
+ <div><input type="checkbox" name="flag_display_settings[flag-la]" value="1" <?php checked( 1,$get_flag_choices['flag-la']); ?>/> Latin</div>
1501
+ <div><input type="checkbox" name="flag_display_settings[flag-lv]" value="1" <?php checked( 1,$get_flag_choices['flag-lv']); ?>/> Latvian</div>
1502
+ <div><input type="checkbox" name="flag_display_settings[flag-lt]" value="1" <?php checked( 1,$get_flag_choices['flag-lt']); ?>/> Lithuanian</div>
1503
+ <div><input type="checkbox" name="flag_display_settings[flag-mk]" value="1" <?php checked( 1,$get_flag_choices['flag-mk']); ?>/> Macedonian</div>
1504
+ <div><input type="checkbox" name="flag_display_settings[flag-ms]" value="1" <?php checked( 1,$get_flag_choices['flag-ms']); ?>/> Malay</div>
1505
+ <div><input type="checkbox" name="flag_display_settings[flag-mt]" value="1" <?php checked( 1,$get_flag_choices['flag-mt']); ?>/> Maltese</div>
1506
+ <div><input type="checkbox" name="flag_display_settings[flag-mi]" value="1" <?php checked( 1,$get_flag_choices['flag-mi']); ?>/> Maori</div>
1507
+ <div><input type="checkbox" name="flag_display_settings[flag-mr]" value="1" <?php checked( 1,$get_flag_choices['flag-mr']); ?>/> Marathi</div>
1508
+ <div><input type="checkbox" name="flag_display_settings[flag-mn]" value="1" <?php checked( 1,$get_flag_choices['flag-mn']); ?>/> Mongolian</div>
1509
+ <div><input type="checkbox" name="flag_display_settings[flag-ne]" value="1" <?php checked( 1,$get_flag_choices['flag-ne']); ?>/> Nepali</div>
1510
+ <div><input type="checkbox" name="flag_display_settings[flag-no]" value="1" <?php checked( 1,$get_flag_choices['flag-no']); ?>/> Norwegian</div>
1511
+ <div><input type="checkbox" name="flag_display_settings[flag-fa]" value="1" <?php checked( 1,$get_flag_choices['flag-fa']); ?>/> Persian</div>
1512
+ <div><input type="checkbox" name="flag_display_settings[flag-pl]" value="1" <?php checked( 1,$get_flag_choices['flag-pl']); ?>/> Polish</div>
1513
+ <div><input type="checkbox" name="flag_display_settings[flag-pt]" value="1" <?php checked( 1,$get_flag_choices['flag-pt']); ?>/> Portuguese</div>
1514
+ <div><input type="checkbox" name="flag_display_settings[flag-pa]" value="1" <?php checked( 1,$get_flag_choices['flag-pa']); ?>/> Punjabi</div>
1515
+ <div><input type="checkbox" name="flag_display_settings[flag-ro]" value="1" <?php checked( 1,$get_flag_choices['flag-ro']); ?>/> Romanian</div>
1516
+ <div><input type="checkbox" name="flag_display_settings[flag-ru]" value="1" <?php checked( 1,$get_flag_choices['flag-ru']); ?>/> Russian</div>
1517
+ </div>
1518
+
1519
+ <div class="flagdisplay" style="width:25%; float:left">
1520
+ <div><input type="checkbox" name="flag_display_settings[flag-sr]" value="1" <?php checked( 1,$get_flag_choices['flag-sr']); ?>/> Serbian</div>
1521
+ <div><input type="checkbox" name="flag_display_settings[flag-sk]" value="1" <?php checked( 1,$get_flag_choices['flag-sk']); ?>/> Slovak</div>
1522
+ <div><input type="checkbox" name="flag_display_settings[flag-sl]" value="1" <?php checked( 1,$get_flag_choices['flag-sl']); ?>/> Slovenian</div>
1523
+ <div><input type="checkbox" name="flag_display_settings[flag-so]" value="1" <?php checked( 1,$get_flag_choices['flag-so']); ?>/> Somali</div>
1524
+ <div><input type="checkbox" name="flag_display_settings[flag-es]" value="1" <?php checked( 1,$get_flag_choices['flag-es']); ?>/> Spanish</div>
1525
+ <div><input type="checkbox" name="flag_display_settings[flag-sw]" value="1" <?php checked( 1,$get_flag_choices['flag-sw']); ?>/> Swahili</div>
1526
+ <div><input type="checkbox" name="flag_display_settings[flag-sv]" value="1" <?php checked( 1,$get_flag_choices['flag-sv']); ?>/> Swedish</div>
1527
+ <div><input type="checkbox" name="flag_display_settings[flag-ta]" value="1" <?php checked( 1,$get_flag_choices['flag-ta']); ?>/> Tamil</div>
1528
+ <div><input type="checkbox" name="flag_display_settings[flag-te]" value="1" <?php checked( 1,$get_flag_choices['flag-te']); ?>/> Telugu</div>
1529
+ <div><input type="checkbox" name="flag_display_settings[flag-th]" value="1" <?php checked( 1,$get_flag_choices['flag-th']); ?>/> Thai</div>
1530
+ <div><input type="checkbox" name="flag_display_settings[flag-tr]" value="1" <?php checked( 1,$get_flag_choices['flag-tr']); ?>/> Turkish</div>
1531
+ <div><input type="checkbox" name="flag_display_settings[flag-uk]" value="1" <?php checked( 1,$get_flag_choices['flag-uk']); ?>/> Ukranian</div>
1532
+ <div><input type="checkbox" name="flag_display_settings[flag-ur]" value="1" <?php checked( 1,$get_flag_choices['flag-ur']); ?>/> Urdu</div>
1533
+ <div><input type="checkbox" name="flag_display_settings[flag-vi]" value="1" <?php checked( 1,$get_flag_choices['flag-vi']); ?>/> Vietnamese</div>
1534
+ <div><input type="checkbox" name="flag_display_settings[flag-cy]" value="1" <?php checked( 1,$get_flag_choices['flag-cy']); ?>/> Welsh</div>
1535
+ <div><input type="checkbox" name="flag_display_settings[flag-yi]" value="1" <?php checked( 1,$get_flag_choices['flag-yi']); ?>/> Yiddish</div>
1536
+ <div><input type="checkbox" name="flag_display_settings[flag-yo]" value="1" <?php checked( 1,$get_flag_choices['flag-yo']); ?>/> Yoruba</div>
1537
+ <div><input type="checkbox" name="flag_display_settings[flag-zu]" value="1" <?php checked( 1,$get_flag_choices['flag-zu']); ?>/> Zulu</div>
1538
+
1539
+ </div>
1540
+ <div style="clear:both"></div>
1541
+ <?php }
1542
+
1543
+ public function googlelanguagetranslator_floating_widget_cb() {
1544
+
1545
+ $option_name = 'googlelanguagetranslator_floating_widget' ;
1546
+ $new_value = 'yes';
1547
+
1548
+ if ( get_option( $option_name ) === false ) {
1549
+
1550
+ // The option does not exist, so we update it.
1551
+ update_option( $option_name, $new_value );
1552
+ }
1553
+
1554
+ $options = get_option (''.$option_name.''); ?>
1555
+
1556
+ <select name="googlelanguagetranslator_floating_widget" id="googlelanguagetranslator_floating_widget" style="width:170px">
1557
+ <option value="yes" <?php if($options=='yes'){echo "selected";}?>>Yes, show widget</option>
1558
+ <option value="no" <?php if($options=='no'){echo "selected";}?>>No, hide widget</option>
1559
+ </select>
1560
+ <?php }
1561
+
1562
+ public function googlelanguagetranslator_translatebox_cb() {
1563
+
1564
+ $option_name = 'googlelanguagetranslator_translatebox' ;
1565
+ $new_value = 'yes';
1566
+
1567
+ if ( get_option( $option_name ) === false ) {
1568
+
1569
+ // The option does not exist, so we update it.
1570
+ update_option( $option_name, $new_value );
1571
+ }
1572
+
1573
+ $options = get_option (''.$option_name.''); ?>
1574
+
1575
+ <select name="googlelanguagetranslator_translatebox" id="googlelanguagetranslator_translatebox" style="width:190px">
1576
+ <option value="yes" <?php if($options=='yes'){echo "selected";}?>>Yes, show language box</option>
1577
+ <option value="no" <?php if($options=='no'){echo "selected";}?>>No, hide language box</option>
1578
+ </select>
1579
+ <?php }
1580
+
1581
+ public function googlelanguagetranslator_display_cb() {
1582
+
1583
+ $option_name = 'googlelanguagetranslator_display' ;
1584
+ $new_value = 'Vertical';
1585
+
1586
+ if ( get_option( $option_name ) === false ) {
1587
+
1588
+ // The option does not exist, so we update it.
1589
+ update_option( $option_name, $new_value );
1590
+ }
1591
+
1592
+ $options = get_option (''.$option_name.''); ?>
1593
+
1594
+ <select name="googlelanguagetranslator_display" id="googlelanguagetranslator_display" style="width:170px;">
1595
+ <option value="Vertical" <?php if(get_option('googlelanguagetranslator_display')=='Vertical'){echo "selected";}?>>Vertical</option>
1596
+ <option value="Horizontal" <?php if(get_option('googlelanguagetranslator_display')=='Horizontal'){echo "selected";}?>>Horizontal</option>
1597
+ </select>
1598
+ <?php }
1599
+
1600
+ public function googlelanguagetranslator_toolbar_cb() {
1601
+
1602
+ $option_name = 'googlelanguagetranslator_toolbar' ;
1603
+ $new_value = 'Yes';
1604
+
1605
+ if ( get_option( $option_name ) === false ) {
1606
+
1607
+ // The option does not exist, so we update it.
1608
+ update_option( $option_name, $new_value );
1609
+ }
1610
+
1611
+ $options = get_option (''.$option_name.''); ?>
1612
+
1613
+ <select name="googlelanguagetranslator_toolbar" id="googlelanguagetranslator_toolbar" style="width:170px;">
1614
+ <option value="Yes" <?php if(get_option('googlelanguagetranslator_toolbar')=='Yes'){echo "selected";}?>>Yes</option>
1615
+ <option value="No" <?php if(get_option('googlelanguagetranslator_toolbar')=='No'){echo "selected";}?>>No</option>
1616
+ </select>
1617
+ <?php }
1618
+
1619
+ public function googlelanguagetranslator_showbranding_cb() {
1620
+
1621
+ $option_name = 'googlelanguagetranslator_showbranding' ;
1622
+ $new_value = 'Yes';
1623
+
1624
+ if ( get_option( $option_name ) === false ) {
1625
+
1626
+ // The option does not exist, so we update it.
1627
+ update_option( $option_name, $new_value );
1628
+ }
1629
+
1630
+ $options = get_option (''.$option_name.''); ?>
1631
+
1632
+ <select name="googlelanguagetranslator_showbranding" id="googlelanguagetranslator_showbranding" style="width:170px;">
1633
+ <option value="Yes" <?php if(get_option('googlelanguagetranslator_showbranding')=='Yes'){echo "selected";}?>>Yes</option>
1634
+ <option value="No" <?php if(get_option('googlelanguagetranslator_showbranding')=='No'){echo "selected";}?>>No</option>
1635
+ </select>
1636
+ <?php }
1637
+
1638
+ public function googlelanguagetranslator_flags_alignment_cb() {
1639
+
1640
+ $option_name = 'googlelanguagetranslator_flags_alignment' ;
1641
+ $new_value = 'flags_left';
1642
+
1643
+ if ( get_option( $option_name ) === false ) {
1644
+
1645
+ // The option does not exist, so we update it.
1646
+ update_option( $option_name, 'flags_left' );
1647
+ }
1648
+
1649
+ $options = get_option (''.$option_name.''); ?>
1650
+
1651
+ <input type="radio" name="googlelanguagetranslator_flags_alignment" id="flags_left" value="flags_left" <?php if($options=='flags_left'){echo "checked";}?>/> Align Left<br/>
1652
+ <input type="radio" name="googlelanguagetranslator_flags_alignment" id="flags_right" value="flags_right" <?php if($options=='flags_right'){echo "checked";}?>/> Align Right
1653
+ <?php }
1654
+
1655
+ public function googlelanguagetranslator_analytics_cb() {
1656
+
1657
+ $option_name = 'googlelanguagetranslator_analytics' ;
1658
+ $new_value = 0;
1659
+
1660
+ if ( get_option( $option_name ) === false ) {
1661
+
1662
+ // The option does not exist, so we update it.
1663
+ update_option( $option_name, $new_value );
1664
+ }
1665
+
1666
+ $options = get_option (''.$option_name.'');
1667
+
1668
+ $html = '<input type="checkbox" name="googlelanguagetranslator_analytics" id="googlelanguagetranslator_analytics" value="1" '.checked(1,$options,false).'/> &nbsp; Activate Google Analytics tracking?';
1669
+ echo $html;
1670
+ }
1671
+
1672
+ public function googlelanguagetranslator_analytics_id_cb() {
1673
+
1674
+ $option_name = 'googlelanguagetranslator_analytics_id' ;
1675
+ $new_value = '';
1676
+
1677
+ if ( get_option( $option_name ) === false ) {
1678
+
1679
+ // The option does not exist, so we update it.
1680
+ update_option( $option_name, $new_value );
1681
+ }
1682
+
1683
+ $options = get_option (''.$option_name.'');
1684
+
1685
+ $html = '<input type="text" name="googlelanguagetranslator_analytics_id" id="googlelanguagetranslator_analytics_id" value="'.$options.'" />';
1686
+ echo $html;
1687
+ }
1688
+
1689
+ public function googlelanguagetranslator_flag_size_cb() {
1690
+
1691
+ $option_name = 'googlelanguagetranslator_flag_size' ;
1692
+ $new_value = '16px';
1693
+
1694
+ if ( get_option( $option_name ) === false ) {
1695
+
1696
+ // The option does not exist, so we update it.
1697
+ update_option( $option_name, $new_value );
1698
+ }
1699
+
1700
+ $options = get_option (''.$option_name.''); ?>
1701
+
1702
+ <select name="googlelanguagetranslator_flag_size" id="googlelanguagetranslator_flag_size" style="width:110px;">
1703
+ <option value="16px" <?php if($options=='16px'){echo "selected";}?>>16px</option>
1704
+ <option value="18px" <?php if($options=='18px'){echo "selected";}?>>18px</option>
1705
+ <option value="20px" <?php if($options=='20px'){echo "selected";}?>>20px</option>
1706
+ <option value="22px" <?php if($options=='22px'){echo "selected";}?>>22px</option>
1707
+ <option value="24px" <?php if($options=='24px'){echo "selected";}?>>24px</option>
1708
+ </select>
1709
+ <?php }
1710
+
1711
+ public function googlelanguagetranslator_flags_order_cb() {
1712
+ $option_name = 'googlelanguagetranslator_flags_order';
1713
+ $new_value = '';
1714
+
1715
+ if ( get_option ( $option_name ) === false ) {
1716
+
1717
+ // The option does not exist, so we update it.
1718
+ update_option( $option_name, $new_value );
1719
+ }
1720
+
1721
+ $options = get_option ( ''.$option_name.'' ); ?>
1722
+
1723
+ <input type="hidden" id="order" name="googlelanguagetranslator_flags_order" value="<?php print_r(get_option('googlelanguagetranslator_flags_order')); ?>" />
1724
+ <?php
1725
+ }
1726
+
1727
+ public function googlelanguagetranslator_css_cb() {
1728
+
1729
+ $option_name = 'googlelanguagetranslator_css' ;
1730
+ $new_value = '';
1731
+
1732
+ if ( get_option( $option_name ) === false ) {
1733
+
1734
+ // The option does not exist, so we update it.
1735
+ update_option( $option_name, $new_value );
1736
+ }
1737
+
1738
+ $options = get_option (''.$option_name.'');
1739
+
1740
+ $html = '<textarea style="width:100%; height:200px" name="googlelanguagetranslator_css" id="googlelanguagetranslator_css">'.$options.'</textarea>';
1741
+ echo $html;
1742
+ }
1743
+
1744
+ public function googlelanguagetranslator_manage_translations_cb() {
1745
+ $option_name = 'googlelanguagetranslator_manage_translations' ;
1746
+ $new_value = 0;
1747
+
1748
+ if ( get_option( $option_name ) === false ) {
1749
+
1750
+ // The option does not exist, so we update it.
1751
+ update_option( $option_name, $new_value );
1752
+ }
1753
+
1754
+ $options = get_option (''.$option_name.'');
1755
+
1756
+ $html = '<input type="checkbox" name="googlelanguagetranslator_manage_translations" id="googlelanguagetranslator_manage_translations" value="1" '.checked(1,$options,false).'/> &nbsp; Turn on translation management?';
1757
+ echo $html;
1758
+ }
1759
+
1760
+ public function googlelanguagetranslator_multilanguage_cb() {
1761
+
1762
+ $option_name = 'googlelanguagetranslator_multilanguage' ;
1763
+ $new_value = 0;
1764
+
1765
+ if ( get_option( $option_name ) === false ) {
1766
+
1767
+ // The option does not exist, so we update it.
1768
+ update_option( $option_name, $new_value );
1769
+ }
1770
+
1771
+ $options = get_option (''.$option_name.'');
1772
+
1773
+ $html = '<input type="checkbox" name="googlelanguagetranslator_multilanguage" id="googlelanguagetranslator_multilanguage" value="1" '.checked(1,$options,false).'/> &nbsp; Turn on multilanguage mode?';
1774
+ echo $html;
1775
+ }
1776
+
1777
+ public function page_layout_cb() { ?>
1778
+ <div class="wrap">
1779
+ <div id="icon-options-general" class="icon32"></div>
1780
+ <h2><span class="notranslate">Google Language Translator</span></h2>
1781
+ <form action="<?php echo admin_url('options.php'); ?>" method="post">
1782
+ <div class="metabox-holder has-right-sidebar" style="float:left; width:65%">
1783
+ <div class="postbox" style="width: 100%">
1784
+ <h3 class="notranslate">Settings</h3>
1785
+
1786
+ <?php settings_fields('google_language_translator'); ?>
1787
+ <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1788
+ <tr>
1789
+ <td style="width:60%" class="notranslate">Plugin Status:</td>
1790
+ <td class="notranslate"><?php $this->googlelanguagetranslator_active_cb(); ?></td>
1791
+ </tr>
1792
+
1793
+ <tr class="notranslate">
1794
+ <td>Choose the original language of your website</td>
1795
+ <td><?php $this->googlelanguagetranslator_language_cb(); ?></td>
1796
+ </tr>
1797
+
1798
+ <tr class="notranslate">
1799
+ <td>What translation languages will display in the language box?<br/>("All Languages" option <strong><u>must</u></strong> be chosen to show flags.)</td>
1800
+ <td><?php $this->googlelanguagetranslator_language_option_cb(); ?></td>
1801
+ </tr>
1802
+
1803
+ <tr class="notranslate">
1804
+ <td colspan="2"><?php $this->language_display_settings_cb(); ?></td>
1805
+ </tr>
1806
+
1807
+ <tr class="notranslate">
1808
+ <td class="choose_flags_intro">Show flag images?<br/>(Display up to 81 flags above the translator)</td>
1809
+ <td class="choose_flags_intro"><?php $this->googlelanguagetranslator_flags_cb(); ?></td>
1810
+ </tr>
1811
+
1812
+ <tr class="notranslate">
1813
+ <td class="choose_flags">Choose the flags you want to display:</td>
1814
+ <td></td>
1815
+ </tr>
1816
+
1817
+ <tr class="notranslate">
1818
+ <td colspan="2" class="choose_flags"><?php $this->flag_display_settings_cb(); ?></td>
1819
+ </tr>
1820
+
1821
+ <tr class="notranslate">
1822
+ <td>Show floating translation widget? <strong style="color:red">(New!)</strong><br/>
1823
+ <span>("All Languages" option <strong><u>must</u></strong> be chosen to show widget.)</span>
1824
+ </td>
1825
+ <td><?php $this->googlelanguagetranslator_floating_widget_cb(); ?></td>
1826
+ </tr>
1827
+
1828
+ <tr class="notranslate">
1829
+ <td>Show translate box?</td>
1830
+ <td><?php $this->googlelanguagetranslator_translatebox_cb(); ?></td>
1831
+ </tr>
1832
+
1833
+ <tr class="notranslate">
1834
+ <td>Layout options:</td>
1835
+ <td><?php $this->googlelanguagetranslator_display_cb(); ?></td>
1836
+ </tr>
1837
+
1838
+ <tr class="notranslate">
1839
+ <td>Show Google Toolbar?</td>
1840
+ <td><?php $this->googlelanguagetranslator_toolbar_cb(); ?></td>
1841
+ </tr>
1842
+
1843
+ <tr class="notranslate">
1844
+ <td>Show Google Branding?<br/>
1845
+ <span>(<a href="https://developers.google.com/translate/v2/attribution" target="_blank">Learn more</a> about Google's Attribution Requirements.)</span>
1846
+ </td>
1847
+ <td><?php $this->googlelanguagetranslator_showbranding_cb(); ?></td>
1848
+ </tr>
1849
+
1850
+ <tr class="alignment notranslate">
1851
+ <td class="flagdisplay">Align the translator left or right?</td>
1852
+ <td class="flagdisplay"><?php $this->googlelanguagetranslator_flags_alignment_cb(); ?></td>
1853
+ </tr>
1854
+
1855
+ <tr class="manage_translations notranslate">
1856
+ <td>Turn on translation management?<br/>(Managed directly through your Google account. Requires <a href="http://translate.google.com/manager/website/settings" target="_blank">Google Translate</a> meta tag installed in header.)</td>
1857
+ <td><?php $this->googlelanguagetranslator_manage_translations_cb(); ?></td>
1858
+ </tr>
1859
+
1860
+ <tr class="multilanguage notranslate">
1861
+ <td>Multilanguage Page Option?: (<em>not recommended)</em><br/>(If checked, a "forced" translation of your webpage will be served when returned to the default language, instead of delivering original content.)</td>
1862
+ <td><?php $this->googlelanguagetranslator_multilanguage_cb(); ?></td>
1863
+ </tr>
1864
+
1865
+ <tr class="notranslate">
1866
+ <td>Google Analytics:</td>
1867
+ <td><?php $this->googlelanguagetranslator_analytics_cb(); ?></td>
1868
+ </tr>
1869
+
1870
+ <tr class="analytics notranslate">
1871
+ <td>Google Analytics ID (Ex. 'UA-11117410-2')</td>
1872
+ <td><?php $this->googlelanguagetranslator_analytics_id_cb(); ?></td>
1873
+ </tr>
1874
+
1875
+ <tr class="notranslate">
1876
+ <td>Copy/Paste this shortcode if adding to pages/posts:</td>
1877
+ <td><code>[google-translator]</code></td>
1878
+ </tr>
1879
+ </table>
1880
+
1881
+ <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1882
+ <tr class="notranslate">
1883
+ <td style="width:40%">For usage in header/footer:</td>
1884
+ <td style="width:60%"><code>&lt;?php echo do_shortcode('[google-translator]'); ?&gt;</code></td>
1885
+ </tr>
1886
+
1887
+ <tr class="notranslate">
1888
+ <td><?php submit_button(); ?></td>
1889
+ <td></td>
1890
+ </tr>
1891
+ </table>
1892
+
1893
+ </div> <!-- .postbox -->
1894
+ </div> <!-- .metbox-holder -->
1895
+
1896
+ <div class="metabox-holder" style="float:right; clear:right; width:33%">
1897
+ <div class="postbox">
1898
+ <h3 class="notranslate">Preview</h3>
1899
+ <table style="width:100%">
1900
+ <tr>
1901
+ <td style="box-sizing:border-box; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; padding:15px 15px; margin:0px"><span style="color:red; font-weight:bold" class="notranslate">(New!)</span><span class="notranslate"> Drag &amp; drop flags to change their position.</span><br/><br/><?php echo do_shortcode('[google-translator]'); ?><p class="hello"><span class="notranslate">Translated text:</span> &nbsp; <span>Hello</span></p></td>
1902
+ </tr>
1903
+
1904
+ <tr>
1905
+ <td><?php if (isset ($_POST['googlelanguagetranslator_flags_order']) ) { echo $_POST['googlelanguagetranslator_flags_order']; } ?></td>
1906
+ </tr>
1907
+
1908
+
1909
+ </table>
1910
+ </div> <!-- .postbox -->
1911
+ </div> <!-- .metabox-holder -->
1912
+
1913
+ <div id="glt_advanced_settings" class="metabox-holder notranslate" style="float: right; width: 33%;">
1914
+ <div class="postbox">
1915
+ <h3>Advanced Settings</h3>
1916
+ <div class="inside">
1917
+ <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
1918
+ <tr class="notranslate">
1919
+ <td class="advanced">Select flag size:</td>
1920
+ <td class="advanced"><?php $this->googlelanguagetranslator_flag_size_cb(); ?></td>
1921
+ </tr>
1922
+ </table>
1923
+ </div>
1924
+ </div>
1925
+ </div>
1926
+
1927
+
1928
+ <div class="metabox-holder notranslate" style="float: right; width: 33%;">
1929
+ <div class="postbox">
1930
+ <h3>Add CSS Styles</h3>
1931
+ <div class="inside">
1932
+ <p>You can apply any necessary CSS styles below:</p>
1933
+ <?php $this->googlelanguagetranslator_css_cb(); ?>
1934
+ </div>
1935
+ </div>
1936
+ </div>
1937
+ <?php $this->googlelanguagetranslator_flags_order_cb(); ?>
1938
+ </form>
1939
+
1940
+ <div class="metabox-holder notranslate" style="float: right; width: 33%;">
1941
+ <div class="postbox">
1942
+ <h3>GLT Premium 3.0.6 is Here! $15</h3>
1943
+ <div class="inside"><a href="http://www.wp-studio.net/" target="_blank"><img style="background:#444; border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px" src="<?php echo plugins_url('google-language-translator/images/logo.png'); ?>"></a><br />
1944
+ <ul id="features">
1945
+ <li>81 Languages</li>
1946
+ <li>"Elegant" language switcher theme</li>
1947
+ <li>Loads inline with page content</li>
1948
+ <li>Custom flag choices for English, Spanish and Portuguese</li>
1949
+ <li>User-friendly URLs, reloads with <code>lang</code> attribute</li>
1950
+ <li>Drag/drop flags to re-arrange their order</li>
1951
+ <li>Full access to our support forum</li>
1952
+ <li>Full access to all future updates</li>
1953
+ </ul>
1954
+ </div>
1955
+ </div>
1956
+ </div>
1957
+
1958
+ <div class="metabox-holder notranslate" style="float: right; width: 33%;">
1959
+ <div class="postbox">
1960
+ <h3>Please Consider A Donation</h3>
1961
+ <div class="inside">If you like this plugin and find it useful, help keep this plugin actively developed by clicking the donate button <br /><br />
1962
+ <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
1963
+ <input type="hidden" name="cmd" value="_donations">
1964
+ <input type="hidden" name="business" value="robertmyrick@hotmail.com">
1965
+ <input type="hidden" name="lc" value="US">
1966
+ <input type="hidden" name="item_name" value="Support Studio 88 Design and help us bring you more Wordpress goodies! Any donation is kindly appreciated. Thank you!">
1967
+ <input type="hidden" name="no_note" value="0">
1968
+ <input type="hidden" name="currency_code" value="USD">
1969
+ <input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG.gif:NonHostedGuest">
1970
+ <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
1971
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
1972
+ </form>
1973
+ <br />
1974
+ <br />
1975
+ </div>
1976
+ </div>
1977
+ </div>
1978
+ </div> <!-- .wrap -->
1979
+ <?php
1980
+ }
1981
+ }
1982
+
1983
  $google_language_translator = new google_language_translator();
readme.txt CHANGED
@@ -1,195 +1,200 @@
1
- === Google Language Translator ===
2
- Contributors: Rob Myrick
3
- Donate link: http://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=47LFA33AC89S6
4
- Plugin link: http://www.studio88design.com/plugins/google-language-translator
5
- Tags: language translator, google translator, language translate, google, google language translator, translation, translate, multi language
6
- Requires at least: 2.9
7
- Tested up to: 3.9.1
8
- stable tag: 4.0
9
-
10
- Welcome to Google Language Translator! This plugin allows you to insert the Google Language Translator tool anywhere on your website using shortcode.
11
-
12
- == Description ==
13
-
14
- Settings include: inline or vertical layout, show/hide specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
15
-
16
- == Installation ==
17
-
18
- 1. Download the zip folder named google-language-translator.zip
19
- 2. Unzip the folder and put it in the plugins directory of your wordpress installation. (wp-content/plugins).
20
- 3. Activate the plugin through the plugin window in the admin panel.
21
- 4. Go to Settings > Google Language Translator, enable the plugin, and then choose your settings.
22
- 5. Copy the shortcode and paste it into a page, post or widget.
23
- 6. Do not use the shortcode twice on a single page - it will not work.
24
-
25
-
26
- == Frequently Asked Questions ==
27
-
28
- == Changelog ==
29
-
30
- 4.0
31
-
32
- - Added 2 new features: 1) Drag/drop flags to re-arrange their order, and 2) Custom flag sizes (16px to 24px).
33
- - Re-factored code in google-language-translator.php. Languages are now loaded dynamically and are not hard-coded.
34
- - GLT Premium is now released: Updates include multiple flags for English, Spanish, and Portuguese languages; customized URLs with 'lang' attribute; drag/drop flags to re-arrnage their order
35
-
36
- 3.0.9
37
-
38
- - Added a title field to the Google Language Translator widget.
39
- - Removed "unexpected text characters" error upon activation (due to error in activation hook).
40
-
41
- 3.0.8
42
-
43
- - Added 9 new languages into the plugin (Hausa, Igbo, Maori, Mongolian, Nepali, Punjabi, Somali, Yoruba, Zulu).
44
- - Corrected an "undefined variable" error that was being generated in Vertical and Horizontal layouts.
45
- - Re-structured coding once again into an Object-Oriented approach.
46
- - Moved all functions of the base class into 'googlelanguagetranslator.php' and the widget into 'widget.php'.
47
- - Moved all javascript files into it's own JS folder.
48
- - Fixed an display issue with "Edit Translations" - they were being hidden when "No branding" option was chosen.
49
- - Corrected various "comma" errors in the string that outputs the script for loading the translator.
50
- - Changed Changelog in readme.txt to show most recent changes first, instead of last.
51
-
52
- 3.0.7
53
-
54
- - Removed an unnecessary CSS file, left over from development. Sorry for any inconvenience if you received display errors.
55
-
56
- 3.0.6
57
-
58
- - Corrected a small display error in displaying the floating widget correctly.
59
-
60
- 3.0.5
61
-
62
- - Added new Floating Widget (see settings page). The Floating Widget is simply another way for allowing website visitors to translate languages. The functionality is built-in with the existing flag preferences, and can be turned on or off at the administrator's preference. The floating widget can also function in full with both the language box and/or flags showing OR hiding, so the administrator has full control of how it displays. The floating widget is placed at bottom right of the website in the free version, but can be placed in other locations by changing CSS styles associated with the box. The premium version will allow more options as to changing the Floating Widget location.
63
- - Fixed the issue with Dashboard styles loading on the wrong pages. This was causing some annoying display issues on the Wordpress Dashboard.
64
-
65
- 3.0.4
66
-
67
- - Re-factored/re-arranged more code in google languagetransltor.php by placing them into separate files.
68
- - Fixed the issue of Custom CSS box not displaying it's styles to the website. This was only missed in this last update, due to re-arrangement of the files. Sorry for any inconvenience.
69
- - Removed style2.php file, which is unnecessary and was being used in testing.
70
-
71
- 3.0.3
72
-
73
- - Re-factored/re-arranged some of the code in googlelanguagetranslator.php by placing them into separate files.
74
- - Fixed a minor coding issue in glt_widget.php - this was generating an error in Wordpress when debugging.
75
- - Moved all CSS code into a single file. The result is nice, clean inline CSS code that is now called only once.
76
- - Fixed some additional CSS display issues.
77
-
78
- 3.0.2
79
-
80
- - Adjusted additional minor invalid HTML issues on the settings page, and also in the front-end plugin display.
81
-
82
- 3.0.1
83
-
84
- - Changed the url request to Google to allow both unsecured and secured page translations. Previously, some users experienced errors when trying to use the translator on "https://" (secured) pages.
85
- - Adjusted some minor spacing issues in the settings page HTML (caused some annoying red HTML errors when using "View Source" in right-click menu).
86
- - Removed old CSS styles that were added in the previous 3.0 update - the styles were added when Google servers were being updated, and were producing major translation dislay issues until their update was complete. Now the styles I added are no longer needed.
87
-
88
- 3.0
89
-
90
- - Correct a small CSS error that affected the showing/hiding of the Google toolbar.
91
-
92
- 2.9
93
-
94
- ***IMPORTANT: Google's most recent server update is producing display issues for website translation tool. There are major display issues with the translation toolbar and also the translations editing interface. Version 2.9 temporarily hides the edit translation functionality until Google decides to fix this issue, although you can still edit translations directly through your Google account at translate.google.com. Please direct any support requests through Wordpress.org and we will be happy to assist you.
95
-
96
- - Fixed Google Translation toolbar display issue
97
- - Fixed the Edit Translation interface by hiding it temporarily until Google fixes this
98
- - Removed some unneeded styles from the style sheet.
99
- - Fixed some CSS issues for the Google Branding display, which was affected by Google's most recent update
100
-
101
- 2.8
102
-
103
- - Added an option to allow users to manage their own translations directly through their Google Translate account (free). When activated, users can hover over the text of their website, and edit the translations from the webpage directly. Google will remember these translations, and then serve them to users once the edits are made. Users must install the Google Translate Customization meta tag provided through Google Translate here: translate.google.com/manager/website/settings. To obtain this meta tag, users need to configure the Google Translate tool directly from this website (although they will not use this because the plugin provides it), then the user can obtain the meta tag on the "Get Code" screen, which is displayed after configuring the Google Translate tool on this webpage.
104
- - Added an option to allow users to turn on/off Google's multilanguagePage option, that when activated, the original website content will be a forced translation, instead of original content (but only after a translation is made.)
105
- - Added more flexible styles to the settings page, so that left and right panels display nicely to the user.
106
-
107
- 2.7
108
-
109
- - Added Google Analytics tracking capability to the plugin.
110
-
111
- - Added a "CSS Styles" box in the settings panel.
112
-
113
- - Changed the Catalonian flag to its correct flag image.
114
-
115
- - Fixed coding issues that previously updated options incorrectly, which is why many users experienced display issues. All options are now initialized upon plugin activation, which should fix this issue permanently.
116
-
117
- - Fixed a glitch in our usage of the translate API. Previously, when the user clicked the default language, it would toggle back and forth between the default language and "Afrikaans" language. Now, users will see the correct language displayed at all times, no matter how many times it is clicked.
118
-
119
- 2.6
120
-
121
- - Added defaults to all options to ensure there are no more issues with the translator displaying upon installation. Again, sorry for any inconvenience.
122
-
123
- 2.5
124
-
125
- - Eliminated an internal Wordpress error being generated from a coding mistake.
126
-
127
- - Added a default option for the Translator alingment. Previously, this was causing the plugin to disapppear.
128
-
129
- 2.4
130
-
131
- - Found a couple of small display errors in the settings page after uploading version 2.3. Sorry for any inconvenience!
132
-
133
- 2.3
134
-
135
- - Added a "Preview" area on the settings page that allows you to see your settings in action.
136
-
137
- - Added custom flag support for all languages (custom flags available ONLY when selecting the "ALL Languages" setting.
138
-
139
- - Added an option that allows left/right alignment of the translation tool.
140
-
141
- - Added the "Google Language Translator" widget.
142
-
143
- - Updated googlelanguagetranslator.php to properly register setting in the admin settings panel.
144
-
145
- 2.2
146
-
147
- - Added language "Portuguese" and "German" to the Original Language drop-down option on the settings page.
148
-
149
- - Changed flag image for the English language (changed United States flag to the United Kingdom flag).
150
-
151
- - Added link in the settings panel that points to Google's Attribution Policy.
152
-
153
- 2.1
154
-
155
- - Added language "Dutch" to the Original Language drop-down option on the settings page.
156
-
157
- - Added a new CSS class that more accurately hides the "Powered by" text when hiding Google's branding. In previous version, the "Powered by" text was actually disguised by setting it's color to "transparent", but now we have set it's font-size to 0px instead.
158
-
159
- 2.0 Corrected some immediate errors in the 1.9 update.
160
-
161
- 1.9
162
-
163
- - Added 7 flag image choices that, when clicked by website visitors, will change the language displayed, both on the website, AND in the drop-down box (flag language choices are limited to those provided in this plugin).
164
-
165
- - Added 6 additional languages to the translator, as provided in Google's most recent updates ( new languages include Bosnian, Cebuano, Khmer, Marathi, Hmong, Javanese ).
166
-
167
- - Corrected a minor technical issue where the Czech option (on the backend) was incorrectly displaying the Croatian language on the front end.
168
-
169
- - Added jQuery functionality to the settings panel to improve the user experience.
170
-
171
- - Added an option for users to display/hide the flag images.
172
-
173
- - Added an option for users to display/hide the translate box when flags are displayed.
174
-
175
- - Removed the settings.css file - I found a better way of displaying the options without CSS.
176
-
177
- 1.8 Modified google-language-translator.php to display the correct output to the browser when horizontal layout is selected. Previously, it was not displaying at all.
178
-
179
- 1.7 Modified google-language-translator.php so that jQuery and CSS styles were enqueued properly onto the settings page only. Previously, jQuery functionality and CSS styles were being added to all pages of the Wordpresss Dashboard, which was causing functionality and display issues for some users.
180
-
181
- 1.6 Added "Specific Language" support to the plugin settings, which allows the user to choose specific languages that are displayed to website visitors.
182
-
183
- 1.5 Added "Original Language" support to the plugin settings, which allows the user to choose the original language of their website, which ultimately removes the original language as a choice in the language drop-down presented to website visitors.
184
-
185
- 1.4 Corrected display problems associated with CSS styles not being placed correctly in wp_head.
186
-
187
- 1.3 HTML display problem in the sidebar area now fixed. Previously, inserting the [google-translator] plugin into a text widget caused it to display above the widget, instead of inside of it.
188
-
189
- 1.2 Shortcode support is now available for adding [google-translator] to text widgets. I apologize for any inconvenience this may have caused.
190
-
191
- 1.1 The shortcode supplied on the settings page was updated to display '[google-translator]'.
192
-
193
- == Screenshots ==
194
-
195
- 1. Settings include: inline or vertical layout, hide/show Google toolbar, display specific languages, and show/hide Google branding. Add the shortcode to pages, posts, and widgets.
 
 
 
 
 
1
+ === Google Language Translator ===
2
+ Contributors: Rob Myrick
3
+ Donate link: http://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=47LFA33AC89S6
4
+ Plugin link: http://www.studio88design.com/plugins/google-language-translator
5
+ Tags: language translator, google translator, language translate, google, google language translator, translation, translate, multi language
6
+ Requires at least: 2.9
7
+ Tested up to: 4.0.1
8
+ stable tag: 4.0.1
9
+
10
+ Welcome to Google Language Translator! This plugin allows you to insert the Google Language Translator tool anywhere on your website using shortcode.
11
+
12
+ == Description ==
13
+
14
+ Settings include: inline or vertical layout, show/hide specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
15
+
16
+ == Installation ==
17
+
18
+ 1. Download the zip folder named google-language-translator.zip
19
+ 2. Unzip the folder and put it in the plugins directory of your wordpress installation. (wp-content/plugins).
20
+ 3. Activate the plugin through the plugin window in the admin panel.
21
+ 4. Go to Settings > Google Language Translator, enable the plugin, and then choose your settings.
22
+ 5. Copy the shortcode and paste it into a page, post or widget.
23
+ 6. Do not use the shortcode twice on a single page - it will not work.
24
+
25
+
26
+ == Frequently Asked Questions ==
27
+
28
+ == Changelog ==
29
+
30
+ 4.0.1
31
+
32
+ - Fixed PHP errors that were neglected in upgrade to 4.0.
33
+ - Added conditionals to prevent scripts from loading when the floating widget is turned off.
34
+
35
+ 4.0
36
+
37
+ - Added 2 new features: 1) Drag/drop flags to re-arrange their order, and 2) Custom flag sizes (16px to 24px).
38
+ - Re-factored code in google-language-translator.php. Languages are now loaded dynamically and are not hard-coded.
39
+ - GLT Premium is now released: Updates include multiple flags for English, Spanish, and Portuguese languages; customized URLs with 'lang' attribute; drag/drop flags to re-arrnage their order
40
+
41
+ 3.0.9
42
+
43
+ - Added a title field to the Google Language Translator widget.
44
+ - Removed "unexpected text characters" error upon activation (due to error in activation hook).
45
+
46
+ 3.0.8
47
+
48
+ - Added 9 new languages into the plugin (Hausa, Igbo, Maori, Mongolian, Nepali, Punjabi, Somali, Yoruba, Zulu).
49
+ - Corrected an "undefined variable" error that was being generated in Vertical and Horizontal layouts.
50
+ - Re-structured coding once again into an Object-Oriented approach.
51
+ - Moved all functions of the base class into 'googlelanguagetranslator.php' and the widget into 'widget.php'.
52
+ - Moved all javascript files into it's own JS folder.
53
+ - Fixed an display issue with "Edit Translations" - they were being hidden when "No branding" option was chosen.
54
+ - Corrected various "comma" errors in the string that outputs the script for loading the translator.
55
+ - Changed Changelog in readme.txt to show most recent changes first, instead of last.
56
+
57
+ 3.0.7
58
+
59
+ - Removed an unnecessary CSS file, left over from development. Sorry for any inconvenience if you received display errors.
60
+
61
+ 3.0.6
62
+
63
+ - Corrected a small display error in displaying the floating widget correctly.
64
+
65
+ 3.0.5
66
+
67
+ - Added new Floating Widget (see settings page). The Floating Widget is simply another way for allowing website visitors to translate languages. The functionality is built-in with the existing flag preferences, and can be turned on or off at the administrator's preference. The floating widget can also function in full with both the language box and/or flags showing OR hiding, so the administrator has full control of how it displays. The floating widget is placed at bottom right of the website in the free version, but can be placed in other locations by changing CSS styles associated with the box. The premium version will allow more options as to changing the Floating Widget location.
68
+ - Fixed the issue with Dashboard styles loading on the wrong pages. This was causing some annoying display issues on the Wordpress Dashboard.
69
+
70
+ 3.0.4
71
+
72
+ - Re-factored/re-arranged more code in google languagetransltor.php by placing them into separate files.
73
+ - Fixed the issue of Custom CSS box not displaying it's styles to the website. This was only missed in this last update, due to re-arrangement of the files. Sorry for any inconvenience.
74
+ - Removed style2.php file, which is unnecessary and was being used in testing.
75
+
76
+ 3.0.3
77
+
78
+ - Re-factored/re-arranged some of the code in googlelanguagetranslator.php by placing them into separate files.
79
+ - Fixed a minor coding issue in glt_widget.php - this was generating an error in Wordpress when debugging.
80
+ - Moved all CSS code into a single file. The result is nice, clean inline CSS code that is now called only once.
81
+ - Fixed some additional CSS display issues.
82
+
83
+ 3.0.2
84
+
85
+ - Adjusted additional minor invalid HTML issues on the settings page, and also in the front-end plugin display.
86
+
87
+ 3.0.1
88
+
89
+ - Changed the url request to Google to allow both unsecured and secured page translations. Previously, some users experienced errors when trying to use the translator on "https://" (secured) pages.
90
+ - Adjusted some minor spacing issues in the settings page HTML (caused some annoying red HTML errors when using "View Source" in right-click menu).
91
+ - Removed old CSS styles that were added in the previous 3.0 update - the styles were added when Google servers were being updated, and were producing major translation dislay issues until their update was complete. Now the styles I added are no longer needed.
92
+
93
+ 3.0
94
+
95
+ - Correct a small CSS error that affected the showing/hiding of the Google toolbar.
96
+
97
+ 2.9
98
+
99
+ ***IMPORTANT: Google's most recent server update is producing display issues for website translation tool. There are major display issues with the translation toolbar and also the translations editing interface. Version 2.9 temporarily hides the edit translation functionality until Google decides to fix this issue, although you can still edit translations directly through your Google account at translate.google.com. Please direct any support requests through Wordpress.org and we will be happy to assist you.
100
+
101
+ - Fixed Google Translation toolbar display issue
102
+ - Fixed the Edit Translation interface by hiding it temporarily until Google fixes this
103
+ - Removed some unneeded styles from the style sheet.
104
+ - Fixed some CSS issues for the Google Branding display, which was affected by Google's most recent update
105
+
106
+ 2.8
107
+
108
+ - Added an option to allow users to manage their own translations directly through their Google Translate account (free). When activated, users can hover over the text of their website, and edit the translations from the webpage directly. Google will remember these translations, and then serve them to users once the edits are made. Users must install the Google Translate Customization meta tag provided through Google Translate here: translate.google.com/manager/website/settings. To obtain this meta tag, users need to configure the Google Translate tool directly from this website (although they will not use this because the plugin provides it), then the user can obtain the meta tag on the "Get Code" screen, which is displayed after configuring the Google Translate tool on this webpage.
109
+ - Added an option to allow users to turn on/off Google's multilanguagePage option, that when activated, the original website content will be a forced translation, instead of original content (but only after a translation is made.)
110
+ - Added more flexible styles to the settings page, so that left and right panels display nicely to the user.
111
+
112
+ 2.7
113
+
114
+ - Added Google Analytics tracking capability to the plugin.
115
+
116
+ - Added a "CSS Styles" box in the settings panel.
117
+
118
+ - Changed the Catalonian flag to its correct flag image.
119
+
120
+ - Fixed coding issues that previously updated options incorrectly, which is why many users experienced display issues. All options are now initialized upon plugin activation, which should fix this issue permanently.
121
+
122
+ - Fixed a glitch in our usage of the translate API. Previously, when the user clicked the default language, it would toggle back and forth between the default language and "Afrikaans" language. Now, users will see the correct language displayed at all times, no matter how many times it is clicked.
123
+
124
+ 2.6
125
+
126
+ - Added defaults to all options to ensure there are no more issues with the translator displaying upon installation. Again, sorry for any inconvenience.
127
+
128
+ 2.5
129
+
130
+ - Eliminated an internal Wordpress error being generated from a coding mistake.
131
+
132
+ - Added a default option for the Translator alingment. Previously, this was causing the plugin to disapppear.
133
+
134
+ 2.4
135
+
136
+ - Found a couple of small display errors in the settings page after uploading version 2.3. Sorry for any inconvenience!
137
+
138
+ 2.3
139
+
140
+ - Added a "Preview" area on the settings page that allows you to see your settings in action.
141
+
142
+ - Added custom flag support for all languages (custom flags available ONLY when selecting the "ALL Languages" setting.
143
+
144
+ - Added an option that allows left/right alignment of the translation tool.
145
+
146
+ - Added the "Google Language Translator" widget.
147
+
148
+ - Updated googlelanguagetranslator.php to properly register setting in the admin settings panel.
149
+
150
+ 2.2
151
+
152
+ - Added language "Portuguese" and "German" to the Original Language drop-down option on the settings page.
153
+
154
+ - Changed flag image for the English language (changed United States flag to the United Kingdom flag).
155
+
156
+ - Added link in the settings panel that points to Google's Attribution Policy.
157
+
158
+ 2.1
159
+
160
+ - Added language "Dutch" to the Original Language drop-down option on the settings page.
161
+
162
+ - Added a new CSS class that more accurately hides the "Powered by" text when hiding Google's branding. In previous version, the "Powered by" text was actually disguised by setting it's color to "transparent", but now we have set it's font-size to 0px instead.
163
+
164
+ 2.0 Corrected some immediate errors in the 1.9 update.
165
+
166
+ 1.9
167
+
168
+ - Added 7 flag image choices that, when clicked by website visitors, will change the language displayed, both on the website, AND in the drop-down box (flag language choices are limited to those provided in this plugin).
169
+
170
+ - Added 6 additional languages to the translator, as provided in Google's most recent updates ( new languages include Bosnian, Cebuano, Khmer, Marathi, Hmong, Javanese ).
171
+
172
+ - Corrected a minor technical issue where the Czech option (on the backend) was incorrectly displaying the Croatian language on the front end.
173
+
174
+ - Added jQuery functionality to the settings panel to improve the user experience.
175
+
176
+ - Added an option for users to display/hide the flag images.
177
+
178
+ - Added an option for users to display/hide the translate box when flags are displayed.
179
+
180
+ - Removed the settings.css file - I found a better way of displaying the options without CSS.
181
+
182
+ 1.8 Modified google-language-translator.php to display the correct output to the browser when horizontal layout is selected. Previously, it was not displaying at all.
183
+
184
+ 1.7 Modified google-language-translator.php so that jQuery and CSS styles were enqueued properly onto the settings page only. Previously, jQuery functionality and CSS styles were being added to all pages of the Wordpresss Dashboard, which was causing functionality and display issues for some users.
185
+
186
+ 1.6 Added "Specific Language" support to the plugin settings, which allows the user to choose specific languages that are displayed to website visitors.
187
+
188
+ 1.5 Added "Original Language" support to the plugin settings, which allows the user to choose the original language of their website, which ultimately removes the original language as a choice in the language drop-down presented to website visitors.
189
+
190
+ 1.4 Corrected display problems associated with CSS styles not being placed correctly in wp_head.
191
+
192
+ 1.3 HTML display problem in the sidebar area now fixed. Previously, inserting the [google-translator] plugin into a text widget caused it to display above the widget, instead of inside of it.
193
+
194
+ 1.2 Shortcode support is now available for adding [google-translator] to text widgets. I apologize for any inconvenience this may have caused.
195
+
196
+ 1.1 The shortcode supplied on the settings page was updated to display '[google-translator]'.
197
+
198
+ == Screenshots ==
199
+
200
+ 1. Settings include: inline or vertical layout, hide/show Google toolbar, display specific languages, and show/hide Google branding. Add the shortcode to pages, posts, and widgets.