style.php
120 lines
| 1 | <?php |
| 2 | $glt_css = get_option('googlelanguagetranslator_css'); |
| 3 | $language_switcher_width = get_option('glt_language_switcher_width'); |
| 4 | $language_switcher_text_color = get_option('glt_language_switcher_text_color'); |
| 5 | $language_switcher_bg_color = get_option('glt_language_switcher_bg_color'); |
| 6 | $glt_display = get_option('googlelanguagetranslator_display'); |
| 7 | $floating_widget_position = get_option ('glt_floating_widget_position'); |
| 8 | $floating_widget_text_color = get_option ('glt_floating_widget_text_color'); |
| 9 | $floating_widget_bg_color = get_option('glt_floating_widget_bg_color'); |
| 10 | |
| 11 | echo '<style>'; |
| 12 | echo $glt_css; |
| 13 | |
| 14 | if(get_option('googlelanguagetranslator_flags') == 1) { |
| 15 | if($glt_display == 'Vertical') { |
| 16 | echo 'p.hello{font-size:12px;color:darkgray;}'; |
| 17 | echo '#google_language_translator,#flags{text-align:left;}'; |
| 18 | } elseif($glt_display == 'Horizontal') { |
| 19 | if(get_option('googlelanguagetranslator_flags_alignment') == 'flags_right') { |
| 20 | echo '#google_language_translator{text-align:left!important;}'; |
| 21 | echo 'select.goog-te-combo{float:right;}'; |
| 22 | echo '.goog-te-gadget{padding-top:13px;}'; |
| 23 | echo '.goog-te-gadget .goog-te-combo{margin-top:-7px!important;}'; |
| 24 | } |
| 25 | |
| 26 | echo '.goog-te-gadget{margin-top:2px!important;}'; |
| 27 | echo 'p.hello{font-size:12px;color:#666;}'; |
| 28 | echo 'div.skiptranslate.goog-te-gadget{display:inline!important;}'; |
| 29 | } elseif($glt_display == 'SIMPLE' and get_option('googlelanguagetranslator_flags_alignment') == 'flags_right') { |
| 30 | echo '.goog-te-gadget{float:right;clear:right;}'; |
| 31 | echo 'div.skiptranslate.goog-te-gadget{display:inline!important;}'; |
| 32 | } |
| 33 | |
| 34 | if(get_option('googlelanguagetranslator_flags_alignment') == 'flags_right') { |
| 35 | echo '#google_language_translator,#language{clear:both;width:160px;text-align:right;}'; |
| 36 | echo '#language{float:right;}'; |
| 37 | echo '#flags{text-align:right;width:165px;float:right;clear:right;}'; |
| 38 | echo '#flags ul{float:right!important;}'; |
| 39 | echo 'p.hello{text-align:right;float:right;clear:both;}'; |
| 40 | echo '.glt-clear{height:0px;clear:both;margin:0px;padding:0px;}'; |
| 41 | } |
| 42 | |
| 43 | if(get_option('googlelanguagetranslator_flags_alignment') == 'flags_left') { |
| 44 | echo '#google_language_translator{clear:both;}'; |
| 45 | echo '#flags{width:165px;}'; |
| 46 | echo '#flags a{display:inline-block;margin-right:2px;}'; |
| 47 | } elseif(get_option('googlelanguagetranslator_flags_alignment') == 'flags_right') { |
| 48 | echo '#flags{width:165px;}'; |
| 49 | echo '#flags a{display:inline-block;margin-left:2px;}'; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | if(get_option('googlelanguagetranslator_active') == 1) { |
| 54 | if(get_option('googlelanguagetranslator_showbranding') == 'Yes') { |
| 55 | echo '#google_language_translator{width:auto!important;}'; |
| 56 | echo 'div.skiptranslate.goog-te-gadget{display:inline!important;}'; |
| 57 | } elseif(get_option('googlelanguagetranslator_showbranding') == 'No' and $glt_display != 'SIMPLE') { |
| 58 | echo '#google_language_translator a{display:none!important;}'; |
| 59 | echo 'div.skiptranslate.goog-te-gadget{display:inline!important;}'; |
| 60 | echo '.goog-te-gadget{color:transparent!important;}'; |
| 61 | echo '.goog-te-gadget{font-size:0px!important;}'; |
| 62 | echo '.goog-branding{display:none;}'; |
| 63 | } |
| 64 | |
| 65 | echo '.goog-tooltip{display: none!important;}'; |
| 66 | echo '.goog-tooltip:hover{display: none!important;}'; |
| 67 | echo '.goog-text-highlight{background-color:transparent!important;border:none!important;box-shadow:none!important;}'; |
| 68 | |
| 69 | if(get_option('googlelanguagetranslator_translatebox') == 'no') |
| 70 | echo '#google_language_translator{display:none;}'; |
| 71 | } |
| 72 | |
| 73 | if(!empty($language_switcher_text_color)) |
| 74 | echo '#google_language_translator select.goog-te-combo{color:'.$language_switcher_text_color.';}'; |
| 75 | |
| 76 | if(get_option('googlelanguagetranslator_flags') == 0 and get_option('googlelanguagetranslator_active') == 1) |
| 77 | echo '#flags{display:none;}'; |
| 78 | |
| 79 | if(get_option('googlelanguagetranslator_active') == 1) { |
| 80 | if(get_option('googlelanguagetranslator_toolbar') == 'Yes'){ |
| 81 | echo '#google_language_translator{color:transparent;}'; |
| 82 | } elseif(get_option('googlelanguagetranslator_toolbar') == 'No') { |
| 83 | echo 'div.skiptranslate{display:none!important;}'; |
| 84 | } |
| 85 | echo 'body{top:0px!important;}'; |
| 86 | echo '#goog-gt-{display:none!important;}'; |
| 87 | echo 'font font{background-color:transparent!important;box-shadow:none!important;position:initial!important;}'; |
| 88 | } |
| 89 | |
| 90 | if($floating_widget_position == 'bottom_left') { |
| 91 | echo '#glt-translate-trigger{left:20px;right:auto;}'; |
| 92 | } elseif($floating_widget_position == 'top_right') { |
| 93 | echo '#glt-translate-trigger{bottom:auto;top:0;}'; |
| 94 | echo '.tool-container.tool-top{top:50px!important;bottom:auto!important;}'; |
| 95 | echo '.tool-container.tool-top .arrow{border-color:transparent transparent #d0cbcb; top:-14px;}'; |
| 96 | } elseif ($floating_widget_position == 'top_left') { |
| 97 | echo '#glt-translate-trigger{bottom:auto;top:0;left:20px;right:auto;}'; |
| 98 | echo '.tool-container.tool-top{top:50px!important;bottom:auto!important;}'; |
| 99 | echo '.tool-container.tool-top .arrow{border-color:transparent transparent #d0cbcb;top:-14px;}'; |
| 100 | } elseif ($floating_widget_position == 'top_center') { |
| 101 | echo '#glt-translate-trigger{bottom:auto;top:0;left:50%;margin-left:-63px;right:auto;}'; |
| 102 | echo '.tool-container.tool-top{top:50px!important;bottom:auto!important;}'; |
| 103 | echo '.tool-container.tool-top .arrow{border-color:transparent transparent #d0cbcb;top:-14px;}'; |
| 104 | } elseif ($floating_widget_position == 'bottom_center') { |
| 105 | echo '#glt-translate-trigger{left:50%; margin-left:-63px; right:auto;}'; |
| 106 | } |
| 107 | |
| 108 | if(!empty($floating_widget_text_color)) |
| 109 | echo '#glt-translate-trigger > span{color:'.$floating_widget_text_color.';}'; |
| 110 | |
| 111 | if(!empty($floating_widget_bg_color)) |
| 112 | echo '#glt-translate-trigger{background:'.$floating_widget_bg_color.';}'; |
| 113 | |
| 114 | if(!empty($language_switcher_width) and isset($language_switcher_width) and $glt_display != 'Horizontal') |
| 115 | echo '.goog-te-gadget .goog-te-combo{width:'.$language_switcher_width.';}'; |
| 116 | |
| 117 | if(!empty($language_switcher_bg_color) and isset($language_switcher_bg_color)) |
| 118 | echo '#google_language_translator .goog-te-gadget .goog-te-combo{background:'.$language_switcher_bg_color.';border:0!important;}'; |
| 119 | |
| 120 | echo '</style>'; |