1 | <?php |
---|
2 | /** |
---|
3 | * Banner Settings File Doc Comment |
---|
4 | * |
---|
5 | * @category Views |
---|
6 | * @package gdpr-cookie-compliance |
---|
7 | * @author Moove Agency |
---|
8 | */ |
---|
9 | |
---|
10 | if ( ! defined( 'ABSPATH' ) ) { |
---|
11 | exit; |
---|
12 | } // Exit if accessed directly |
---|
13 | |
---|
14 | $gdpr_default_content = new Moove_GDPR_Content(); |
---|
15 | $option_name = $gdpr_default_content->moove_gdpr_get_option_name(); |
---|
16 | $gdpr_options = get_option( $option_name ); |
---|
17 | $wpml_lang = $gdpr_default_content->moove_gdpr_get_wpml_lang(); |
---|
18 | $gdpr_options = is_array( $gdpr_options ) ? $gdpr_options : array(); |
---|
19 | if ( isset( $_POST ) && isset( $_POST['moove_gdpr_nonce'] ) ) : |
---|
20 | $nonce = sanitize_key( $_POST['moove_gdpr_nonce'] ); |
---|
21 | if ( ! wp_verify_nonce( $nonce, 'moove_gdpr_nonce_field' ) ) : |
---|
22 | die( 'Security check' ); |
---|
23 | else : |
---|
24 | if ( is_array( $_POST ) ) : |
---|
25 | $restricted_keys = array( |
---|
26 | 'moove_gdpr_floating_button_enable', |
---|
27 | 'moove_gdpr_infobar_visibility', |
---|
28 | 'moove_gdpr_reject_button_enable', |
---|
29 | 'moove_gdpr_accept_button_enable', |
---|
30 | 'moove_gdpr_settings_button_enable', |
---|
31 | 'moove_gdpr_close_button_enable', |
---|
32 | 'moove_gdpr_colour_scheme', |
---|
33 | 'gdpr_close_button_bhv_redirect', |
---|
34 | 'gdpr_accesibility', |
---|
35 | ); |
---|
36 | // Cookie Banner Visibility. |
---|
37 | $moove_gdpr_infobar_visibility = 'hidden'; |
---|
38 | if ( isset( $_POST['moove_gdpr_infobar_visibility'] ) ) : |
---|
39 | $moove_gdpr_infobar_visibility = 'visible'; |
---|
40 | endif; |
---|
41 | $gdpr_options['moove_gdpr_infobar_visibility'] = $moove_gdpr_infobar_visibility; |
---|
42 | |
---|
43 | // Cookie Banner Accept Button. |
---|
44 | $moove_gdpr_accept_enable = '0'; |
---|
45 | if ( isset( $_POST['moove_gdpr_accept_button_enable'] ) ) : |
---|
46 | $moove_gdpr_accept_enable = '1'; |
---|
47 | endif; |
---|
48 | $gdpr_options['moove_gdpr_accept_button_enable'] = $moove_gdpr_accept_enable; |
---|
49 | |
---|
50 | // Cookie Banner Reject Button. |
---|
51 | $moove_gdpr_reject_enable = '0'; |
---|
52 | if ( isset( $_POST['moove_gdpr_reject_button_enable'] ) ) : |
---|
53 | $moove_gdpr_reject_enable = '1'; |
---|
54 | endif; |
---|
55 | $gdpr_options['moove_gdpr_reject_button_enable'] = $moove_gdpr_reject_enable; |
---|
56 | |
---|
57 | $gdpr_options['gdpr_reject_button_bhv'] = 1; |
---|
58 | if ( '1' === $moove_gdpr_reject_enable ) : |
---|
59 | if ( isset( $_POST['gdpr_reject_button_bhv'] ) && intval( $_POST['gdpr_reject_button_bhv'] ) ) : |
---|
60 | $gdpr_options['gdpr_reject_button_bhv'] = intval( $_POST['gdpr_reject_button_bhv'] ); |
---|
61 | $gdpr_options['gdpr_reject_button_bhv_bg_colour'] = isset( $_POST['gdpr_reject_button_bhv_bg_colour'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr_reject_button_bhv_bg_colour'] ) ) : ''; |
---|
62 | $gdpr_options['gdpr_reject_button_bhv_txt_colour'] = isset( $_POST['gdpr_reject_button_bhv_txt_colour'] ) ? sanitize_text_field( wp_unslash( $_POST['gdpr_reject_button_bhv_txt_colour'] ) ) : ''; |
---|
63 | endif; |
---|
64 | endif; |
---|
65 | |
---|
66 | // Cookie Banner Settings Button. |
---|
67 | $moove_gdpr_reject_enable = '0'; |
---|
68 | if ( isset( $_POST['moove_gdpr_settings_button_enable'] ) ) : |
---|
69 | $moove_gdpr_reject_enable = '1'; |
---|
70 | endif; |
---|
71 | $gdpr_options['moove_gdpr_settings_button_enable'] = $moove_gdpr_reject_enable; |
---|
72 | |
---|
73 | // Cookie Banner Close Button. |
---|
74 | $moove_gdpr_close_enable = '0'; |
---|
75 | if ( isset( $_POST['moove_gdpr_close_button_enable'] ) ) : |
---|
76 | $moove_gdpr_close_enable = '1'; |
---|
77 | endif; |
---|
78 | $gdpr_options['moove_gdpr_close_button_enable'] = $moove_gdpr_close_enable; |
---|
79 | |
---|
80 | $gdpr_options['gdpr_close_button_bhv'] = 1; |
---|
81 | if ( '1' === $moove_gdpr_close_enable ) : |
---|
82 | if ( isset( $_POST['gdpr_close_button_bhv'] ) && intval( $_POST['gdpr_close_button_bhv'] ) ) : |
---|
83 | $gdpr_options['gdpr_close_button_bhv'] = intval( $_POST['gdpr_close_button_bhv'] ); |
---|
84 | $gdpr_options['gdpr_close_button_bhv_redirect'] = isset( $_POST['gdpr_close_button_bhv_redirect'] ) ? sanitize_url( wp_unslash( $_POST['gdpr_close_button_bhv_redirect'] ) ) : ''; |
---|
85 | endif; |
---|
86 | endif; |
---|
87 | |
---|
88 | // Cookie Banner Colour Scheme. |
---|
89 | $moove_gdpr_colour_scheme = '2'; |
---|
90 | |
---|
91 | if ( isset( $_POST['moove_gdpr_colour_scheme'] ) ) : |
---|
92 | $moove_gdpr_colour_scheme = '1'; |
---|
93 | endif; |
---|
94 | $gdpr_options['moove_gdpr_colour_scheme'] = $moove_gdpr_colour_scheme; |
---|
95 | |
---|
96 | // Cookie Banner Accesibility. |
---|
97 | $gdpr_accesibility = '0'; |
---|
98 | |
---|
99 | if ( isset( $_POST['gdpr_accesibility'] ) ) : |
---|
100 | $gdpr_accesibility = '1'; |
---|
101 | endif; |
---|
102 | $gdpr_options['gdpr_accesibility'] = $gdpr_accesibility; |
---|
103 | |
---|
104 | update_option( $option_name, $gdpr_options ); |
---|
105 | |
---|
106 | foreach ( $_POST as $form_key => $form_value ) : |
---|
107 | if ( 'moove_gdpr_info_bar_content' === $form_key ) : |
---|
108 | $value = wpautop( wp_unslash( $form_value ) ); |
---|
109 | $gdpr_options[ $form_key . $wpml_lang ] = $value; |
---|
110 | elseif ( 'moove_gdpr_modal_strictly_secondary_notice' . $wpml_lang === $form_key ) : |
---|
111 | $value = wpautop( wp_unslash( $form_value ) ); |
---|
112 | $gdpr_options[ $form_key ] = $value; |
---|
113 | elseif ( 'gdpr_initialization_delay' === $form_key ) : |
---|
114 | $value = intval( $form_value ); |
---|
115 | $gdpr_options[ $form_key ] = $value; |
---|
116 | elseif ( 'gdpr_bs_buttons_order' === $form_key ) : |
---|
117 | $value = json_decode( wp_unslash( $form_value ), true ); |
---|
118 | $allowed_values = array( 'accept', 'reject', 'settings', 'close' ); |
---|
119 | $buttons_order = array(); |
---|
120 | if ( is_array( $value ) ) : |
---|
121 | foreach ( $value as $button_type ) : |
---|
122 | if ( in_array( $button_type, $allowed_values ) ) : |
---|
123 | $buttons_order[] = $button_type; |
---|
124 | endif; |
---|
125 | endforeach; |
---|
126 | endif; |
---|
127 | $buttons_order = $buttons_order ? $buttons_order : $allowed_values; |
---|
128 | $gdpr_options[ $form_key ] = json_encode( $buttons_order ); |
---|
129 | elseif ( ! in_array( $form_key, $restricted_keys ) ) : |
---|
130 | $value = sanitize_text_field( wp_unslash( $form_value ) ); |
---|
131 | $gdpr_options[ $form_key ] = $value; |
---|
132 | endif; |
---|
133 | endforeach; |
---|
134 | update_option( $option_name, $gdpr_options ); |
---|
135 | $gdpr_options = get_option( $option_name ); |
---|
136 | endif; |
---|
137 | do_action( 'gdpr_cookie_filter_settings' ); |
---|
138 | ?> |
---|
139 | <script> |
---|
140 | jQuery('#moove-gdpr-setting-error-settings_updated').show(); |
---|
141 | </script> |
---|
142 | <?php |
---|
143 | endif; |
---|
144 | endif; |
---|
145 | |
---|
146 | $buttons_order = isset( $gdpr_options['gdpr_bs_buttons_order'] ) ? json_decode( $gdpr_options['gdpr_bs_buttons_order'], true ) : array('accept', 'reject', 'settings', 'close'); |
---|
147 | |
---|
148 | $initalization_delay = isset( $gdpr_options['gdpr_initialization_delay'] ) && intval( $gdpr_options['gdpr_initialization_delay'] ) >= 0 ? intval( $gdpr_options['gdpr_initialization_delay'] ) : apply_filters( 'gdpr_init_script_delay', 2000 ); |
---|
149 | ?> |
---|
150 | <form action="<?php echo esc_url( admin_url( 'admin.php?page=moove-gdpr&tab=banner-settings' ) ); ?>" method="post" id="moove_gdpr_tab_banner_settings"> |
---|
151 | <?php wp_nonce_field( 'moove_gdpr_nonce_field', 'moove_gdpr_nonce' ); ?> |
---|
152 | <h2><?php esc_html_e( 'Cookie Banner Settings', 'gdpr-cookie-compliance' ); ?></h2> |
---|
153 | <hr /> |
---|
154 | |
---|
155 | <table class="form-table"> |
---|
156 | <tbody> |
---|
157 | <tr> |
---|
158 | <th scope="row"> |
---|
159 | <label for="moove_gdpr_infobar_visibility"><?php esc_html_e( 'Turn', 'gdpr-cookie-compliance' ); ?></label> |
---|
160 | </th> |
---|
161 | <td> |
---|
162 | <!-- GDPR Rounded switch --> |
---|
163 | <label class="gdpr-checkbox-toggle"> |
---|
164 | <input type="checkbox" name="moove_gdpr_infobar_visibility" <?php echo isset( $gdpr_options['moove_gdpr_infobar_visibility'] ) ? ( 'visible' === $gdpr_options['moove_gdpr_infobar_visibility'] ? 'checked' : '' ) : 'checked'; ?> > |
---|
165 | <span class="gdpr-checkbox-slider" data-enable="<?php esc_html_e( 'On', 'gdpr-cookie-compliance' ); ?>" data-disable="<?php esc_html_e( 'Off', 'gdpr-cookie-compliance' ); ?>"></span> |
---|
166 | </label> |
---|
167 | <?php do_action( 'gdpr_cc_moove_gdpr_infobar_visibility_settings' ); ?> |
---|
168 | </td> |
---|
169 | </tr> |
---|
170 | <tr> |
---|
171 | <th scope="row" colspan="2" style="padding-bottom: 0;"> |
---|
172 | <label for="moove_gdpr_info_bar_content"><?php esc_html_e( 'Cookie Banner Content', 'gdpr-cookie-compliance' ); ?></label> |
---|
173 | </th> |
---|
174 | </tr> |
---|
175 | <tr class="moove_gdpr_table_form_holder"> |
---|
176 | <th colspan="2" scope="row"> |
---|
177 | <?php |
---|
178 | $content = isset( $gdpr_options[ 'moove_gdpr_info_bar_content' . $wpml_lang ] ) && $gdpr_options[ 'moove_gdpr_info_bar_content' . $wpml_lang ] ? maybe_unserialize( $gdpr_options[ 'moove_gdpr_info_bar_content' . $wpml_lang ] ) : false; |
---|
179 | if ( ! $content ) : |
---|
180 | $_content = '<p>' . esc_html__( 'We are using cookies to give you the best experience on our website.', 'gdpr-cookie-compliance' ) .'</p>'; |
---|
181 | $_content .= '<p>' . sprintf( esc_html__( 'You can find out more about which cookies we are using or switch them off in [%s]settings[/%s].', 'gdpr-cookie-compliance' ), 'setting', 'setting' ) . '</p>'; |
---|
182 | $content = $_content; |
---|
183 | endif; |
---|
184 | ?> |
---|
185 | <?php |
---|
186 | $settings = array( |
---|
187 | 'media_buttons' => false, |
---|
188 | 'editor_height' => 150, |
---|
189 | 'teeny' => false, |
---|
190 | ); |
---|
191 | wp_editor( $content, 'moove_gdpr_info_bar_content', $settings ); |
---|
192 | ?> |
---|
193 | <p class="description"> |
---|
194 | <?php |
---|
195 | $content = __( 'You can use the following shortcut to link the Cookie Settings Screen:', 'gdpr-cookie-compliance' ); |
---|
196 | $content .= '<br><span><strong>[setting]</strong>'; |
---|
197 | $content .= __( 'settings', 'gdpr-cookie-compliance' ); |
---|
198 | $content .= '<strong>[/setting]</strong></span>'; |
---|
199 | apply_filters( 'gdpr_cc_keephtml', $content, true ); |
---|
200 | ?> |
---|
201 | </p> |
---|
202 | </th> |
---|
203 | </tr> |
---|
204 | |
---|
205 | <tr> |
---|
206 | <td colspan="2" style="padding: 0;"> |
---|
207 | <hr /> |
---|
208 | </td> |
---|
209 | </tr> |
---|
210 | |
---|
211 | <tr class="gdpr-sortable-buttons-wrap"> |
---|
212 | <td colspan="2"> |
---|
213 | <h4 style="margin-bottom: 0;"><?php esc_html_e( 'Button Setup', 'gdpr-cookie-compliance' ) ?></h4> |
---|
214 | <p class="description"><i><?php esc_html_e( 'You can change the order by drag & drop', 'gdpr-cookie-compliance' ) ?></i></p><br> |
---|
215 | <input type="hidden" name="gdpr_bs_buttons_order" class="gdpr-buttons-order-inpval" value='<?php echo json_encode( $buttons_order, true ); ?>'> |
---|
216 | <div class="gdpr-sortable-buttons"> |
---|
217 | <?php |
---|
218 | foreach ( $buttons_order as $button_type ) : |
---|
219 | if ( 'accept' === $button_type ) : |
---|
220 | ?> |
---|
221 | <div class="gdpr-sortable-button" data-type="accept"> |
---|
222 | <table> |
---|
223 | <tbody> |
---|
224 | <tr> |
---|
225 | <th scope="row"> |
---|
226 | <label for="moove_gdpr_accept_button_enable"><?php esc_html_e( 'Accept button', 'gdpr-cookie-compliance' ); ?></label> |
---|
227 | </th> |
---|
228 | <td> |
---|
229 | <!-- GDPR Rounded switch --> |
---|
230 | <label class="gdpr-checkbox-toggle"> |
---|
231 | <input type="checkbox" name="moove_gdpr_accept_button_enable" id="moove_gdpr_accept_button_enable" <?php echo isset( $gdpr_options['moove_gdpr_accept_button_enable'] ) ? ( intval( $gdpr_options['moove_gdpr_accept_button_enable'] ) === 1 ? 'checked' : ( ! isset( $gdpr_options['moove_gdpr_accept_button_enable'] ) ? 'checked' : '' ) ) : 'checked'; ?> > |
---|
232 | <span class="gdpr-checkbox-slider" data-enable="<?php esc_html_e( 'Enabled', 'gdpr-cookie-compliance' ); ?>" data-disable="<?php esc_html_e( 'Disabled', 'gdpr-cookie-compliance' ); ?>"></span> |
---|
233 | </label> |
---|
234 | </td> |
---|
235 | </tr> |
---|
236 | <tr> |
---|
237 | <td colspan="2"><p class="description" id="moove_gdpr_accept_button_enable-description" ><?php esc_html_e( "Accept button allows users to accept all cookies.", 'gdpr-cookie-compliance' ); ?></p> |
---|
238 | <!-- .description --></td> |
---|
239 | </tr> |
---|
240 | |
---|
241 | <tr class="gdpr-conditional-field" data-dependency="#moove_gdpr_accept_button_enable"> |
---|
242 | <th scope="row"> |
---|
243 | <label for="moove_gdpr_infobar_accept_button_label"><?php esc_html_e( 'Accept - Button Label', 'gdpr-cookie-compliance' ); ?></label> |
---|
244 | </th> |
---|
245 | <td> |
---|
246 | <input name="moove_gdpr_infobar_accept_button_label<?php echo esc_attr( $wpml_lang ); ?>" type="text" id="moove_gdpr_infobar_accept_button_label" value="<?php echo isset( $gdpr_options[ 'moove_gdpr_infobar_accept_button_label' . $wpml_lang ] ) && $gdpr_options[ 'moove_gdpr_infobar_accept_button_label' . $wpml_lang ] ? esc_attr( $gdpr_options[ 'moove_gdpr_infobar_accept_button_label' . $wpml_lang ] ) : esc_attr__( 'Accept', 'gdpr-cookie-compliance' ); ?>" class="regular-text"> |
---|
247 | </td> |
---|
248 | </tr> |
---|
249 | </tbody> |
---|
250 | </table> |
---|
251 | </div> |
---|
252 | <!-- .gdpr-sortable-button --> |
---|
253 | <?php |
---|
254 | elseif ( 'reject' === $button_type ) : |
---|
255 | ?> |
---|
256 | <div class="gdpr-sortable-button" data-type="reject"> |
---|
257 | <table> |
---|
258 | <tbody> |
---|
259 | <tr> |
---|
260 | <th scope="row"> |
---|
261 | <label for="moove_gdpr_reject_button_enable"><?php esc_html_e( 'Reject button', 'gdpr-cookie-compliance' ); ?></label> |
---|
262 | </th> |
---|
263 | <td> |
---|
264 | <!-- GDPR Rounded switch --> |
---|
265 | <label class="gdpr-checkbox-toggle"> |
---|
266 | <input type="checkbox" name="moove_gdpr_reject_button_enable" id="moove_gdpr_reject_button_enable" <?php echo isset( $gdpr_options['moove_gdpr_reject_button_enable'] ) ? ( intval( $gdpr_options['moove_gdpr_reject_button_enable'] ) === 1 ? 'checked' : ( ! isset( $gdpr_options['moove_gdpr_reject_button_enable'] ) ? 'checked' : '' ) ) : ''; ?> > |
---|
267 | <span class="gdpr-checkbox-slider" data-enable="<?php esc_html_e( 'Enabled', 'gdpr-cookie-compliance' ); ?>" data-disable="<?php esc_html_e( 'Disabled', 'gdpr-cookie-compliance' ); ?>"></span> |
---|
268 | </label> |
---|
269 | |
---|
270 | <!-- .description --> |
---|
271 | </td> |
---|
272 | </tr> |
---|
273 | |
---|
274 | <tr> |
---|
275 | <td colspan="2"><p class="description" id="moove_gdpr_reject_button_enable-description" ><?php esc_html_e( "Reject button allows users to reject all cookies.", 'gdpr-cookie-compliance' ); ?></p> |
---|
276 | <!-- .description --></td> |
---|
277 | </tr> |
---|
278 | |
---|
279 | <tr class="gdpr-conditional-field" data-dependency="#moove_gdpr_reject_button_enable"> |
---|
280 | <th scope="row"> |
---|
281 | <label for="moove_gdpr_infobar_reject_button_label"><?php esc_html_e( 'Reject - Button Label', 'gdpr-cookie-compliance' ); ?></label> |
---|
282 | </th> |
---|
283 | <td> |
---|
284 | <input name="moove_gdpr_infobar_reject_button_label<?php echo esc_attr( $wpml_lang ); ?>" type="text" id="moove_gdpr_infobar_reject_button_label" value="<?php echo isset( $gdpr_options[ 'moove_gdpr_infobar_reject_button_label' . $wpml_lang ] ) && $gdpr_options[ 'moove_gdpr_infobar_reject_button_label' . $wpml_lang ] ? esc_attr( $gdpr_options[ 'moove_gdpr_infobar_reject_button_label' . $wpml_lang ] ) : esc_attr__( 'Reject', 'gdpr-cookie-compliance' ); ?>" class="regular-text"> |
---|
285 | </td> |
---|
286 | </tr> |
---|
287 | |
---|
288 | <tr class="gdpr-conditional-field" data-dependency="#moove_gdpr_reject_button_enable"> |
---|
289 | <td colspan="2"> |
---|
290 | <hr> |
---|
291 | <h4><?php esc_html_e( 'Choose how visible the Reject button should be', 'gdpr-cookie-compliance' ); ?>:</h4> |
---|
292 | <table> |
---|
293 | <tr> |
---|
294 | <td> |
---|
295 | <fieldset class="gdpr-reject-options"> |
---|
296 | <?php |
---|
297 | $gdpr_reject_button_bhv = isset( $gdpr_options['gdpr_reject_button_bhv'] ) && intval( $gdpr_options['gdpr_reject_button_bhv'] ) ? intval( $gdpr_options['gdpr_reject_button_bhv'] ) : 1; |
---|
298 | |
---|
299 | $gdpr_reject_button_bhv_bg_colour = isset( $gdpr_options['gdpr_reject_button_bhv_bg_colour'] ) && sanitize_url( wp_unslash( $gdpr_options['gdpr_reject_button_bhv_bg_colour'] ) ) ? sanitize_url( wp_unslash( $gdpr_options['gdpr_reject_button_bhv_bg_colour'] ) ) : '#000000'; |
---|
300 | |
---|
301 | $gdpr_reject_button_bhv_txt_colour = isset( $gdpr_options['gdpr_reject_button_bhv_txt_colour'] ) && sanitize_url( wp_unslash( $gdpr_options['gdpr_reject_button_bhv_txt_colour'] ) ) ? sanitize_url( wp_unslash( $gdpr_options['gdpr_reject_button_bhv_txt_colour'] ) ) : '#d6d6d6'; |
---|
302 | ?> |
---|
303 | |
---|
304 | <label for="gdpr_reject_button_bhv_1"> |
---|
305 | <input name="gdpr_reject_button_bhv" type="radio" <?php echo $gdpr_reject_button_bhv === 1 ? 'checked' : ''; ?> id="gdpr_reject_button_bhv_1" value="1"> |
---|
306 | <?php esc_html_e( 'Same as Accept button', 'gdpr-cookie-compliance' ); ?> |
---|
307 | </label> |
---|
308 | |
---|
309 | <br /> |
---|
310 | |
---|
311 | <label for="gdpr_reject_button_bhv_2"> |
---|
312 | <input name="gdpr_reject_button_bhv" type="radio" <?php echo $gdpr_reject_button_bhv === 2 ? 'checked' : ''; ?> id="gdpr_reject_button_bhv_2" value="2"> |
---|
313 | <?php esc_html_e( 'Less visible', 'gdpr-cookie-compliance' ); ?> |
---|
314 | </label> |
---|
315 | |
---|
316 | <br /> |
---|
317 | |
---|
318 | <div class="gdpr-conditional-field-group"> |
---|
319 | <label for="gdpr_reject_button_bhv_3"> |
---|
320 | <input name="gdpr_reject_button_bhv" type="radio" <?php echo $gdpr_reject_button_bhv === 3 ? 'checked' : ''; ?> id="gdpr_reject_button_bhv_3" value="3"> |
---|
321 | <?php esc_html_e( 'Custom colour', 'gdpr-cookie-compliance' ); ?> |
---|
322 | </label> |
---|
323 | <br> |
---|
324 | <table style="display: none" class="gdpr_reject_button_bhv_tbl"> |
---|
325 | <tr> |
---|
326 | <td style="padding-left: 22px; width: 200px;"><strong><?php esc_html_e( 'Background Colour', 'gdpr-cookie-compliance' ); ?></strong></td> |
---|
327 | <td> |
---|
328 | <div class="iris-colorpicker-group-cnt"> |
---|
329 | <?php $color = $gdpr_reject_button_bhv_bg_colour; ?> |
---|
330 | <input class="iris-colorpicker regular-text" name="gdpr_reject_button_bhv_bg_colour" value="<?php echo esc_attr( $color ); ?>" style="background-color: <?php echo esc_attr( $color ); ?>" type="text"> |
---|
331 | <span class="iris-selectbtn"><?php esc_html_e( 'Select', 'gdpr-cookie-compliance' ); ?></span> |
---|
332 | </div> |
---|
333 | |
---|
334 | </td> |
---|
335 | </tr> |
---|
336 | |
---|
337 | <tr> |
---|
338 | <td style="padding-left: 22px; width: 200px;"><strong><?php esc_html_e( 'Text Colour', 'gdpr-cookie-compliance' ); ?></strong></td> |
---|
339 | <td> |
---|
340 | <div class="iris-colorpicker-group-cnt"> |
---|
341 | <?php $color = $gdpr_reject_button_bhv_txt_colour; ?> |
---|
342 | <input class="iris-colorpicker regular-text" name="gdpr_reject_button_bhv_txt_colour" value="<?php echo esc_attr( $color ); ?>" style="background-color: <?php echo esc_attr( $color ); ?>" type="text"> |
---|
343 | <span class="iris-selectbtn"><?php esc_html_e( 'Select', 'gdpr-cookie-compliance' ); ?></span> |
---|
344 | </div> |
---|
345 | |
---|
346 | </td> |
---|
347 | </tr> |
---|
348 | </table> |
---|
349 | |
---|
350 | </div> |
---|
351 | <!-- .gdpr-conditional-field-group --> |
---|
352 | |
---|
353 | <br /> |
---|
354 | |
---|
355 | </fieldset> |
---|
356 | </td> |
---|
357 | </tr> |
---|
358 | </table> |
---|
359 | </td> |
---|
360 | </tr> |
---|
361 | </tbody> |
---|
362 | </table> |
---|
363 | </div> |
---|
364 | <!-- .gdpr-sortable-button --> |
---|
365 | <?php |
---|
366 | elseif ( 'settings' === $button_type ) : |
---|
367 | ?> |
---|
368 | <div class="gdpr-sortable-button" data-type="settings"> |
---|
369 | <table> |
---|
370 | <tbody> |
---|
371 | <tr> |
---|
372 | <th scope="row"> |
---|
373 | <label for="moove_gdpr_settings_button_enable"><?php esc_html_e( 'Settings button', 'gdpr-cookie-compliance' ); ?></label> |
---|
374 | </th> |
---|
375 | <td> |
---|
376 | <!-- GDPR Rounded switch --> |
---|
377 | <label class="gdpr-checkbox-toggle"> |
---|
378 | <input type="checkbox" name="moove_gdpr_settings_button_enable" id="moove_gdpr_settings_button_enable" <?php echo isset( $gdpr_options['moove_gdpr_settings_button_enable'] ) ? ( intval( $gdpr_options['moove_gdpr_settings_button_enable'] ) === 1 ? 'checked' : ( ! isset( $gdpr_options['moove_gdpr_settings_button_enable'] ) ? 'checked' : '' ) ) : ''; ?> > |
---|
379 | <span class="gdpr-checkbox-slider" data-enable="<?php esc_html_e( 'Enabled', 'gdpr-cookie-compliance' ); ?>" data-disable="<?php esc_html_e( 'Disabled', 'gdpr-cookie-compliance' ); ?>"></span> |
---|
380 | </label> |
---|
381 | |
---|
382 | <!-- .description --> |
---|
383 | </td> |
---|
384 | </tr> |
---|
385 | <tr> |
---|
386 | <td colspan="2"><p class="description" id="moove_gdpr_settings_button_enable-description" ><?php esc_html_e( "Settings button opens up the Cookie Settings Screen.", 'gdpr-cookie-compliance' ); ?></p> |
---|
387 | <!-- .description --></td> |
---|
388 | </tr> |
---|
389 | |
---|
390 | <tr class="gdpr-conditional-field" data-dependency="#moove_gdpr_settings_button_enable"> |
---|
391 | <th scope="row"> |
---|
392 | <label for="moove_gdpr_infobar_settings_button_label"><?php esc_html_e( 'Settings - Button Label', 'gdpr-cookie-compliance' ); ?></label> |
---|
393 | </th> |
---|
394 | <td> |
---|
395 | <input name="moove_gdpr_infobar_settings_button_label<?php echo esc_attr( $wpml_lang ); ?>" type="text" id="moove_gdpr_infobar_settings_button_label" value="<?php echo isset( $gdpr_options[ 'moove_gdpr_infobar_settings_button_label' . $wpml_lang ] ) && $gdpr_options[ 'moove_gdpr_infobar_settings_button_label' . $wpml_lang ] ? esc_attr( $gdpr_options[ 'moove_gdpr_infobar_settings_button_label' . $wpml_lang ] ) : esc_attr__( 'Settings', 'gdpr-cookie-compliance' ); ?>" class="regular-text"> |
---|
396 | </td> |
---|
397 | </tr> |
---|
398 | </tbody> |
---|
399 | </table> |
---|
400 | </div> |
---|
401 | <!-- .gdpr-sortable-button --> |
---|
402 | <?php |
---|
403 | elseif ( 'close' === $button_type ) : |
---|
404 | ?> |
---|
405 | <div class="gdpr-sortable-button" data-type="close"> |
---|
406 | <table> |
---|
407 | <tbody> |
---|
408 | <tr> |
---|
409 | <th scope="row"> |
---|
410 | <label for="moove_gdpr_close_button_enable"><?php esc_html_e( 'Close button', 'gdpr-cookie-compliance' ); ?></label> |
---|
411 | </th> |
---|
412 | <td> |
---|
413 | <!-- GDPR Rounded switch --> |
---|
414 | <label class="gdpr-checkbox-toggle"> |
---|
415 | <input type="checkbox" name="moove_gdpr_close_button_enable" id="moove_gdpr_close_button_enable" <?php echo isset( $gdpr_options['moove_gdpr_close_button_enable'] ) ? ( intval( $gdpr_options['moove_gdpr_close_button_enable'] ) === 1 ? 'checked' : ( ! isset( $gdpr_options['moove_gdpr_close_button_enable'] ) ? 'checked' : '' ) ) : ''; ?> > |
---|
416 | <span class="gdpr-checkbox-slider" data-enable="<?php esc_html_e( 'Enabled', 'gdpr-cookie-compliance' ); ?>" data-disable="<?php esc_html_e( 'Disabled', 'gdpr-cookie-compliance' ); ?>"></span> |
---|
417 | </label> |
---|
418 | |
---|
419 | </td> |
---|
420 | </tr> |
---|
421 | <tr class="gdpr-conditional-field" data-dependency="#moove_gdpr_close_button_enable"> |
---|
422 | <td colspan="2"> |
---|
423 | <hr> |
---|
424 | <h4><?php esc_html_e( 'Choose how the Close button should behave', 'gdpr-cookie-compliance' ); ?>:</h4> |
---|
425 | <table> |
---|
426 | <tr> |
---|
427 | <td> |
---|
428 | <fieldset class="gdpr-close-options"> |
---|
429 | <?php |
---|
430 | $gdpr_close_button_bhv = isset( $gdpr_options['gdpr_close_button_bhv'] ) && intval( $gdpr_options['gdpr_close_button_bhv'] ) ? intval( $gdpr_options['gdpr_close_button_bhv'] ) : 1; |
---|
431 | |
---|
432 | $gdpr_close_button_bhv_redirect = isset( $gdpr_options['gdpr_close_button_bhv_redirect'] ) && sanitize_url( wp_unslash( $gdpr_options['gdpr_close_button_bhv_redirect'] ) ) ? sanitize_url( wp_unslash( $gdpr_options['gdpr_close_button_bhv_redirect'] ) ) : ''; |
---|
433 | ?> |
---|
434 | |
---|
435 | <label for="gdpr_close_button_bhv_1"> |
---|
436 | <input name="gdpr_close_button_bhv" type="radio" <?php echo $gdpr_close_button_bhv === 1 ? 'checked' : ''; ?> id="gdpr_close_button_bhv_1" value="1"> |
---|
437 | <?php esc_html_e( 'as a Close button', 'gdpr-cookie-compliance' ); ?> |
---|
438 | <span class="gdpr_cb_bhv_desc"><?php esc_html_e( '(The Cookie Banner becomes hidden for the duration of the current browsing session, without accepting or rejecting cookies. The Cookie Banner will re-appear when the user next visits your site.)', 'gdpr-cookie-compliance' ); ?></span> |
---|
439 | </label> |
---|
440 | |
---|
441 | <br /><br /> |
---|
442 | |
---|
443 | <label for="gdpr_close_button_bhv_2"> |
---|
444 | <input name="gdpr_close_button_bhv" type="radio" <?php echo $gdpr_close_button_bhv === 2 ? 'checked' : ''; ?> id="gdpr_close_button_bhv_2" value="2"> |
---|
445 | <?php esc_html_e( 'as a Reject button', 'gdpr-cookie-compliance' ); ?> |
---|
446 | <span class="gdpr_cb_bhv_desc"><?php esc_html_e( '(The cookies are rejected and the cookie banner does not re-appear until the cookie consent expires.)', 'gdpr-cookie-compliance' ); ?></span> |
---|
447 | </label> |
---|
448 | |
---|
449 | <br /><br /> |
---|
450 | |
---|
451 | <label for="gdpr_close_button_bhv_3"> |
---|
452 | <input name="gdpr_close_button_bhv" type="radio" <?php echo $gdpr_close_button_bhv === 3 ? 'checked' : ''; ?> id="gdpr_close_button_bhv_3" value="3"> |
---|
453 | <?php esc_html_e( 'as an Accept button', 'gdpr-cookie-compliance' ); ?> |
---|
454 | <span class="gdpr_cb_bhv_desc"><?php esc_html_e( '(The cookies are accepted and the cookie banner does not re-appear until the cookie consent expires.)', 'gdpr-cookie-compliance' ); ?></span> |
---|
455 | </label> |
---|
456 | |
---|
457 | <br /><br /> |
---|
458 | |
---|
459 | <div class="gdpr-conditional-field-group"> |
---|
460 | <label for="gdpr_close_button_bhv_4"> |
---|
461 | <input name="gdpr_close_button_bhv" type="radio" <?php echo $gdpr_close_button_bhv === 4 ? 'checked' : ''; ?> id="gdpr_close_button_bhv_4" value="4"> |
---|
462 | <?php esc_html_e( 'as a Redirect', 'gdpr-cookie-compliance' ); ?> |
---|
463 | <span class="gdpr_cb_bhv_desc"><?php esc_html_e( '(The cookies are rejected and the user will be redirected to the specified URL.)', 'gdpr-cookie-compliance' ); ?></span> |
---|
464 | </label> |
---|
465 | <br> |
---|
466 | <input type="text" name="gdpr_close_button_bhv_redirect" id="gdpr_close_button_bhv_redirect" style="display: none;" class="regular-text" placeholder="<?php esc_html_e('Redirect location', 'gdpr-cookie-compliance') ?>" value="<?php echo esc_url( $gdpr_close_button_bhv_redirect ); ?>"> |
---|
467 | </div> |
---|
468 | <!-- .gdpr-conditional-field-group --> |
---|
469 | |
---|
470 | <br /> |
---|
471 | |
---|
472 | </fieldset> |
---|
473 | </td> |
---|
474 | </tr> |
---|
475 | </table> |
---|
476 | </td> |
---|
477 | </tr> |
---|
478 | </tbody> |
---|
479 | </table> |
---|
480 | </div> |
---|
481 | <?php |
---|
482 | endif; |
---|
483 | endforeach; |
---|
484 | ?> |
---|
485 | </td> |
---|
486 | </tr> |
---|
487 | <!-- .gdpr-sortable-buttons --> |
---|
488 | |
---|
489 | <tr> |
---|
490 | <th scope="row"> |
---|
491 | <label for="moove_gdpr_infobar_position"><?php esc_html_e( 'Cookie Banner position', 'gdpr-cookie-compliance' ); ?></label> |
---|
492 | </th> |
---|
493 | <td> |
---|
494 | <input name="moove_gdpr_infobar_position" type="radio" value="top" id="moove_gdpr_infobar_position_top" <?php echo isset( $gdpr_options['moove_gdpr_infobar_position'] ) ? ( 'top' === $gdpr_options['moove_gdpr_infobar_position'] ? 'checked' : '' ) : ''; ?> class="on-top"> <label for="moove_gdpr_infobar_position_top"><?php esc_html_e( 'Top', 'gdpr-cookie-compliance' ); ?></label> |
---|
495 | <span class="separator"></span> |
---|
496 | |
---|
497 | <input name="moove_gdpr_infobar_position" type="radio" value="bottom" id="moove_gdpr_infobar_position_bottom" <?php echo isset( $gdpr_options['moove_gdpr_infobar_position'] ) ? ( 'bottom' === $gdpr_options['moove_gdpr_infobar_position'] ? 'checked' : '' ) : 'checked'; ?> class="on-off"> <label for="moove_gdpr_infobar_position_bottom"><?php esc_html_e( 'Bottom', 'gdpr-cookie-compliance' ); ?></label> |
---|
498 | |
---|
499 | <span class="separator"></span> |
---|
500 | |
---|
501 | <input name="moove_gdpr_infobar_position" type="radio" value="bottom_left" id="moove_gdpr_infobar_position_bottom_left" <?php echo isset( $gdpr_options['moove_gdpr_infobar_position'] ) ? ( 'bottom_left' === $gdpr_options['moove_gdpr_infobar_position'] ? 'checked' : '' ) : ''; ?> class="on-off"> <label for="moove_gdpr_infobar_position_bottom_left"><?php esc_html_e( 'Bottom Left', 'gdpr-cookie-compliance' ); ?></label> |
---|
502 | |
---|
503 | <span class="separator"></span> |
---|
504 | |
---|
505 | <input name="moove_gdpr_infobar_position" type="radio" value="bottom_right" id="moove_gdpr_infobar_position_bottom_right" <?php echo isset( $gdpr_options['moove_gdpr_infobar_position'] ) ? ( 'bottom_right' === $gdpr_options['moove_gdpr_infobar_position'] ? 'checked' : '' ) : ''; ?> class="on-off"> <label for="moove_gdpr_infobar_position_bottom_right"><?php esc_html_e( 'Bottom Right', 'gdpr-cookie-compliance' ); ?></label> |
---|
506 | |
---|
507 | <?php do_action( 'gdpr_cc_moove_gdpr_infobar_position_settings' ); ?> |
---|
508 | </td> |
---|
509 | </tr> |
---|
510 | <tr> |
---|
511 | <td colspan="2" style="padding: 0;"> |
---|
512 | <hr /> |
---|
513 | </td> |
---|
514 | </tr> |
---|
515 | |
---|
516 | <tr> |
---|
517 | <th scope="row"> |
---|
518 | <label for="moove_gdpr_colour_scheme"><?php esc_html_e( 'Colour scheme', 'gdpr-cookie-compliance' ); ?></label> |
---|
519 | </th> |
---|
520 | <td> |
---|
521 | <label class="gdpr-checkbox-toggle gdpr-color-scheme-toggle"> |
---|
522 | <input type="checkbox" name="moove_gdpr_colour_scheme" <?php echo isset( $gdpr_options['moove_gdpr_colour_scheme'] ) ? ( 1 === intval( $gdpr_options['moove_gdpr_colour_scheme'] ) ? 'checked' : ( ! isset( $gdpr_options['moove_gdpr_colour_scheme'] ) ? 'checked' : '' ) ) : 'checked'; ?> > |
---|
523 | <span class="gdpr-checkbox-slider" data-enable="<?php esc_html_e( 'Dark', 'gdpr-cookie-compliance' ); ?>" data-disable="<?php esc_html_e( 'Light', 'gdpr-cookie-compliance' ); ?>"></span> |
---|
524 | </label> |
---|
525 | </td> |
---|
526 | </tr> |
---|
527 | |
---|
528 | <tr> |
---|
529 | <td colspan="2" style="padding: 0;"> |
---|
530 | <hr /> |
---|
531 | </td> |
---|
532 | </tr> |
---|
533 | |
---|
534 | <tr> |
---|
535 | <th scope="row"> |
---|
536 | <label for="gdpr_accesibility"><?php esc_html_e( 'Accessibility', 'gdpr-cookie-compliance' ); ?></label> |
---|
537 | </th> |
---|
538 | <td> |
---|
539 | <label class="gdpr-checkbox-toggle gdpr-color-scheme-toggle"> |
---|
540 | <input type="checkbox" name="gdpr_accesibility" <?php echo isset( $gdpr_options['gdpr_accesibility'] ) ? ( 1 === intval( $gdpr_options['gdpr_accesibility'] ) ? 'checked' : ( ! isset( $gdpr_options['gdpr_accesibility'] ) ? '' : '' ) ) : ''; ?> > |
---|
541 | <span class="gdpr-checkbox-slider" data-enable="<?php esc_html_e( 'Cookie Banner', 'gdpr-cookie-compliance' ); ?>" data-disable="<?php esc_html_e( 'Content', 'gdpr-cookie-compliance' ); ?>"></span> |
---|
542 | </label> |
---|
543 | <p class="description"> |
---|
544 | <?php |
---|
545 | $content = __( 'Choose the right accessibility experience for your users. You can decide wether pressing tab key on your keyboard should first focus on the Cookie Banner or on your website\'s content.', 'gdpr-cookie-compliance' ); |
---|
546 | �� apply_filters( 'gdpr_cc_keephtml', $content, true ); |
---|
547 | ?> |
---|
548 | </p> |
---|
549 | </td> |
---|
550 | </tr> |
---|
551 | |
---|
552 | <tr> |
---|
553 | <th scope="row"> |
---|
554 | <label for="gdpr_initialization_delay"><?php esc_html_e( 'Banner initialization delay', 'gdpr-cookie-compliance' ); ?></label> |
---|
555 | </th> |
---|
556 | <td> |
---|
557 | <span style="white-space: nowrap;"> |
---|
558 | <input type="number" value="<?php echo $initalization_delay; ?>" min="0" step="1" name="gdpr_initialization_delay" id="gdpr_initialization_delay" style="width: 100px;"> |
---|
559 | milliseconds |
---|
560 | </span> |
---|
561 | |
---|
562 | <p class="description"> |
---|
563 | <?php |
---|
564 | $content = __( 'This feature can be used to improve Largest Contentful Paint (LCP) metric in PageSpeed Insights.', 'gdpr-cookie-compliance' ); |
---|
565 | $content .= '<br />'; |
---|
566 | $content .= __( 'Set 0 for the Cookie Banner to appear with no delay.', 'gdpr-cookie-compliance' ); |
---|
567 | apply_filters( 'gdpr_cc_keephtml', $content, true ); |
---|
568 | ?> |
---|
569 | </p> |
---|
570 | </td> |
---|
571 | </tr> |
---|
572 | |
---|
573 | <?php do_action( 'gdpr_cc_infobar_settings' ); ?> |
---|
574 | |
---|
575 | </tbody> |
---|
576 | </table> |
---|
577 | |
---|
578 | <hr /> |
---|
579 | <br /> |
---|
580 | <button type="submit" class="button button-primary"><?php esc_html_e( 'Save changes', 'gdpr-cookie-compliance' ); ?></button> |
---|
581 | <?php do_action( 'gdpr_cc_banner_buttons_settings' ); ?> |
---|
582 | </form> |
---|