Changeset 2264552
- Timestamp:
- 03/20/2020 02:04:03 PM (6 years ago)
- Location:
- zedna-cookies-bar/trunk
- Files:
-
- 3 edited
-
css/zedna-cookies-bar.css (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
zedna-cookies-bar.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
zedna-cookies-bar/trunk/css/zedna-cookies-bar.css
r2258840 r2264552 30 30 } 31 31 32 #zedna-cookies-bar .cross { 33 position: absolute; 34 top: 5px; 35 right: 5px; 36 color: #000; 37 z-index: 10; 38 font-size: 30px; 39 font-family: helvetica, arial, sans-serif; 40 font-weight: bold; 41 text-decoration: none; 42 } 43 32 44 button#zednaAcceptCookies { 33 45 margin: 0 10px; -
zedna-cookies-bar/trunk/readme.txt
r2258840 r2264552 4 4 Requires at least: 3.8 5 5 Tested up to: 5.4 6 Stable tag: 1. 06 Stable tag: 1.2 7 7 License: GPL3 8 8 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 12 12 == Description == 13 13 Small cookies bar to inform visitors that your website uses cookies without beign too disturbing. 14 User can setup colors of text, bar and button. You can also choose to show bar at the top or bottom of the page. 14 User can setup colors of text, bar and button. You can also choose to show bar at the top or bottom of the page. You can also add custom css. 15 15 And frontend is independent on jQuery. 16 16 -
zedna-cookies-bar/trunk/zedna-cookies-bar.php
r2259843 r2264552 7 7 Author: Radek Mezulanik 8 8 Author URI: https://www.mezulanik.cz 9 Version: 1. 19 Version: 1.2 10 10 License: GPL3 11 11 */ … … 26 26 $cookie_bar_bg_color = (get_option('zedna_cookies_bar_bg_color') != '') ? get_option('zedna_cookies_bar_bg_color') : '#2e363f'; 27 27 $cookie_bar_text_color = (get_option('zedna_cookies_bar_text_color') != '') ? get_option('zedna_cookies_bar_text_color') : '#ffffff'; 28 $cookie_bar_link_color = (get_option('zedna_cookies_bar_link_color') != '') ? get_option('zedna_cookies_bar_link_color') : '#ffffff'; 28 29 $cookie_bar_position = (get_option('zedna_cookies_bar_position') != '') ? get_option('zedna_cookies_bar_position') : 'bottom'; 30 $cookie_bar_custom_css = (get_option('zedna_cookies_bar_custom_css') != '') ? get_option('zedna_cookies_bar_custom_css') : ''; 31 $cookies_bar_show_button = (get_option('zedna_cookies_bar_show_button') != '') ? get_option('zedna_cookies_bar_show_button') : 'yes'; 29 32 ?> 30 33 <script> … … 51 54 <th scope="row"><?php _e('Button Text', 'zedna-cookies-bar'); ?></th> 52 55 <td><input type="text" size="20" name="zedna_cookies_bar_button" value="<?php echo esc_attr( $button_text ); ?>" /> <small>(e.g. I Agree)</small></td> 53 </tr> 56 </tr> 57 <tr valign="top"> 58 <th scope="row"><?php _e('Show button', 'zedna-cookies-bar'); ?></th> 59 <td> 60 <select name='zedna_cookies_bar_show_button'> 61 <?php 62 if ($cookie_bar_position == "bottom"){ 63 echo "<option value='yes'>".__('Yes','zedna-cookies-bar')."</option> 64 <option value='no' selected=selected>".__('No','zedna-cookies-bar')."</option>"; 65 }else{ 66 echo "<option value='yes' selected=selected>".__('Yes','zedna-cookies-bar')."</option> 67 <option value='no'>".__('No','zedna-cookies-bar')."</option>"; 68 } 69 ?> 70 </select> 71 </td> 72 </tr> 54 73 <tr valign="top"> 55 74 <th scope="row"><?php _e('Button background color', 'zedna-cookies-bar'); ?></th> … … 70 89 <tr valign="top"> 71 90 <th scope="row"><?php _e('Bar link color', 'zedna-cookies-bar'); ?></th> 72 <td><input type="text" name="zedna_cookies_bar_link_color" value="<?php echo esc_attr( $cookie_bar_ text_color ); ?>" class="zedna_cookies_bar_link_color" data-default-color="#ffffff" /></td>91 <td><input type="text" name="zedna_cookies_bar_link_color" value="<?php echo esc_attr( $cookie_bar_link_color ); ?>" class="zedna_cookies_bar_link_color" data-default-color="#ffffff" /></td> 73 92 </tr> 74 93 <tr valign="top"> … … 88 107 </td> 89 108 </tr> 109 <tr valign="top"> 110 <th scope="row"><?php _e('Custom styles', 'zedna-cookies-bar'); ?></th> 111 <td> 112 <textarea name="zedna_cookies_bar_custom_css" class="zedna_cookies_bar_custom_css" rows="4" cols="50"><?php echo esc_attr( $cookie_bar_custom_css ); ?></textarea> 113 <small>Use identifier #zedna-cookies-bar</small> 114 </td> 115 </tr> 90 116 </table> 91 117 <?php submit_button(); ?> … … 112 138 register_setting( 'zedna-cookies-bar-settings', 'zedna_cookies_bar_link_color' ); 113 139 register_setting( 'zedna-cookies-bar-settings', 'zedna_cookies_bar_position' ); 140 register_setting( 'zedna-cookies-bar-settings', 'zedna_cookies_bar_custom_css' ); 141 register_setting( 'zedna-cookies-bar-settings', 'zedna_cookies_bar_show_button' ); 114 142 } 115 143 add_action( 'admin_init', 'zedna_cookies_bar_settings' ); … … 124 152 delete_option( 'zedna_cookies_bar_link_color' ); 125 153 delete_option( 'zedna_cookies_bar_position' ); 154 delete_option( 'zedna_cookies_bar_custom_css' ); 155 delete_option( 'zedna_cookies_bar_show_button' ); 126 156 } 127 157 register_deactivation_hook( __FILE__, 'zedna_cookies_bar_deactivation' ); … … 150 180 151 181 function zedna_cookies_bar() { 182 $cookies_bar_show_button = get_option('zedna_cookies_bar_show_button'); 152 183 $zedna_cookies_bar_message_output = get_option( 'zedna_cookies_bar_message' ); 153 184 $zedna_cookies_bar_button_output = esc_attr( get_option('zedna_cookies_bar_button') ); … … 156 187 ?> 157 188 <!-- Cookies bar --> 158 <div id="zedna-cookies-bar" class="<?php echo esc_attr( get_option('zedna_cookies_bar_position') ); ?>" style="background-color:<?php echo esc_attr( get_option('zedna_cookies_bar_bg_color') ); ?>;color:<?php echo esc_attr( get_option('zedna_cookies_bar_text_color') ); ?>;"><?php echo $zedna_cookies_bar_message_output; ?> <button id="zednaAcceptCookies" <?php if (get_option('zedna_cookies_bar_btn_bg_color') == true) { ?> style="background-color:<?php echo esc_attr( get_option('zedna_cookies_bar_btn_bg_color') ); ?>;color:<?php echo esc_attr( get_option('zedna_cookies_bar_btn_text_color') ); ?>;" <?php } ?> onclick="zednaAcceptCookies();"><?php echo $zedna_cookies_bar_button_output; ?></button></div> 159 <style>#zedna-cookies-bar a{color: <?php echo esc_attr( get_option('zedna_cookies_bar_link_color') ); ?>}</style> 189 <div id="zedna-cookies-bar" class="<?php echo strlen($cookie_bar_custom_css) > 0 ? esc_attr( get_option('zedna_cookies_bar_position') ) : '';?>" style="background-color:<?php echo esc_attr( get_option('zedna_cookies_bar_bg_color') ); ?>;color:<?php echo esc_attr( get_option('zedna_cookies_bar_text_color') ); ?>;"><?php echo $zedna_cookies_bar_message_output; ?> <?php if($cookies_bar_show_button == 'yes'){?><button id="zednaAcceptCookies" <?php if (get_option('zedna_cookies_bar_btn_bg_color') == true) { ?> style="background-color:<?php echo esc_attr( get_option('zedna_cookies_bar_btn_bg_color') ); ?>;color:<?php echo esc_attr( get_option('zedna_cookies_bar_btn_text_color') ); ?>;" <?php } ?> onclick="zednaAcceptCookies();"><?php echo $zedna_cookies_bar_button_output; ?></button><?php } ?> 190 <?php if($cookies_bar_show_button == 'no'):?> 191 <a class="cross" onclick="zednaAcceptCookies();">×</a> 192 <?php endif;?> 193 </div> 194 <style> 195 #zedna-cookies-bar a{color: <?php echo esc_attr( get_option('zedna_cookies_bar_link_color') ); ?>} 196 <?php echo esc_attr( get_option('zedna_cookies_bar_custom_css') )?> 197 <?php if($cookies_bar_show_button == 'no'):?> 198 #zedna-cookies-bar .cross{color: <?php echo esc_attr( get_option('zedna_cookies_bar_btn_text_color') ); ?>} 199 <?php endif;?> 200 </style> 160 201 <!-- End Cookies bar --> 161 202 <?php
Note: See TracChangeset
for help on using the changeset viewer.