style.php
134 lines
| 1 | <?php |
| 2 | |
| 3 | $glt_css = get_option("googlelanguagetranslator_css"); |
| 4 | $language_switcher_width = get_option('glt_language_switcher_width'); |
| 5 | $language_switcher_text_color = get_option('glt_language_switcher_text_color'); |
| 6 | $language_switcher_bg_color = get_option('glt_language_switcher_bg_color'); |
| 7 | $glt_display = get_option('googlelanguagetranslator_display'); |
| 8 | $floating_widget_position = get_option ('glt_floating_widget_position'); |
| 9 | $floating_widget_text_color = get_option ('glt_floating_widget_text_color'); |
| 10 | $floating_widget_bg_color = get_option('glt_floating_widget_bg_color'); |
| 11 | |
| 12 | echo '<style type="text/css">'; |
| 13 | echo $glt_css; |
| 14 | |
| 15 | if (get_option('googlelanguagetranslator_flags') == 1): |
| 16 | if(get_option('googlelanguagetranslator_display')=='Vertical'): |
| 17 | echo 'p.hello { font-size:12px; color:darkgray; }'; |
| 18 | echo '#google_language_translator, #flags { text-align:left; }'; |
| 19 | elseif (get_option('googlelanguagetranslator_display')=='Horizontal'): |
| 20 | if (get_option('googlelanguagetranslator_flags_alignment')=='flags_right'): |
| 21 | echo '#google_language_translator { text-align:left !important; }'; |
| 22 | echo 'select.goog-te-combo { float:right; }'; |
| 23 | echo '.goog-te-gadget { padding-top:13px; }'; |
| 24 | echo '.goog-te-gadget .goog-te-combo { margin-top:-7px !important; }'; |
| 25 | endif; |
| 26 | echo '.goog-te-gadget { margin-top:2px !important; }'; |
| 27 | echo 'p.hello { font-size:12px; color:#666; }'; |
| 28 | elseif (get_option('googlelanguagetranslator_display')=='SIMPLE'): |
| 29 | if (get_option('googlelanguagetranslator_flags_alignment')=='flags_right'): |
| 30 | echo '.goog-te-gadget { float:right; clear:right; }'; |
| 31 | endif; |
| 32 | endif; |
| 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 | endif; |
| 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 | endif; |
| 51 | endif; |
| 52 | |
| 53 | if (get_option('googlelanguagetranslator_showbranding')=='Yes'): |
| 54 | if(get_option('googlelanguagetranslator_active')==1): |
| 55 | echo '#google_language_translator { width:auto !important; }'; |
| 56 | endif; |
| 57 | elseif (get_option('googlelanguagetranslator_showbranding')=='No' && get_option('googlelanguagetranslator_display')!='SIMPLE'): |
| 58 | if(get_option('googlelanguagetranslator_active')==1): |
| 59 | echo '#google_language_translator a {display: none !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 | endif; |
| 64 | endif; |
| 65 | |
| 66 | if (get_option('googlelanguagetranslator_active')==1) { |
| 67 | echo '.goog-tooltip {display: none !important;}'; |
| 68 | echo '.goog-tooltip:hover {display: none !important;}'; |
| 69 | echo '.goog-text-highlight {background-color: transparent !important; border: none !important; box-shadow: none !important;}'; |
| 70 | } |
| 71 | |
| 72 | if (get_option('googlelanguagetranslator_translatebox') == 'no'): |
| 73 | if(get_option('googlelanguagetranslator_active')==1): |
| 74 | echo '#google_language_translator { display:none; }'; |
| 75 | endif; |
| 76 | endif; |
| 77 | |
| 78 | if (!empty($language_switcher_text_color)): |
| 79 | echo '#google_language_translator select.goog-te-combo { color:'.$language_switcher_text_color.'; }'; |
| 80 | endif; |
| 81 | |
| 82 | if (get_option('googlelanguagetranslator_flags') == 0): |
| 83 | if(get_option('googlelanguagetranslator_active') ==1): |
| 84 | echo '#flags { display:none; }'; |
| 85 | endif; |
| 86 | endif; |
| 87 | |
| 88 | if (get_option('googlelanguagetranslator_toolbar')=='Yes'): |
| 89 | if (get_option('googlelanguagetranslator_active')==1): |
| 90 | echo '#google_language_translator {color: transparent;}'; |
| 91 | echo 'body { top:0px !important; }'; |
| 92 | endif; |
| 93 | elseif (get_option('googlelanguagetranslator_toolbar')=='No'): |
| 94 | if (get_option('googlelanguagetranslator_active')==1): |
| 95 | echo '.goog-te-banner-frame{visibility:hidden !important;}'; |
| 96 | echo 'body { top:0px !important;}'; |
| 97 | endif; |
| 98 | endif; |
| 99 | |
| 100 | if ($floating_widget_position == 'bottom_left'): |
| 101 | echo '#glt-translate-trigger { left:20px; right:auto; }'; |
| 102 | elseif ($floating_widget_position == 'top_right'): |
| 103 | echo '#glt-translate-trigger { bottom:auto; top:0; }'; |
| 104 | echo '.tool-container.tool-top { top:50px !important; bottom:auto !important; }'; |
| 105 | echo '.tool-container.tool-top .arrow { border-color:transparent transparent #d0cbcb; top:-14px; }'; |
| 106 | elseif ($floating_widget_position == 'top_left'): |
| 107 | echo '#glt-translate-trigger { bottom:auto; top:0; left:20px; right:auto; }'; |
| 108 | echo '.tool-container.tool-top { top:50px !important; bottom:auto !important; }'; |
| 109 | echo '.tool-container.tool-top .arrow { border-color:transparent transparent #d0cbcb; top:-14px; }'; |
| 110 | elseif ($floating_widget_position == 'top_center'): |
| 111 | echo '#glt-translate-trigger { bottom:auto; top:0; left:50%; margin-left:-63px; right:auto; }'; |
| 112 | echo '.tool-container.tool-top { top:50px !important; bottom:auto !important; }'; |
| 113 | echo '.tool-container.tool-top .arrow { border-color:transparent transparent #d0cbcb; top:-14px; }'; |
| 114 | elseif ($floating_widget_position == 'bottom_center'): |
| 115 | echo '#glt-translate-trigger { left:50%; margin-left:-63px; right:auto; }'; |
| 116 | endif; |
| 117 | |
| 118 | if (!empty($floating_widget_text_color)): |
| 119 | echo '#glt-translate-trigger > span { color:'.$floating_widget_text_color.'; }'; |
| 120 | endif; |
| 121 | |
| 122 | if (!empty($floating_widget_bg_color)): |
| 123 | echo '#glt-translate-trigger { background:'.$floating_widget_bg_color.'; }'; |
| 124 | endif; |
| 125 | |
| 126 | if (!empty($language_switcher_width) && isset($language_switcher_width) && $glt_display != 'Horizontal'): |
| 127 | echo '.goog-te-gadget .goog-te-combo { width:'.$language_switcher_width.'; }'; |
| 128 | endif; |
| 129 | |
| 130 | if (!empty($language_switcher_bg_color) && isset($language_switcher_bg_color)): |
| 131 | echo '#google_language_translator .goog-te-gadget .goog-te-combo { background:'.$language_switcher_bg_color.'; border:0 !important; }'; |
| 132 | endif; |
| 133 | |
| 134 | echo '</style>'; ?> |