Cookie Consent - Version 2.0.6

Version Description

  • Added: flat button option
  • Added: Russian translation
Download this release

Release Info

Developer Catapult_Themes
Plugin Icon 128x128 Cookie Consent
Version 2.0.6
Comparing to
See all releases

Code changes from version 2.0.5 to 2.0.6

admin/class-ctcc-admin.php CHANGED
@@ -1,678 +1,694 @@
1
- <?php
2
- /*
3
- * Cookie Consent admin class
4
- */
5
-
6
- // Exit if accessed directly
7
- if ( ! defined( 'ABSPATH' ) ) {
8
- exit;
9
- }
10
-
11
- /**
12
- * Plugin admin class
13
- **/
14
- if ( ! class_exists ( 'CTCC_Admin' ) ) {
15
-
16
- class CTCC_Admin {
17
-
18
- public function __construct() {
19
- //
20
- }
21
-
22
- /*
23
- * Initialize the class and start calling our hooks and filters
24
- * @since 2.0.0
25
- */
26
- public function init() {
27
-
28
- add_action ( 'admin_menu', array ( $this, 'add_admin_menu' ) );
29
- add_action ( 'admin_init', array ( $this, 'register_options_init' ) );
30
- add_action ( 'admin_init', array ( $this, 'register_content_init' ) );
31
- add_action ( 'admin_init', array ( $this, 'register_styles_init' ) );
32
-
33
- add_action ( 'admin_enqueue_scripts', array ( $this, 'enqueue_scripts' ) );
34
- add_action ( 'admin_footer', array ( $this, 'add_js' ) );
35
-
36
- }
37
-
38
- public function enqueue_scripts() {
39
- wp_enqueue_style ( 'wp-color-picker' );
40
- wp_enqueue_script ( 'wp-color-picker' );
41
- wp_enqueue_style ( 'ctcc-admin-style', CTCC_PLUGIN_URL . 'assets/css/admin-style.css' );
42
- }
43
-
44
- public function add_js() {
45
- ?>
46
- <script>
47
- jQuery(document).ready(function($){
48
- $('.cctc-color-field').wpColorPicker();
49
- });
50
- </script>
51
- <?php
52
- }
53
-
54
- // Add the menu item
55
- public function add_admin_menu( ) {
56
- add_options_page ( __('Cookie Consent', 'uk-cookie-consent'), __('Cookie Consent', 'uk-cookie-consent'), 'manage_options', 'ctcc', array ( $this, 'options_page' ) );
57
- }
58
-
59
- public function register_options_init( ) {
60
-
61
- register_setting ( 'ctcc_options', 'ctcc_options_settings' );
62
-
63
- add_settings_section (
64
- 'ctcc_options_section',
65
- __( 'General settings', 'uk-cookie-consent' ),
66
- array ( $this, 'settings_section_callback' ),
67
- 'ctcc_options'
68
- );
69
-
70
- add_settings_field (
71
- 'closure',
72
- __( 'Close', 'uk-cookie-consent' ),
73
- array ( $this, 'closure_render' ),
74
- 'ctcc_options',
75
- 'ctcc_options_section'
76
- );
77
-
78
- add_settings_field (
79
- 'first_page',
80
- __( 'First Page Only', 'uk-cookie-consent' ),
81
- array ( $this, 'first_page_render' ),
82
- 'ctcc_options',
83
- 'ctcc_options_section'
84
- );
85
-
86
- add_settings_field (
87
- 'duration',
88
- __( 'Notification Duration', 'uk-cookie-consent' ),
89
- array ( $this, 'duration_render' ),
90
- 'ctcc_options',
91
- 'ctcc_options_section'
92
- );
93
-
94
- add_settings_field (
95
- 'cookie_expiry',
96
- __( 'Cookie Expiry', 'uk-cookie-consent' ),
97
- array ( $this, 'cookie_expiry_render' ),
98
- 'ctcc_options',
99
- 'ctcc_options_section'
100
- );
101
-
102
- add_settings_field (
103
- 'cookie_version',
104
- __( 'Cookie Version', 'uk-cookie-consent' ),
105
- array ( $this, 'cookie_version_render' ),
106
- 'ctcc_options',
107
- 'ctcc_options_section'
108
- );
109
-
110
- // Set default options
111
- $options = get_option ( 'ctcc_options_settings' );
112
- if ( false === $options ) {
113
- // Get defaults
114
- $defaults = $this -> get_default_options_settings();
115
- update_option ( 'ctcc_options_settings', $defaults );
116
- }
117
-
118
- }
119
-
120
- public function register_content_init() {
121
-
122
- register_setting ( 'ctcc_content', 'ctcc_content_settings' );
123
-
124
- add_settings_section (
125
- 'ctcc_content_section',
126
- __( 'Content settings', 'uk-cookie-consent' ),
127
- array ( $this, 'content_settings_section_callback' ),
128
- 'ctcc_content'
129
- );
130
-
131
- add_settings_field (
132
- 'heading_text',
133
- __( 'Heading Text', 'uk-cookie-consent' ),
134
- array ( $this, 'heading_text_render' ),
135
- 'ctcc_content',
136
- 'ctcc_content_section'
137
- );
138
-
139
- add_settings_field (
140
- 'notification_text',
141
- __( 'Notification Text', 'uk-cookie-consent' ),
142
- array ( $this, 'notification_text_render' ),
143
- 'ctcc_content',
144
- 'ctcc_content_section'
145
- );
146
-
147
- add_settings_field (
148
- 'more_info_text',
149
- __( 'More Info Text', 'uk-cookie-consent' ),
150
- array ( $this, 'more_info_text_render' ),
151
- 'ctcc_content',
152
- 'ctcc_content_section'
153
- );
154
-
155
- add_settings_field (
156
- 'more_info_page',
157
- __( 'More Info Page', 'uk-cookie-consent' ),
158
- array ( $this, 'more_info_page_render' ),
159
- 'ctcc_content',
160
- 'ctcc_content_section'
161
- );
162
-
163
- add_settings_field (
164
- 'more_info_url',
165
- __( 'More Info URL', 'uk-cookie-consent' ),
166
- array ( $this, 'more_info_url_render' ),
167
- 'ctcc_content',
168
- 'ctcc_content_section'
169
- );
170
-
171
- add_settings_field (
172
- 'more_info_target',
173
- __( 'More Info Target', 'uk-cookie-consent' ),
174
- array ( $this, 'more_info_target_render' ),
175
- 'ctcc_content',
176
- 'ctcc_content_section'
177
- );
178
-
179
- add_settings_field (
180
- 'accept_text',
181
- __( 'Accept Text', 'uk-cookie-consent' ),
182
- array ( $this, 'accept_text_render' ),
183
- 'ctcc_content',
184
- 'ctcc_content_section'
185
- );
186
-
187
- // Set default options
188
- $options = get_option ( 'ctcc_content_settings' );
189
- if ( false === $options ) {
190
- // Get defaults
191
- $defaults = $this -> get_default_content_settings();
192
- update_option ( 'ctcc_content_settings', $defaults );
193
- }
194
-
195
- }
196
-
197
- public function register_styles_init( ) {
198
-
199
- register_setting ( 'ctcc_styles', 'ctcc_styles_settings' );
200
-
201
- add_settings_section (
202
- 'ctcc_styles_section',
203
- __( 'Styles settings', 'uk-cookie-consent' ),
204
- array ( $this, 'styles_settings_section_callback' ),
205
- 'ctcc_styles'
206
- );
207
-
208
- add_settings_field (
209
- 'position',
210
- __( 'Position', 'uk-cookie-consent' ),
211
- array ( $this, 'position_render' ),
212
- 'ctcc_styles',
213
- 'ctcc_styles_section'
214
- );
215
-
216
- add_settings_field (
217
- 'container_class',
218
- __( 'Container Class', 'uk-cookie-consent' ),
219
- array ( $this, 'container_class_render' ),
220
- 'ctcc_styles',
221
- 'ctcc_styles_section'
222
- );
223
-
224
- add_settings_field (
225
- 'enqueue_styles',
226
- __( 'Include Stylesheet', 'uk-cookie-consent' ),
227
- array ( $this, 'enqueue_styles_render' ),
228
- 'ctcc_styles',
229
- 'ctcc_styles_section'
230
- );
231
-
232
- add_settings_field (
233
- 'rounded_corners',
234
- __( 'Rounded Corners', 'uk-cookie-consent' ),
235
- array ( $this, 'rounded_corners_render' ),
236
- 'ctcc_styles',
237
- 'ctcc_styles_section'
238
- );
239
-
240
- add_settings_field (
241
- 'drop_shadow',
242
- __( 'Drop Shadow', 'uk-cookie-consent' ),
243
- array ( $this, 'drop_shadow_render' ),
244
- 'ctcc_styles',
245
- 'ctcc_styles_section'
246
- );
247
-
248
- add_settings_field (
249
- 'display_accept_with_text',
250
- __( 'Display Button With Text', 'uk-cookie-consent' ),
251
- array ( $this, 'display_accept_with_text_render' ),
252
- 'ctcc_styles',
253
- 'ctcc_styles_section'
254
- );
255
-
256
- add_settings_field (
257
- 'x_close',
258
- __( 'Use X Close', 'uk-cookie-consent' ),
259
- array ( $this, 'x_close_render' ),
260
- 'ctcc_styles',
261
- 'ctcc_styles_section'
262
- );
263
-
264
- add_settings_field (
265
- 'text_color',
266
- __( 'Text Color', 'uk-cookie-consent' ),
267
- array ( $this, 'text_color_render' ),
268
- 'ctcc_styles',
269
- 'ctcc_styles_section'
270
- );
271
-
272
- add_settings_field (
273
- 'bg_color',
274
- __( 'Background Color', 'uk-cookie-consent' ),
275
- array ( $this, 'bg_color_render' ),
276
- 'ctcc_styles',
277
- 'ctcc_styles_section'
278
- );
279
-
280
- add_settings_field (
281
- 'link_color',
282
- __( 'Link Color', 'uk-cookie-consent' ),
283
- array ( $this, 'link_color_render' ),
284
- 'ctcc_styles',
285
- 'ctcc_styles_section'
286
- );
287
-
288
- add_settings_field (
289
- 'button_color',
290
- __( 'Button Color', 'uk-cookie-consent' ),
291
- array ( $this, 'button_color_render' ),
292
- 'ctcc_styles',
293
- 'ctcc_styles_section'
294
- );
295
-
296
- add_settings_field (
297
- 'button_bg_color',
298
- __( 'Button Background', 'uk-cookie-consent' ),
299
- array ( $this, 'button_bg_color_render' ),
300
- 'ctcc_styles',
301
- 'ctcc_styles_section'
302
- );
303
-
304
- add_settings_field (
305
- 'bg_color',
306
- __( 'Background Color', 'uk-cookie-consent' ),
307
- array ( $this, 'bg_color_render' ),
308
- 'ctcc_styles',
309
- 'ctcc_styles_section'
310
- );
311
-
312
- // Set default options
313
- $options = get_option ( 'ctcc_styles_settings' );
314
- if ( false === $options ) {
315
- // Get defaults
316
- $defaults = $this -> get_default_styles_settings();
317
- update_option ( 'ctcc_styles_settings', $defaults );
318
- }
319
-
320
- }
321
-
322
- public function get_default_options_settings() {
323
- $defaults = array (
324
- 'closure' => 'click',
325
- 'first_page' => 0,
326
- 'duration' => 60,
327
- 'cookie_expiry' => 30,
328
- 'cookie_version' => 1
329
- );
330
- return $defaults;
331
- }
332
-
333
- public function get_default_content_settings() {
334
-
335
- $previous_settings = get_option ( 'catapult_cookie_options' );
336
- // Check for settings from previous version
337
- if ( ! empty ( $previous_settings ) ) {
338
- $defaults = array (
339
- 'heading_text' => __( 'Cookies', 'uk-cookie-consent' ),
340
- 'notification_text' => $previous_settings['catapult_cookie_text_settings'],
341
- 'accept_text' => $previous_settings['catapult_cookie_accept_settings'],
342
- 'more_info_text' => $previous_settings['catapult_cookie_more_settings'],
343
- 'more_info_page' => '',
344
- 'more_info_url' => site_url ( $previous_settings['catapult_cookie_link_settings'] ),
345
- 'more_info_target' => '_blank',
346
- );
347
- } else {
348
- $defaults = array (
349
- 'heading_text' => __( 'Cookies', 'uk-cookie-consent' ),
350
- 'notification_text' => __( 'This site uses cookies: ', 'uk-cookie-consent' ),
351
- 'accept_text' => __( 'Okay, thanks', 'uk-cookie-consent' ),
352
- 'more_info_text' => __( 'Find out more.', 'uk-cookie-consent' ),
353
- 'more_info_page' => get_option( 'ctcc_more_info_page', '' ),
354
- 'more_info_url' => '',
355
- 'more_info_target' => '_blank',
356
- );
357
- }
358
- return $defaults;
359
-
360
- }
361
-
362
- public function get_default_styles_settings() {
363
- $previous_settings = get_option ( 'catapult_cookie_options' );
364
- $defaults = array (
365
- 'position' => 'top-bar',
366
- 'container_class' => '',
367
- 'enqueue_styles' => 1,
368
- 'rounded_corners' => 1,
369
- 'drop_shadow' => 1,
370
- 'display_accept_with_text' => 1,
371
- 'x_close' => 0,
372
- 'text_color' => '#ddd',
373
- 'bg_color' => '#464646',
374
- 'link_color' => '#fff',
375
- 'button_color' => '',
376
- 'button_bg_color' => '',
377
- );
378
- // Check for settings from previous version
379
-
380
- if ( ! empty ( $previous_settings['catapult_cookie_bar_position_settings'] ) ) {
381
- $defaults['position'] = $previous_settings['catapult_cookie_bar_position_settings'] . '-bar';
382
- }
383
-
384
- if ( ! empty ( $previous_settings['catapult_cookie_text_colour_settings'] ) ) {
385
- $defaults['text_color'] = $previous_settings['catapult_cookie_text_colour_settings'];
386
- }
387
-
388
- if ( ! empty ( $previous_settings['catapult_cookie_bg_colour_settings'] ) ) {
389
- $defaults['bg_color'] = $previous_settings['catapult_cookie_bg_colour_settings'];
390
- }
391
-
392
- if ( ! empty ( $previous_settings['catapult_cookie_link_colour_settings'] ) ) {
393
- $defaults['link_color'] = $previous_settings['catapult_cookie_link_colour_settings'];
394
- }
395
-
396
- if ( ! empty ( $previous_settings['catapult_cookie_link_colour_settings'] ) ) {
397
- $defaults['link_color'] = $previous_settings['catapult_cookie_link_colour_settings'];
398
- }
399
-
400
- if ( ! empty ( $previous_settings['catapult_cookie_button_colour_settings'] ) ) {
401
- $defaults['button_bg_color'] = $previous_settings['catapult_cookie_button_colour_settings'];
402
- }
403
-
404
- return $defaults;
405
-
406
- }
407
-
408
- public function closure_render() {
409
- $options = get_option( 'ctcc_options_settings' ); ?>
410
- <select name='ctcc_options_settings[closure]'>
411
- <option value='click' <?php selected( $options['closure'], 'click' ); ?>><?php _e ( 'On Click', 'uk-cookie-consent' ); ?></option>
412
- <option value='timed' <?php selected( $options['closure'], 'timed' ); ?>><?php _e ( 'Timed', 'uk-cookie-consent' ); ?></option>
413
- </select>
414
- <p class="description"><?php _e ( 'How you want the user to close the notification', 'uk-cookie-consent' ); ?></p>
415
- <?php
416
- }
417
-
418
- public function first_page_render() {
419
- $options = get_option( 'ctcc_options_settings' ); ?>
420
- <input type='checkbox' name='ctcc_options_settings[first_page]' <?php checked ( ! empty ( $options['first_page'] ), 1 ); ?> value='1'>
421
- <p class="description"><?php _e ( 'Select this to show the notification only on the first page the user visits', 'uk-cookie-consent' ); ?></p>
422
- <?php
423
- }
424
-
425
- public function duration_render() {
426
- $options = get_option( 'ctcc_options_settings' ); ?>
427
- <input type="number" min="1" name="ctcc_options_settings[duration]" value="<?php echo $options['duration']; ?>">
428
- <p class="description"><?php _e ( 'If you chose Timer as the close method, enter how many seconds the notification should display for', 'uk-cookie-consent' ); ?></p>
429
- <?php
430
- }
431
-
432
- public function cookie_expiry_render() {
433
- $options = get_option( 'ctcc_options_settings' ); ?>
434
- <input type="number" min="1" name="ctcc_options_settings[cookie_expiry]" value="<?php echo $options['cookie_expiry']; ?>">
435
- <p class="description"><?php _e ( 'The number of days that the cookie is set for', 'uk-cookie-consent' ); ?></p>
436
- <?php
437
- }
438
-
439
- public function cookie_version_render() {
440
- $options = get_option( 'ctcc_options_settings' ); ?>
441
- <input type="text" name="ctcc_options_settings[cookie_version]" value="<?php echo $options['cookie_version']; ?>">
442
- <p class="description"><?php _e ( 'A version number for the cookie - update this to invalidate the cookie and force all users to view the notification again', 'uk-cookie-consent' ); ?></p>
443
- <?php
444
- }
445
-
446
- /*
447
- * Content renders
448
- */
449
-
450
- public function heading_text_render() {
451
- $ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
452
- <input type="text" name="ctcc_content_settings[heading_text]" value="<?php echo $ctcc_content_settings['heading_text']; ?>">
453
- <p class="description"><?php _e ( 'The heading text - only applies if you are not using a top or bottom bar', 'uk-cookie-consent' ); ?></p>
454
- <?php
455
- }
456
-
457
- public function notification_text_render() {
458
- $ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
459
- <input type="text" name="ctcc_content_settings[notification_text]" value="<?php echo $ctcc_content_settings['notification_text']; ?>">
460
- <p class="description"><?php _e ( 'The default text to indicate that your site uses cookies', 'uk-cookie-consent' ); ?></p>
461
- <?php
462
- }
463
-
464
- public function accept_text_render() {
465
- $ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
466
- <input type="text" name="ctcc_content_settings[accept_text]" value="<?php echo $ctcc_content_settings['accept_text']; ?>">
467
- <p class="description"><?php _e ( 'The default text to dismiss the notification', 'uk-cookie-consent' ); ?></p>
468
- <?php
469
- }
470
-
471
- public function more_info_text_render() {
472
- $ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
473
- <input type="text" name="ctcc_content_settings[more_info_text]" value="<?php echo $ctcc_content_settings['more_info_text']; ?>">
474
- <p class="description"><?php _e ( 'The default text to use to link to a page providing further information', 'uk-cookie-consent' ); ?></p>
475
- <?php
476
- }
477
-
478
- public function more_info_page_render() {
479
- $ctcc_content_settings = get_option( 'ctcc_content_settings' );
480
- // Get all pages
481
- $pages = get_pages();
482
- ?>
483
- <?php if ( $pages ) { ?>
484
- <select name='ctcc_content_settings[more_info_page]'>
485
- <option></option>
486
- <?php foreach ( $pages as $page ) { ?>
487
- <option value='<?php echo $page -> ID; ?>' <?php selected( $ctcc_content_settings['more_info_page'], $page -> ID ); ?>><?php echo $page -> post_title; ?></option>
488
- <?php } ?>
489
- </select>
490
- <p class="description"><?php _e ( 'The page containing further information about your cookie policy', 'discussion-board' ); ?></p>
491
- <?php }
492
- }
493
-
494
- public function more_info_url_render() {
495
- $ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
496
- <input type="url" name="ctcc_content_settings[more_info_url]" value="<?php echo $ctcc_content_settings['more_info_url']; ?>">
497
- <p class="description"><?php _e ( 'You can add an absolute URL here to override the More Info Page setting above. Use this to link to an external website for further information about cookies.', 'uk-cookie-consent' ); ?></p>
498
- <?php
499
- }
500
-
501
- public function more_info_target_render() {
502
- $ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
503
- <select name='ctcc_content_settings[more_info_target]'>
504
- <option value='_blank' <?php selected( $ctcc_content_settings['more_info_target'], '_blank' ); ?>><?php _e ( 'New Tab', 'uk-cookie-consent' ); ?></option>
505
- <option value='_self' <?php selected( $ctcc_content_settings['more_info_target'], '_self' ); ?>><?php _e ( 'Same Tab', 'uk-cookie-consent' ); ?></option>
506
- </select>
507
- <p class="description"><?php _e ( 'Open the More Information page in the same or new tab.', 'uk-cookie-consent' ); ?></p>
508
- <?php
509
- }
510
-
511
- /*
512
- * Styles functions
513
- */
514
-
515
- public function position_render() {
516
- $options = get_option( 'ctcc_styles_settings' ); ?>
517
- <select name='ctcc_styles_settings[position]'>
518
- <option value='top-bar' <?php selected( $options['position'], 'top-bar' ); ?>><?php _e ( 'Top Bar', 'uk-cookie-consent' ); ?></option>
519
- <option value='bottom-bar' <?php selected( $options['position'], 'bottom-bar' ); ?>><?php _e ( 'Bottom Bar', 'uk-cookie-consent' ); ?></option>
520
- <option value='top-left-block' <?php selected( $options['position'], 'top-left-block' ); ?>><?php _e ( 'Top Left Block', 'uk-cookie-consent' ); ?></option>
521
- <option value='top-right-block' <?php selected( $options['position'], 'top-right-block' ); ?>><?php _e ( 'Top Right Block', 'uk-cookie-consent' ); ?></option>
522
- <option value='bottom-left-block' <?php selected( $options['position'], 'bottom-left-block' ); ?>><?php _e ( 'Bottom Left Block', 'uk-cookie-consent' ); ?></option>
523
- <option value='bottom-right-block' <?php selected( $options['position'], 'bottom-right-block' ); ?>><?php _e ( 'Bottom Right Block', 'uk-cookie-consent' ); ?></option>
524
- </select>
525
- <p class="description"><?php _e ( 'Where the notification should appear', 'uk-cookie-consent' ); ?></p>
526
- <?php
527
- }
528
-
529
- public function container_class_render() {
530
- $options = get_option( 'ctcc_styles_settings' ); ?>
531
- <input type="text" name="ctcc_styles_settings[container_class]" value="<?php echo $options['container_class']; ?>">
532
- <p class="description"><?php _e ( 'You can add an optional wrapper class, eg container, here to align the notification text with the rest of your content', 'uk-cookie-consent' ); ?></p>
533
- <?php
534
- }
535
-
536
- public function enqueue_styles_render() {
537
- $options = get_option( 'ctcc_styles_settings' ); ?>
538
- <input type='checkbox' name='ctcc_styles_settings[enqueue_styles]' <?php checked ( ! empty ( $options['enqueue_styles'] ), 1 ); ?> value='1'>
539
- <p class="description"><?php _e ( 'Deselect this to dequeue the plugin stylesheet', 'uk-cookie-consent' ); ?></p>
540
- <?php
541
- }
542
-
543
- public function rounded_corners_render() {
544
- $options = get_option( 'ctcc_styles_settings' ); ?>
545
- <input type='checkbox' name='ctcc_styles_settings[rounded_corners]' <?php checked ( ! empty ( $options['rounded_corners'] ), 1 ); ?> value='1'>
546
- <p class="description"><?php _e ( 'Round the corners on the block (doesn\'t apply to the top or bottom bar)', 'uk-cookie-consent' ); ?></p>
547
- <?php
548
- }
549
-
550
- public function drop_shadow_render() {
551
- $options = get_option( 'ctcc_styles_settings' ); ?>
552
- <input type='checkbox' name='ctcc_styles_settings[drop_shadow]' <?php checked ( ! empty ( $options['drop_shadow'] ), 1 ); ?> value='1'>
553
- <p class="description"><?php _e ( 'Add drop shadow to the block (doesn\'t apply to the top or bottom bar)', 'uk-cookie-consent' ); ?></p>
554
- <?php
555
- }
556
-
557
- public function display_accept_with_text_render() {
558
- $options = get_option( 'ctcc_styles_settings' ); ?>
559
- <input type='checkbox' name='ctcc_styles_settings[display_accept_with_text]' <?php checked ( ! empty ( $options['display_accept_with_text'] ), 1 ); ?> value='1'>
560
- <p class="description"><?php _e ( 'Display the confirmation button with notification text', 'uk-cookie-consent' ); ?></p>
561
- <?php
562
- }
563
-
564
- public function x_close_render() {
565
- $options = get_option( 'ctcc_styles_settings' ); ?>
566
- <input type='checkbox' name='ctcc_styles_settings[x_close]' <?php checked ( ! empty ( $options['x_close'] ), 1 ); ?> value='1'>
567
- <p class="description"><?php _e ( 'Remove confirmation button and use \'X\' icon instead', 'uk-cookie-consent' ); ?></p>
568
- <?php
569
- }
570
-
571
- public function text_color_render() {
572
- $options = get_option( 'ctcc_styles_settings' ); ?>
573
- <input type="text" class="cctc-color-field" name="ctcc_styles_settings[text_color]" value="<?php echo $options['text_color']; ?>">
574
- <p class="description"><?php _e ( 'The text color on the notification', 'uk-cookie-consent' ); ?></p>
575
- <?php
576
- }
577
-
578
- public function bg_color_render() {
579
- $options = get_option( 'ctcc_styles_settings' ); ?>
580
- <input type="text" class="cctc-color-field" name="ctcc_styles_settings[bg_color]" value="<?php echo $options['bg_color']; ?>">
581
- <p class="description"><?php _e ( 'The background color for the notification', 'uk-cookie-consent' ); ?></p>
582
- <?php
583
- }
584
-
585
- public function link_color_render() {
586
- $options = get_option( 'ctcc_styles_settings' ); ?>
587
- <input type="text" class="cctc-color-field" name="ctcc_styles_settings[link_color]" value="<?php echo $options['link_color']; ?>">
588
- <p class="description"><?php _e ( 'The link color on the notification', 'uk-cookie-consent' ); ?></p>
589
- <?php
590
- }
591
-
592
- public function button_color_render() {
593
- $options = get_option( 'ctcc_styles_settings' ); ?>
594
- <input type="text" class="cctc-color-field" name="ctcc_styles_settings[button_color]" value="<?php echo $options['button_color']; ?>">
595
- <p class="description"><?php _e ( 'The text color on the notification button', 'uk-cookie-consent' ); ?></p>
596
- <?php
597
- }
598
-
599
- public function button_bg_color_render() {
600
- $options = get_option( 'ctcc_styles_settings' ); ?>
601
- <input type="text" class="cctc-color-field" name="ctcc_styles_settings[button_bg_color]" value="<?php echo $options['button_bg_color']; ?>">
602
- <p class="description"><?php _e ( 'The background color on the notification button', 'uk-cookie-consent' ); ?></p>
603
- <?php
604
- }
605
-
606
- public function settings_section_callback() {
607
- echo __( '<p>Basic settings</p>', 'uk-cookie-consent' );
608
- }
609
-
610
- public function content_settings_section_callback() {
611
- echo __( '<p>Update the content displayed to the user</p>', 'uk-cookie-consent' );
612
- }
613
-
614
- public function styles_settings_section_callback() {
615
- echo __( '<p>Change the styles here if you like - but it\'s better in the Customizer</p>', 'uk-cookie-consent' );
616
- }
617
-
618
- public function options_page() {
619
- $reset = isset ( $_GET['reset'] ) ? $_GET['reset'] : '';
620
- if ( isset ( $_POST['reset'] ) ) {
621
-
622
- $defaults = $this -> get_default_styles_settings();
623
- update_option ( 'ctcc_styles_settings', $defaults );
624
-
625
- $defaults = $this -> get_default_content_settings();
626
- update_option ( 'ctcc_content_settings', $defaults );
627
-
628
- }
629
- $current = isset ( $_GET['tab'] ) ? $_GET['tab'] : 'options';
630
- $title = __( 'Cookie Consent', 'uk-cookie-consent' );
631
- $tabs = array (
632
- 'options' => __( 'General', 'uk-cookie-consent' ),
633
- 'content' => __( 'Content', 'uk-cookie-consent' ),
634
- 'styles' => __( 'Styles', 'uk-cookie-consent' )
635
- );?>
636
-
637
- <div class="wrap">
638
- <h1><?php echo $title; ?></h1>
639
- <div class="ctdb-outer-wrap">
640
- <div class="ctdb-inner-wrap">
641
- <h2 class="nav-tab-wrapper">
642
- <?php foreach( $tabs as $tab => $name ) {
643
- $class = ( $tab == $current ) ? ' nav-tab-active' : '';
644
- echo "<a class='nav-tab$class' href='?page=ctcc&tab=$tab'>$name</a>";
645
- } ?>
646
- </h2>
647
- <form action='options.php' method='post'>
648
- <?php
649
- settings_fields( 'ctcc_' . strtolower ( $current ) );
650
- do_settings_sections( 'ctcc_' . strtolower ( $current ) );
651
- submit_button();
652
- ?>
653
- </form>
654
- <form method="post" action="">
655
- <p class="submit">
656
- <input name="reset" class="button button-secondary" type="submit" value="<?php _e ( 'Reset plugin defaults', 'uk-cookie-consent' ); ?>" >
657
- <input type="hidden" name="action" value="reset" />
658
- </p>
659
- </form>
660
- </div><!-- .ctdb-inner-wrap -->
661
- <div class="ctdb-banners">
662
- <div class="ctdb-banner">
663
- <a href="//catapultthemes.com/downloads/mode">
664
- <img src="<?php echo CTCC_PLUGIN_URL . 'assets/images/mode-3d-banner-cc.jpg'; ?>" alt="" >
665
- </a>
666
- </div>
667
- </div>
668
- </div><!-- .ctdb-outer-wrap -->
669
- </div><!-- .wrap -->
670
- <?php
671
- }
672
-
673
-
674
- }
675
-
676
- }
677
-
678
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Cookie Consent admin class
4
+ */
5
+
6
+ // Exit if accessed directly
7
+ if ( ! defined( 'ABSPATH' ) ) {
8
+ exit;
9
+ }
10
+
11
+ /**
12
+ * Plugin admin class
13
+ **/
14
+ if ( ! class_exists ( 'CTCC_Admin' ) ) {
15
+
16
+ class CTCC_Admin {
17
+
18
+ public function __construct() {
19
+ //
20
+ }
21
+
22
+ /*
23
+ * Initialize the class and start calling our hooks and filters
24
+ * @since 2.0.0
25
+ */
26
+ public function init() {
27
+
28
+ add_action ( 'admin_menu', array ( $this, 'add_admin_menu' ) );
29
+ add_action ( 'admin_init', array ( $this, 'register_options_init' ) );
30
+ add_action ( 'admin_init', array ( $this, 'register_content_init' ) );
31
+ add_action ( 'admin_init', array ( $this, 'register_styles_init' ) );
32
+
33
+ add_action ( 'admin_enqueue_scripts', array ( $this, 'enqueue_scripts' ) );
34
+ add_action ( 'admin_footer', array ( $this, 'add_js' ) );
35
+
36
+ }
37
+
38
+ public function enqueue_scripts() {
39
+ wp_enqueue_style ( 'wp-color-picker' );
40
+ wp_enqueue_script ( 'wp-color-picker' );
41
+ wp_enqueue_style ( 'ctcc-admin-style', CTCC_PLUGIN_URL . 'assets/css/admin-style.css' );
42
+ }
43
+
44
+ public function add_js() {
45
+ ?>
46
+ <script>
47
+ jQuery(document).ready(function($){
48
+ $('.cctc-color-field').wpColorPicker();
49
+ });
50
+ </script>
51
+ <?php
52
+ }
53
+
54
+ // Add the menu item
55
+ public function add_admin_menu( ) {
56
+ add_options_page ( __('Cookie Consent', 'uk-cookie-consent'), __('Cookie Consent', 'uk-cookie-consent'), 'manage_options', 'ctcc', array ( $this, 'options_page' ) );
57
+ }
58
+
59
+ public function register_options_init( ) {
60
+
61
+ register_setting ( 'ctcc_options', 'ctcc_options_settings' );
62
+
63
+ add_settings_section (
64
+ 'ctcc_options_section',
65
+ __( 'General settings', 'uk-cookie-consent' ),
66
+ array ( $this, 'settings_section_callback' ),
67
+ 'ctcc_options'
68
+ );
69
+
70
+ add_settings_field (
71
+ 'closure',
72
+ __( 'Close', 'uk-cookie-consent' ),
73
+ array ( $this, 'closure_render' ),
74
+ 'ctcc_options',
75
+ 'ctcc_options_section'
76
+ );
77
+
78
+ add_settings_field (
79
+ 'first_page',
80
+ __( 'First Page Only', 'uk-cookie-consent' ),
81
+ array ( $this, 'first_page_render' ),
82
+ 'ctcc_options',
83
+ 'ctcc_options_section'
84
+ );
85
+
86
+ add_settings_field (
87
+ 'duration',
88
+ __( 'Notification Duration', 'uk-cookie-consent' ),
89
+ array ( $this, 'duration_render' ),
90
+ 'ctcc_options',
91
+ 'ctcc_options_section'
92
+ );
93
+
94
+ add_settings_field (
95
+ 'cookie_expiry',
96
+ __( 'Cookie Expiry', 'uk-cookie-consent' ),
97
+ array ( $this, 'cookie_expiry_render' ),
98
+ 'ctcc_options',
99
+ 'ctcc_options_section'
100
+ );
101
+
102
+ add_settings_field (
103
+ 'cookie_version',
104
+ __( 'Cookie Version', 'uk-cookie-consent' ),
105
+ array ( $this, 'cookie_version_render' ),
106
+ 'ctcc_options',
107
+ 'ctcc_options_section'
108
+ );
109
+
110
+ // Set default options
111
+ $options = get_option ( 'ctcc_options_settings' );
112
+ if ( false === $options ) {
113
+ // Get defaults
114
+ $defaults = $this -> get_default_options_settings();
115
+ update_option ( 'ctcc_options_settings', $defaults );
116
+ }
117
+
118
+ }
119
+
120
+ public function register_content_init() {
121
+
122
+ register_setting ( 'ctcc_content', 'ctcc_content_settings' );
123
+
124
+ add_settings_section (
125
+ 'ctcc_content_section',
126
+ __( 'Content settings', 'uk-cookie-consent' ),
127
+ array ( $this, 'content_settings_section_callback' ),
128
+ 'ctcc_content'
129
+ );
130
+
131
+ add_settings_field (
132
+ 'heading_text',
133
+ __( 'Heading Text', 'uk-cookie-consent' ),
134
+ array ( $this, 'heading_text_render' ),
135
+ 'ctcc_content',
136
+ 'ctcc_content_section'
137
+ );
138
+
139
+ add_settings_field (
140
+ 'notification_text',
141
+ __( 'Notification Text', 'uk-cookie-consent' ),
142
+ array ( $this, 'notification_text_render' ),
143
+ 'ctcc_content',
144
+ 'ctcc_content_section'
145
+ );
146
+
147
+ add_settings_field (
148
+ 'more_info_text',
149
+ __( 'More Info Text', 'uk-cookie-consent' ),
150
+ array ( $this, 'more_info_text_render' ),
151
+ 'ctcc_content',
152
+ 'ctcc_content_section'
153
+ );
154
+
155
+ add_settings_field (
156
+ 'more_info_page',
157
+ __( 'More Info Page', 'uk-cookie-consent' ),
158
+ array ( $this, 'more_info_page_render' ),
159
+ 'ctcc_content',
160
+ 'ctcc_content_section'
161
+ );
162
+
163
+ add_settings_field (
164
+ 'more_info_url',
165
+ __( 'More Info URL', 'uk-cookie-consent' ),
166
+ array ( $this, 'more_info_url_render' ),
167
+ 'ctcc_content',
168
+ 'ctcc_content_section'
169
+ );
170
+
171
+ add_settings_field (
172
+ 'more_info_target',
173
+ __( 'More Info Target', 'uk-cookie-consent' ),
174
+ array ( $this, 'more_info_target_render' ),
175
+ 'ctcc_content',
176
+ 'ctcc_content_section'
177
+ );
178
+
179
+ add_settings_field (
180
+ 'accept_text',
181
+ __( 'Accept Text', 'uk-cookie-consent' ),
182
+ array ( $this, 'accept_text_render' ),
183
+ 'ctcc_content',
184
+ 'ctcc_content_section'
185
+ );
186
+
187
+ // Set default options
188
+ $options = get_option ( 'ctcc_content_settings' );
189
+ if ( false === $options ) {
190
+ // Get defaults
191
+ $defaults = $this -> get_default_content_settings();
192
+ update_option ( 'ctcc_content_settings', $defaults );
193
+ }
194
+
195
+ }
196
+
197
+ public function register_styles_init( ) {
198
+
199
+ register_setting ( 'ctcc_styles', 'ctcc_styles_settings' );
200
+
201
+ add_settings_section (
202
+ 'ctcc_styles_section',
203
+ __( 'Styles settings', 'uk-cookie-consent' ),
204
+ array ( $this, 'styles_settings_section_callback' ),
205
+ 'ctcc_styles'
206
+ );
207
+
208
+ add_settings_field (
209
+ 'position',
210
+ __( 'Position', 'uk-cookie-consent' ),
211
+ array ( $this, 'position_render' ),
212
+ 'ctcc_styles',
213
+ 'ctcc_styles_section'
214
+ );
215
+
216
+ add_settings_field (
217
+ 'container_class',
218
+ __( 'Container Class', 'uk-cookie-consent' ),
219
+ array ( $this, 'container_class_render' ),
220
+ 'ctcc_styles',
221
+ 'ctcc_styles_section'
222
+ );
223
+
224
+ add_settings_field (
225
+ 'enqueue_styles',
226
+ __( 'Include Stylesheet', 'uk-cookie-consent' ),
227
+ array ( $this, 'enqueue_styles_render' ),
228
+ 'ctcc_styles',
229
+ 'ctcc_styles_section'
230
+ );
231
+
232
+ add_settings_field (
233
+ 'rounded_corners',
234
+ __( 'Rounded Corners', 'uk-cookie-consent' ),
235
+ array ( $this, 'rounded_corners_render' ),
236
+ 'ctcc_styles',
237
+ 'ctcc_styles_section'
238
+ );
239
+
240
+ add_settings_field (
241
+ 'drop_shadow',
242
+ __( 'Drop Shadow', 'uk-cookie-consent' ),
243
+ array ( $this, 'drop_shadow_render' ),
244
+ 'ctcc_styles',
245
+ 'ctcc_styles_section'
246
+ );
247
+
248
+ add_settings_field (
249
+ 'display_accept_with_text',
250
+ __( 'Display Button With Text', 'uk-cookie-consent' ),
251
+ array ( $this, 'display_accept_with_text_render' ),
252
+ 'ctcc_styles',
253
+ 'ctcc_styles_section'
254
+ );
255
+
256
+ add_settings_field (
257
+ 'x_close',
258
+ __( 'Use X Close', 'uk-cookie-consent' ),
259
+ array ( $this, 'x_close_render' ),
260
+ 'ctcc_styles',
261
+ 'ctcc_styles_section'
262
+ );
263
+
264
+ add_settings_field (
265
+ 'text_color',
266
+ __( 'Text Color', 'uk-cookie-consent' ),
267
+ array ( $this, 'text_color_render' ),
268
+ 'ctcc_styles',
269
+ 'ctcc_styles_section'
270
+ );
271
+
272
+ add_settings_field (
273
+ 'bg_color',
274
+ __( 'Background Color', 'uk-cookie-consent' ),
275
+ array ( $this, 'bg_color_render' ),
276
+ 'ctcc_styles',
277
+ 'ctcc_styles_section'
278
+ );
279
+
280
+ add_settings_field (
281
+ 'link_color',
282
+ __( 'Link Color', 'uk-cookie-consent' ),
283
+ array ( $this, 'link_color_render' ),
284
+ 'ctcc_styles',
285
+ 'ctcc_styles_section'
286
+ );
287
+
288
+ add_settings_field (
289
+ 'button_color',
290
+ __( 'Button Color', 'uk-cookie-consent' ),
291
+ array ( $this, 'button_color_render' ),
292
+ 'ctcc_styles',
293
+ 'ctcc_styles_section'
294
+ );
295
+
296
+ add_settings_field (
297
+ 'button_bg_color',
298
+ __( 'Button Background', 'uk-cookie-consent' ),
299
+ array ( $this, 'button_bg_color_render' ),
300
+ 'ctcc_styles',
301
+ 'ctcc_styles_section'
302
+ );
303
+
304
+ add_settings_field (
305
+ 'bg_color',
306
+ __( 'Background Color', 'uk-cookie-consent' ),
307
+ array ( $this, 'bg_color_render' ),
308
+ 'ctcc_styles',
309
+ 'ctcc_styles_section'
310
+ );
311
+
312
+ add_settings_field (
313
+ 'flat_button',
314
+ __( 'Flat Button', 'uk-cookie-consent' ),
315
+ array ( $this, 'flat_button_render' ),
316
+ 'ctcc_styles',
317
+ 'ctcc_styles_section'
318
+ );
319
+
320
+ // Set default options
321
+ $options = get_option ( 'ctcc_styles_settings' );
322
+ if ( false === $options ) {
323
+ // Get defaults
324
+ $defaults = $this -> get_default_styles_settings();
325
+ update_option ( 'ctcc_styles_settings', $defaults );
326
+ }
327
+
328
+ }
329
+
330
+ public function get_default_options_settings() {
331
+ $defaults = array (
332
+ 'closure' => 'click',
333
+ 'first_page' => 0,
334
+ 'duration' => 60,
335
+ 'cookie_expiry' => 30,
336
+ 'cookie_version' => 1
337
+ );
338
+ return $defaults;
339
+ }
340
+
341
+ public function get_default_content_settings() {
342
+
343
+ $previous_settings = get_option ( 'catapult_cookie_options' );
344
+ // Check for settings from previous version
345
+ if ( ! empty ( $previous_settings ) ) {
346
+ $defaults = array (
347
+ 'heading_text' => __( 'Cookies', 'uk-cookie-consent' ),
348
+ 'notification_text' => $previous_settings['catapult_cookie_text_settings'],
349
+ 'accept_text' => $previous_settings['catapult_cookie_accept_settings'],
350
+ 'more_info_text' => $previous_settings['catapult_cookie_more_settings'],
351
+ 'more_info_page' => '',
352
+ 'more_info_url' => site_url ( $previous_settings['catapult_cookie_link_settings'] ),
353
+ 'more_info_target' => '_blank',
354
+ );
355
+ } else {
356
+ $defaults = array (
357
+ 'heading_text' => __( 'Cookies', 'uk-cookie-consent' ),
358
+ 'notification_text' => __( 'This site uses cookies: ', 'uk-cookie-consent' ),
359
+ 'accept_text' => __( 'Okay, thanks', 'uk-cookie-consent' ),
360
+ 'more_info_text' => __( 'Find out more.', 'uk-cookie-consent' ),
361
+ 'more_info_page' => get_option( 'ctcc_more_info_page', '' ),
362
+ 'more_info_url' => '',
363
+ 'more_info_target' => '_blank',
364
+ );
365
+ }
366
+ return $defaults;
367
+
368
+ }
369
+
370
+ public function get_default_styles_settings() {
371
+ $previous_settings = get_option ( 'catapult_cookie_options' );
372
+ $defaults = array (
373
+ 'position' => 'top-bar',
374
+ 'container_class' => '',
375
+ 'enqueue_styles' => 1,
376
+ 'rounded_corners' => 1,
377
+ 'drop_shadow' => 1,
378
+ 'display_accept_with_text' => 1,
379
+ 'x_close' => 0,
380
+ 'text_color' => '#ddd',
381
+ 'bg_color' => '#464646',
382
+ 'link_color' => '#fff',
383
+ 'button_color' => '',
384
+ 'button_bg_color' => '',
385
+ 'flat_button' => 1,
386
+ );
387
+ // Check for settings from previous version
388
+
389
+ if ( ! empty ( $previous_settings['catapult_cookie_bar_position_settings'] ) ) {
390
+ $defaults['position'] = $previous_settings['catapult_cookie_bar_position_settings'] . '-bar';
391
+ }
392
+
393
+ if ( ! empty ( $previous_settings['catapult_cookie_text_colour_settings'] ) ) {
394
+ $defaults['text_color'] = $previous_settings['catapult_cookie_text_colour_settings'];
395
+ }
396
+
397
+ if ( ! empty ( $previous_settings['catapult_cookie_bg_colour_settings'] ) ) {
398
+ $defaults['bg_color'] = $previous_settings['catapult_cookie_bg_colour_settings'];
399
+ }
400
+
401
+ if ( ! empty ( $previous_settings['catapult_cookie_link_colour_settings'] ) ) {
402
+ $defaults['link_color'] = $previous_settings['catapult_cookie_link_colour_settings'];
403
+ }
404
+
405
+ if ( ! empty ( $previous_settings['catapult_cookie_link_colour_settings'] ) ) {
406
+ $defaults['link_color'] = $previous_settings['catapult_cookie_link_colour_settings'];
407
+ }
408
+
409
+ if ( ! empty ( $previous_settings['catapult_cookie_button_colour_settings'] ) ) {
410
+ $defaults['button_bg_color'] = $previous_settings['catapult_cookie_button_colour_settings'];
411
+ }
412
+
413
+ return $defaults;
414
+
415
+ }
416
+
417
+ public function closure_render() {
418
+ $options = get_option( 'ctcc_options_settings' ); ?>
419
+ <select name='ctcc_options_settings[closure]'>
420
+ <option value='click' <?php selected( $options['closure'], 'click' ); ?>><?php _e ( 'On Click', 'uk-cookie-consent' ); ?></option>
421
+ <option value='timed' <?php selected( $options['closure'], 'timed' ); ?>><?php _e ( 'Timed', 'uk-cookie-consent' ); ?></option>
422
+ </select>
423
+ <p class="description"><?php _e ( 'How you want the user to close the notification', 'uk-cookie-consent' ); ?></p>
424
+ <?php
425
+ }
426
+
427
+ public function first_page_render() {
428
+ $options = get_option( 'ctcc_options_settings' ); ?>
429
+ <input type='checkbox' name='ctcc_options_settings[first_page]' <?php checked ( ! empty ( $options['first_page'] ), 1 ); ?> value='1'>
430
+ <p class="description"><?php _e ( 'Select this to show the notification only on the first page the user visits', 'uk-cookie-consent' ); ?></p>
431
+ <?php
432
+ }
433
+
434
+ public function duration_render() {
435
+ $options = get_option( 'ctcc_options_settings' ); ?>
436
+ <input type="number" min="1" name="ctcc_options_settings[duration]" value="<?php echo $options['duration']; ?>">
437
+ <p class="description"><?php _e ( 'If you chose Timer as the close method, enter how many seconds the notification should display for', 'uk-cookie-consent' ); ?></p>
438
+ <?php
439
+ }
440
+
441
+ public function cookie_expiry_render() {
442
+ $options = get_option( 'ctcc_options_settings' ); ?>
443
+ <input type="number" min="1" name="ctcc_options_settings[cookie_expiry]" value="<?php echo $options['cookie_expiry']; ?>">
444
+ <p class="description"><?php _e ( 'The number of days that the cookie is set for', 'uk-cookie-consent' ); ?></p>
445
+ <?php
446
+ }
447
+
448
+ public function cookie_version_render() {
449
+ $options = get_option( 'ctcc_options_settings' ); ?>
450
+ <input type="text" name="ctcc_options_settings[cookie_version]" value="<?php echo $options['cookie_version']; ?>">
451
+ <p class="description"><?php _e ( 'A version number for the cookie - update this to invalidate the cookie and force all users to view the notification again', 'uk-cookie-consent' ); ?></p>
452
+ <?php
453
+ }
454
+
455
+ /*
456
+ * Content renders
457
+ */
458
+
459
+ public function heading_text_render() {
460
+ $ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
461
+ <input type="text" name="ctcc_content_settings[heading_text]" value="<?php echo $ctcc_content_settings['heading_text']; ?>">
462
+ <p class="description"><?php _e ( 'The heading text - only applies if you are not using a top or bottom bar', 'uk-cookie-consent' ); ?></p>
463
+ <?php
464
+ }
465
+
466
+ public function notification_text_render() {
467
+ $ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
468
+ <input type="text" name="ctcc_content_settings[notification_text]" value="<?php echo $ctcc_content_settings['notification_text']; ?>">
469
+ <p class="description"><?php _e ( 'The default text to indicate that your site uses cookies', 'uk-cookie-consent' ); ?></p>
470
+ <?php
471
+ }
472
+
473
+ public function accept_text_render() {
474
+ $ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
475
+ <input type="text" name="ctcc_content_settings[accept_text]" value="<?php echo $ctcc_content_settings['accept_text']; ?>">
476
+ <p class="description"><?php _e ( 'The default text to dismiss the notification', 'uk-cookie-consent' ); ?></p>
477
+ <?php
478
+ }
479
+
480
+ public function more_info_text_render() {
481
+ $ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
482
+ <input type="text" name="ctcc_content_settings[more_info_text]" value="<?php echo $ctcc_content_settings['more_info_text']; ?>">
483
+ <p class="description"><?php _e ( 'The default text to use to link to a page providing further information', 'uk-cookie-consent' ); ?></p>
484
+ <?php
485
+ }
486
+
487
+ public function more_info_page_render() {
488
+ $ctcc_content_settings = get_option( 'ctcc_content_settings' );
489
+ // Get all pages
490
+ $pages = get_pages();
491
+ ?>
492
+ <?php if ( $pages ) { ?>
493
+ <select name='ctcc_content_settings[more_info_page]'>
494
+ <option></option>
495
+ <?php foreach ( $pages as $page ) { ?>
496
+ <option value='<?php echo $page -> ID; ?>' <?php selected( $ctcc_content_settings['more_info_page'], $page -> ID ); ?>><?php echo $page -> post_title; ?></option>
497
+ <?php } ?>
498
+ </select>
499
+ <p class="description"><?php _e ( 'The page containing further information about your cookie policy', 'discussion-board' ); ?></p>
500
+ <?php }
501
+ }
502
+
503
+ public function more_info_url_render() {
504
+ $ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
505
+ <input type="url" name="ctcc_content_settings[more_info_url]" value="<?php echo $ctcc_content_settings['more_info_url']; ?>">
506
+ <p class="description"><?php _e ( 'You can add an absolute URL here to override the More Info Page setting above. Use this to link to an external website for further information about cookies.', 'uk-cookie-consent' ); ?></p>
507
+ <?php
508
+ }
509
+
510
+ public function more_info_target_render() {
511
+ $ctcc_content_settings = get_option( 'ctcc_content_settings' ); ?>
512
+ <select name='ctcc_content_settings[more_info_target]'>
513
+ <option value='_blank' <?php selected( $ctcc_content_settings['more_info_target'], '_blank' ); ?>><?php _e ( 'New Tab', 'uk-cookie-consent' ); ?></option>
514
+ <option value='_self' <?php selected( $ctcc_content_settings['more_info_target'], '_self' ); ?>><?php _e ( 'Same Tab', 'uk-cookie-consent' ); ?></option>
515
+ </select>
516
+ <p class="description"><?php _e ( 'Open the More Information page in the same or new tab.', 'uk-cookie-consent' ); ?></p>
517
+ <?php
518
+ }
519
+
520
+ /*
521
+ * Styles functions
522
+ */
523
+
524
+ public function position_render() {
525
+ $options = get_option( 'ctcc_styles_settings' ); ?>
526
+ <select name='ctcc_styles_settings[position]'>
527
+ <option value='top-bar' <?php selected( $options['position'], 'top-bar' ); ?>><?php _e ( 'Top Bar', 'uk-cookie-consent' ); ?></option>
528
+ <option value='bottom-bar' <?php selected( $options['position'], 'bottom-bar' ); ?>><?php _e ( 'Bottom Bar', 'uk-cookie-consent' ); ?></option>
529
+ <option value='top-left-block' <?php selected( $options['position'], 'top-left-block' ); ?>><?php _e ( 'Top Left Block', 'uk-cookie-consent' ); ?></option>
530
+ <option value='top-right-block' <?php selected( $options['position'], 'top-right-block' ); ?>><?php _e ( 'Top Right Block', 'uk-cookie-consent' ); ?></option>
531
+ <option value='bottom-left-block' <?php selected( $options['position'], 'bottom-left-block' ); ?>><?php _e ( 'Bottom Left Block', 'uk-cookie-consent' ); ?></option>
532
+ <option value='bottom-right-block' <?php selected( $options['position'], 'bottom-right-block' ); ?>><?php _e ( 'Bottom Right Block', 'uk-cookie-consent' ); ?></option>
533
+ </select>
534
+ <p class="description"><?php _e ( 'Where the notification should appear', 'uk-cookie-consent' ); ?></p>
535
+ <?php
536
+ }
537
+
538
+ public function container_class_render() {
539
+ $options = get_option( 'ctcc_styles_settings' ); ?>
540
+ <input type="text" name="ctcc_styles_settings[container_class]" value="<?php echo $options['container_class']; ?>">
541
+ <p class="description"><?php _e ( 'You can add an optional wrapper class, eg container, here to align the notification text with the rest of your content', 'uk-cookie-consent' ); ?></p>
542
+ <?php
543
+ }
544
+
545
+ public function enqueue_styles_render() {
546
+ $options = get_option( 'ctcc_styles_settings' ); ?>
547
+ <input type='checkbox' name='ctcc_styles_settings[enqueue_styles]' <?php checked ( ! empty ( $options['enqueue_styles'] ), 1 ); ?> value='1'>
548
+ <p class="description"><?php _e ( 'Deselect this to dequeue the plugin stylesheet', 'uk-cookie-consent' ); ?></p>
549
+ <?php
550
+ }
551
+
552
+ public function rounded_corners_render() {
553
+ $options = get_option( 'ctcc_styles_settings' ); ?>
554
+ <input type='checkbox' name='ctcc_styles_settings[rounded_corners]' <?php checked ( ! empty ( $options['rounded_corners'] ), 1 ); ?> value='1'>
555
+ <p class="description"><?php _e ( 'Round the corners on the block (doesn\'t apply to the top or bottom bar)', 'uk-cookie-consent' ); ?></p>
556
+ <?php
557
+ }
558
+
559
+ public function drop_shadow_render() {
560
+ $options = get_option( 'ctcc_styles_settings' ); ?>
561
+ <input type='checkbox' name='ctcc_styles_settings[drop_shadow]' <?php checked ( ! empty ( $options['drop_shadow'] ), 1 ); ?> value='1'>
562
+ <p class="description"><?php _e ( 'Add drop shadow to the block (doesn\'t apply to the top or bottom bar)', 'uk-cookie-consent' ); ?></p>
563
+ <?php
564
+ }
565
+
566
+ public function display_accept_with_text_render() {
567
+ $options = get_option( 'ctcc_styles_settings' ); ?>
568
+ <input type='checkbox' name='ctcc_styles_settings[display_accept_with_text]' <?php checked ( ! empty ( $options['display_accept_with_text'] ), 1 ); ?> value='1'>
569
+ <p class="description"><?php _e ( 'Display the confirmation button with notification text', 'uk-cookie-consent' ); ?></p>
570
+ <?php
571
+ }
572
+
573
+ public function x_close_render() {
574
+ $options = get_option( 'ctcc_styles_settings' ); ?>
575
+ <input type='checkbox' name='ctcc_styles_settings[x_close]' <?php checked ( ! empty ( $options['x_close'] ), 1 ); ?> value='1'>
576
+ <p class="description"><?php _e ( 'Remove confirmation button and use \'X\' icon instead', 'uk-cookie-consent' ); ?></p>
577
+ <?php
578
+ }
579
+
580
+ public function text_color_render() {
581
+ $options = get_option( 'ctcc_styles_settings' ); ?>
582
+ <input type="text" class="cctc-color-field" name="ctcc_styles_settings[text_color]" value="<?php echo $options['text_color']; ?>">
583
+ <p class="description"><?php _e ( 'The text color on the notification', 'uk-cookie-consent' ); ?></p>
584
+ <?php
585
+ }
586
+
587
+ public function bg_color_render() {
588
+ $options = get_option( 'ctcc_styles_settings' ); ?>
589
+ <input type="text" class="cctc-color-field" name="ctcc_styles_settings[bg_color]" value="<?php echo $options['bg_color']; ?>">
590
+ <p class="description"><?php _e ( 'The background color for the notification', 'uk-cookie-consent' ); ?></p>
591
+ <?php
592
+ }
593
+
594
+ public function link_color_render() {
595
+ $options = get_option( 'ctcc_styles_settings' ); ?>
596
+ <input type="text" class="cctc-color-field" name="ctcc_styles_settings[link_color]" value="<?php echo $options['link_color']; ?>">
597
+ <p class="description"><?php _e ( 'The link color on the notification', 'uk-cookie-consent' ); ?></p>
598
+ <?php
599
+ }
600
+
601
+ public function button_color_render() {
602
+ $options = get_option( 'ctcc_styles_settings' ); ?>
603
+ <input type="text" class="cctc-color-field" name="ctcc_styles_settings[button_color]" value="<?php echo $options['button_color']; ?>">
604
+ <p class="description"><?php _e ( 'The text color on the notification button', 'uk-cookie-consent' ); ?></p>
605
+ <?php
606
+ }
607
+
608
+ public function button_bg_color_render() {
609
+ $options = get_option( 'ctcc_styles_settings' ); ?>
610
+ <input type="text" class="cctc-color-field" name="ctcc_styles_settings[button_bg_color]" value="<?php echo $options['button_bg_color']; ?>">
611
+ <p class="description"><?php _e ( 'The background color on the notification button', 'uk-cookie-consent' ); ?></p>
612
+ <?php
613
+ }
614
+
615
+ public function flat_button_render() {
616
+ $options = get_option( 'ctcc_styles_settings' ); ?>
617
+ <input type='checkbox' name='ctcc_styles_settings[flat_button]' <?php checked ( ! empty ( $options['flat_button'] ), 1 ); ?> value='1'>
618
+ <p class="description"><?php _e ( 'Remove the border from the button', 'uk-cookie-consent' ); ?></p>
619
+ <?php
620
+ }
621
+
622
+ public function settings_section_callback() {
623
+ echo __( '<p>Basic settings</p>', 'uk-cookie-consent' );
624
+ }
625
+
626
+ public function content_settings_section_callback() {
627
+ echo __( '<p>Update the content displayed to the user</p>', 'uk-cookie-consent' );
628
+ }
629
+
630
+ public function styles_settings_section_callback() {
631
+ echo __( '<p>Change the styles here if you like - but it\'s better in the Customizer</p>', 'uk-cookie-consent' );
632
+ }
633
+
634
+ public function options_page() {
635
+ $reset = isset ( $_GET['reset'] ) ? $_GET['reset'] : '';
636
+ if ( isset ( $_POST['reset'] ) ) {
637
+
638
+ $defaults = $this -> get_default_styles_settings();
639
+ update_option ( 'ctcc_styles_settings', $defaults );
640
+
641
+ $defaults = $this -> get_default_content_settings();
642
+ update_option ( 'ctcc_content_settings', $defaults );
643
+
644
+ }
645
+ $current = isset ( $_GET['tab'] ) ? $_GET['tab'] : 'options';
646
+ $title = __( 'Cookie Consent', 'uk-cookie-consent' );
647
+ $tabs = array (
648
+ 'options' => __( 'General', 'uk-cookie-consent' ),
649
+ 'content' => __( 'Content', 'uk-cookie-consent' ),
650
+ 'styles' => __( 'Styles', 'uk-cookie-consent' )
651
+ );?>
652
+
653
+ <div class="wrap">
654
+ <h1><?php echo $title; ?></h1>
655
+ <div class="ctdb-outer-wrap">
656
+ <div class="ctdb-inner-wrap">
657
+ <h2 class="nav-tab-wrapper">
658
+ <?php foreach( $tabs as $tab => $name ) {
659
+ $class = ( $tab == $current ) ? ' nav-tab-active' : '';
660
+ echo "<a class='nav-tab$class' href='?page=ctcc&tab=$tab'>$name</a>";
661
+ } ?>
662
+ </h2>
663
+ <form action='options.php' method='post'>
664
+ <?php
665
+ settings_fields( 'ctcc_' . strtolower ( $current ) );
666
+ do_settings_sections( 'ctcc_' . strtolower ( $current ) );
667
+ submit_button();
668
+ ?>
669
+ </form>
670
+ <form method="post" action="">
671
+ <p class="submit">
672
+ <input name="reset" class="button button-secondary" type="submit" value="<?php _e ( 'Reset plugin defaults', 'uk-cookie-consent' ); ?>" >
673
+ <input type="hidden" name="action" value="reset" />
674
+ </p>
675
+ </form>
676
+ </div><!-- .ctdb-inner-wrap -->
677
+ <div class="ctdb-banners">
678
+ <div class="ctdb-banner">
679
+ <a href="//catapultthemes.com/downloads/mode">
680
+ <img src="<?php echo CTCC_PLUGIN_URL . 'assets/images/mode-3d-banner-cc.jpg'; ?>" alt="" >
681
+ </a>
682
+ </div>
683
+ </div>
684
+ </div><!-- .ctdb-outer-wrap -->
685
+ </div><!-- .wrap -->
686
+ <?php
687
+ }
688
+
689
+
690
+ }
691
+
692
+ }
693
+
694
+
languages/uk-cookie-consent-ru_RU.mo ADDED
Binary file
languages/uk-cookie-consent-ru_RU.po ADDED
@@ -0,0 +1,439 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2016 Cookie Consent
2
+ # This file is distributed under the same license as the Cookie Consent package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Cookie Consent 2.0.3\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/uk-cookie-"
7
+ "consent\n"
8
+ "POT-Creation-Date: 2016-01-14 14:28+0300\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2016-01-14 22:15+0300\n"
13
+ "Language-Team: \n"
14
+ "X-Generator: Poedit 1.8.6\n"
15
+ "Last-Translator: \n"
16
+ "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
17
+ "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
18
+ "Language: ru_RU\n"
19
+
20
+ #. Plugin Name of the plugin/theme
21
+ #: admin/class-ctcc-admin.php:56 admin/class-ctcc-admin.php:630
22
+ #: public/customizer.php:17
23
+ msgid "Cookie Consent"
24
+ msgstr "Разрешить Cookie"
25
+
26
+ #: admin/class-ctcc-admin.php:65
27
+ msgid "General settings"
28
+ msgstr "Общие настройки"
29
+
30
+ #: admin/class-ctcc-admin.php:72
31
+ msgid "Close"
32
+ msgstr "Закрыть"
33
+
34
+ #: admin/class-ctcc-admin.php:80
35
+ msgid "First Page Only"
36
+ msgstr "Только первую страницу"
37
+
38
+ #: admin/class-ctcc-admin.php:88
39
+ msgid "Notification Duration"
40
+ msgstr "Длительность уведомления"
41
+
42
+ #: admin/class-ctcc-admin.php:96
43
+ msgid "Cookie Expiry"
44
+ msgstr "Cookie истек"
45
+
46
+ #: admin/class-ctcc-admin.php:104
47
+ msgid "Cookie Version"
48
+ msgstr "Версия Cookie"
49
+
50
+ #: admin/class-ctcc-admin.php:126
51
+ msgid "Content settings"
52
+ msgstr "Настройки контента"
53
+
54
+ #: admin/class-ctcc-admin.php:133
55
+ msgid "Heading Text"
56
+ msgstr "Заголовок Текста"
57
+
58
+ #: admin/class-ctcc-admin.php:141
59
+ msgid "Notification Text"
60
+ msgstr "Текст Уведомления"
61
+
62
+ #: admin/class-ctcc-admin.php:149
63
+ msgid "More Info Text"
64
+ msgstr "Подробнее Текст"
65
+
66
+ #: admin/class-ctcc-admin.php:157
67
+ msgid "More Info Page"
68
+ msgstr "Подробнее Страница"
69
+
70
+ #: admin/class-ctcc-admin.php:165
71
+ msgid "More Info URL"
72
+ msgstr "Подробнее URL-адрес"
73
+
74
+ #: admin/class-ctcc-admin.php:173
75
+ msgid "More Info Target"
76
+ msgstr "Подробнее Target"
77
+
78
+ #: admin/class-ctcc-admin.php:181
79
+ msgid "Accept Text"
80
+ msgstr "Принять текст"
81
+
82
+ #: admin/class-ctcc-admin.php:203
83
+ msgid "Styles settings"
84
+ msgstr "Стили настройки"
85
+
86
+ #: admin/class-ctcc-admin.php:210 public/customizer.php:34
87
+ msgid "Position"
88
+ msgstr "Позиция"
89
+
90
+ #: admin/class-ctcc-admin.php:218 public/customizer.php:58
91
+ msgid "Container Class"
92
+ msgstr "Контейнер класса"
93
+
94
+ #: admin/class-ctcc-admin.php:226
95
+ msgid "Include Stylesheet"
96
+ msgstr "Включить Таблицу Стилей"
97
+
98
+ #: admin/class-ctcc-admin.php:234 public/customizer.php:90
99
+ msgid "Rounded Corners"
100
+ msgstr "Закругленные углы"
101
+
102
+ #: admin/class-ctcc-admin.php:242 public/customizer.php:106
103
+ msgid "Drop Shadow"
104
+ msgstr "Тень"
105
+
106
+ #: admin/class-ctcc-admin.php:250 public/customizer.php:122
107
+ msgid "Display Button With Text"
108
+ msgstr "Отображения кнопки с текстом"
109
+
110
+ #: admin/class-ctcc-admin.php:258 public/customizer.php:138
111
+ msgid "Use X Close"
112
+ msgstr "Используйте X Закрыть"
113
+
114
+ #: admin/class-ctcc-admin.php:266 public/customizer.php:154
115
+ msgid "Text Color"
116
+ msgstr "Цвет Текста"
117
+
118
+ #: admin/class-ctcc-admin.php:274 admin/class-ctcc-admin.php:306
119
+ #: public/customizer.php:170
120
+ msgid "Background Color"
121
+ msgstr "Цвет Фона"
122
+
123
+ #: admin/class-ctcc-admin.php:282 public/customizer.php:186
124
+ msgid "Link Color"
125
+ msgstr "Цвет Ссылок"
126
+
127
+ #: admin/class-ctcc-admin.php:290 public/customizer.php:202
128
+ msgid "Button Color"
129
+ msgstr "Цвет Кнопки"
130
+
131
+ #: admin/class-ctcc-admin.php:298 public/customizer.php:218
132
+ msgid "Button Background"
133
+ msgstr "Фон Кнопки"
134
+
135
+ #: admin/class-ctcc-admin.php:339 admin/class-ctcc-admin.php:349
136
+ msgid "Cookies"
137
+ msgstr "Cookies"
138
+
139
+ #: admin/class-ctcc-admin.php:350
140
+ msgid "This site uses cookies: "
141
+ msgstr "Этот сайт использует куки:"
142
+
143
+ #: admin/class-ctcc-admin.php:351
144
+ msgid "Okay, thanks"
145
+ msgstr "Хорошо, спасибо"
146
+
147
+ #: admin/class-ctcc-admin.php:352
148
+ msgid "Find out more."
149
+ msgstr "Узнать больше."
150
+
151
+ #: admin/class-ctcc-admin.php:411
152
+ msgid "On Click"
153
+ msgstr "При нажатии"
154
+
155
+ #: admin/class-ctcc-admin.php:412
156
+ msgid "Timed"
157
+ msgstr "Временный"
158
+
159
+ #: admin/class-ctcc-admin.php:414
160
+ msgid "How you want the user to close the notification"
161
+ msgstr "Как вы хотите, чтобы пользователь мог закрыть уведомление"
162
+
163
+ #: admin/class-ctcc-admin.php:421
164
+ msgid ""
165
+ "Select this to show the notification only on the first page the user visits"
166
+ msgstr ""
167
+ "Выберите это, чтобы показать уведомление только на первой странице "
168
+ "пользовательских посещений"
169
+
170
+ #: admin/class-ctcc-admin.php:428
171
+ msgid ""
172
+ "If you chose Timer as the close method, enter how many seconds the "
173
+ "notification should display for"
174
+ msgstr ""
175
+ "Если вы выбираете Таймер, как метод закрыть, введите в течение сколько "
176
+ "секунд уведомление должно отображаться"
177
+
178
+ #: admin/class-ctcc-admin.php:435
179
+ msgid "The number of days that the cookie is set for"
180
+ msgstr "Число дней, для которых установлен cookie"
181
+
182
+ #: admin/class-ctcc-admin.php:442
183
+ msgid ""
184
+ "A version number for the cookie - update this to invalidate the cookie and "
185
+ "force all users to view the notification again"
186
+ msgstr ""
187
+ "Номер версии для cookie - обновляет это, чтобы лишить законной силы cookie и "
188
+ "вынудить всех пользователей просмотреть уведомление снова"
189
+
190
+ #: admin/class-ctcc-admin.php:453
191
+ msgid ""
192
+ "The heading text - only applies if you are not using a top or bottom bar"
193
+ msgstr ""
194
+ "Заголовок текста - применяется только если Вы не используете верхний или "
195
+ "нижний бар"
196
+
197
+ #: admin/class-ctcc-admin.php:460
198
+ msgid "The default text to indicate that your site uses cookies"
199
+ msgstr "Текст по умолчанию, чтобы указать, что ваш сайт использует cookies"
200
+
201
+ #: admin/class-ctcc-admin.php:467
202
+ msgid "The default text to dismiss the notification"
203
+ msgstr "Текст по умолчанию, чтобы закрыть уведомление"
204
+
205
+ #: admin/class-ctcc-admin.php:474
206
+ msgid "The default text to use to link to a page providing further information"
207
+ msgstr ""
208
+ "Текст по умолчанию, чтобы использовать ссылку на страницу с изложением "
209
+ "дополнительной информации"
210
+
211
+ #: admin/class-ctcc-admin.php:490
212
+ msgid "The page containing further information about your cookie policy"
213
+ msgstr "Страница, содержащая дополнительную информацию о Вашей политике cookie"
214
+
215
+ #: admin/class-ctcc-admin.php:497
216
+ msgid ""
217
+ "You can add an absolute URL here to override the More Info Page setting "
218
+ "above. Use this to link to an external website for further information about "
219
+ "cookies."
220
+ msgstr ""
221
+ "Вы можете добавить абсолютный URL-адрес здесь, чтобы переопределить "
222
+ "Подробнее страница настройки выше. Используйте это, чтобы создать ссылку на "
223
+ "внешний веб-сайт для получения дополнительной информации о файлах cookie."
224
+
225
+ #: admin/class-ctcc-admin.php:504
226
+ msgid "New Tab"
227
+ msgstr "Новая Вкладка"
228
+
229
+ #: admin/class-ctcc-admin.php:505
230
+ msgid "Same Tab"
231
+ msgstr "Та же вкладка"
232
+
233
+ #: admin/class-ctcc-admin.php:507
234
+ msgid "Open the More Information page in the same or new tab."
235
+ msgstr "Откройте на странице \"Подробнее\" в той же или новой вкладке."
236
+
237
+ #: admin/class-ctcc-admin.php:518 public/customizer.php:36
238
+ msgid "Top Bar"
239
+ msgstr "Главная панель"
240
+
241
+ #: admin/class-ctcc-admin.php:519 public/customizer.php:37
242
+ msgid "Bottom Bar"
243
+ msgstr "Нижняя панель"
244
+
245
+ #: admin/class-ctcc-admin.php:520 public/customizer.php:38
246
+ msgid "Top Left Block"
247
+ msgstr "Верхний левый блок"
248
+
249
+ #: admin/class-ctcc-admin.php:521 public/customizer.php:39
250
+ msgid "Top Right Block"
251
+ msgstr "Верхний правый блок"
252
+
253
+ #: admin/class-ctcc-admin.php:522 public/customizer.php:40
254
+ msgid "Bottom Left Block"
255
+ msgstr "Нижний левый блок"
256
+
257
+ #: admin/class-ctcc-admin.php:523 public/customizer.php:41
258
+ msgid "Bottom Right Block"
259
+ msgstr "Нижний правый блок"
260
+
261
+ #: admin/class-ctcc-admin.php:525
262
+ msgid "Where the notification should appear"
263
+ msgstr "Где уведомление должно появиться"
264
+
265
+ #: admin/class-ctcc-admin.php:532
266
+ msgid ""
267
+ "You can add an optional wrapper class, eg container, here to align the "
268
+ "notification text with the rest of your content"
269
+ msgstr ""
270
+ "Вы можете добавить дополнительный класс обертки, например контейнер здесь, "
271
+ "чтобы выровнять текст уведомления с остальной частью Вашего содержания"
272
+
273
+ #: admin/class-ctcc-admin.php:539
274
+ msgid "Deselect this to dequeue the plugin stylesheet"
275
+ msgstr "Отключите этот плагин для извлечения стилей"
276
+
277
+ #: admin/class-ctcc-admin.php:546
278
+ msgid "Round the corners on the block (doesn't apply to the top or bottom bar)"
279
+ msgstr ""
280
+ "Закруглить углы на блоке (не применяется для верхней или нижней панели)"
281
+
282
+ #: admin/class-ctcc-admin.php:553
283
+ msgid "Add drop shadow to the block (doesn't apply to the top or bottom bar)"
284
+ msgstr "Добавление тени к блоку (не применяется для верхней или нижней панели)"
285
+
286
+ #: admin/class-ctcc-admin.php:560
287
+ msgid "Display the confirmation button with notification text"
288
+ msgstr "Выведите на экран кнопку подтверждения с текстом уведомления"
289
+
290
+ #: admin/class-ctcc-admin.php:567
291
+ msgid "Remove confirmation button and use 'X' icon instead"
292
+ msgstr "Удалите кнопку подтверждения и используйте значок 'X' вместо этого"
293
+
294
+ #: admin/class-ctcc-admin.php:574
295
+ msgid "The text color on the notification"
296
+ msgstr "Цвет текста на уведомлении"
297
+
298
+ #: admin/class-ctcc-admin.php:581
299
+ msgid "The background color for the notification"
300
+ msgstr "Цвет фона для уведомления"
301
+
302
+ #: admin/class-ctcc-admin.php:588
303
+ msgid "The link color on the notification"
304
+ msgstr "Цвет ссылки на уведомлении"
305
+
306
+ #: admin/class-ctcc-admin.php:595
307
+ msgid "The text color on the notification button"
308
+ msgstr "Цвет текста на кнопке уведомления"
309
+
310
+ #: admin/class-ctcc-admin.php:602
311
+ msgid "The background color on the notification button"
312
+ msgstr "Цвет фона на кнопке уведомления"
313
+
314
+ #: admin/class-ctcc-admin.php:607
315
+ msgid "<p>Basic settings</p>"
316
+ msgstr "<p>Основные параметры настройки</p>"
317
+
318
+ #: admin/class-ctcc-admin.php:611
319
+ msgid "<p>Update the content displayed to the user</p>"
320
+ msgstr "<p>Обновите содержание, выведенное на экран пользователю</p>"
321
+
322
+ #: admin/class-ctcc-admin.php:615
323
+ msgid ""
324
+ "<p>Change the styles here if you like - but it's better in the Customizer</p>"
325
+ msgstr ""
326
+ "<p>Измените стили здесь, если Вам нравится - но это лучше в Настройщике</p>"
327
+
328
+ #: admin/class-ctcc-admin.php:632
329
+ msgid "General"
330
+ msgstr "Общие"
331
+
332
+ #: admin/class-ctcc-admin.php:633
333
+ msgid "Content"
334
+ msgstr "Содержание"
335
+
336
+ #: admin/class-ctcc-admin.php:634
337
+ msgid "Styles"
338
+ msgstr "Стили"
339
+
340
+ #: admin/class-ctcc-admin.php:656
341
+ msgid "Reset plugin defaults"
342
+ msgstr "Сброс плагина по умолчанию"
343
+
344
+ #: public/customizer.php:43
345
+ msgid "Position and placement."
346
+ msgstr "Позиция и размещение."
347
+
348
+ #: public/customizer.php:59
349
+ msgid "Optional wrapper class."
350
+ msgstr "Дополнительный класс обертки."
351
+
352
+ #: public/customizer.php:74
353
+ msgid "Enqueue Styles"
354
+ msgstr "Добавляет Стили"
355
+
356
+ #: public/customizer.php:75
357
+ msgid "Deselect this to dequeue the plugin stylesheet."
358
+ msgstr "Отключите этот плагин для извлечения стилей."
359
+
360
+ #: public/customizer.php:91
361
+ msgid "Round the corners on the block."
362
+ msgstr "Закруглить углы на блоке."
363
+
364
+ #: public/customizer.php:107
365
+ msgid "Add drop shadow to the block."
366
+ msgstr "Добавление тени к блоку."
367
+
368
+ #: public/customizer.php:123
369
+ msgid "Deselect to float button to right."
370
+ msgstr "Снимите флажок, чтобы поплавок кнопка направо."
371
+
372
+ #: public/customizer.php:139
373
+ msgid "Replace confirmation button with 'X' icon."
374
+ msgstr "Заменить кнопку подтверждения со значком 'X'."
375
+
376
+ #: public/customizer.php:155
377
+ msgid "Text color for your notification bar."
378
+ msgstr "Цвет текста для панели уведомлений."
379
+
380
+ #: public/customizer.php:171
381
+ msgid "Background color for your notification bar."
382
+ msgstr "Цвет фона для Вашей панели уведомления."
383
+
384
+ #: public/customizer.php:187
385
+ msgid "Link color for your notification bar."
386
+ msgstr "Цвет ссылки для Вашей панели уведомления."
387
+
388
+ #: public/customizer.php:203
389
+ msgid "Text color for your notification bar button."
390
+ msgstr "Цвет текста для Вашей кнопки панели уведомления."
391
+
392
+ #: public/customizer.php:219
393
+ msgid "Background color for your notification bar button."
394
+ msgstr "Цвет фона для Вашей кнопки панели уведомления."
395
+
396
+ #: uk-cookie-consent.php:54
397
+ msgid "Cookie Policy"
398
+ msgstr "Политика cookie"
399
+
400
+ #: uk-cookie-consent.php:55
401
+ msgid ""
402
+ "This site uses cookies - small text files that are placed on your machine to "
403
+ "help the site provide a better user experience. In general, cookies are used "
404
+ "to retain user preferences, store information for things like shopping "
405
+ "carts, and provide anonymised tracking data to third party applications like "
406
+ "Google Analytics. As a rule, cookies will make your browsing experience "
407
+ "better. However, you may prefer to disable cookies on this site and on "
408
+ "others. The most effective way to do this is to disable cookies in your "
409
+ "browser. We suggest consulting the Help section of your browser or taking a "
410
+ "look at <a href=\"http://www.aboutcookies.org\">the About Cookies website</"
411
+ "a> which offers guidance for all modern browsers"
412
+ msgstr ""
413
+ "Этот сайт использует cookie - небольшие текстовые файлы, которые помещены в "
414
+ "Вашу машину, чтобы помочь сайту обеспечивать лучший пользовательский опыт. В "
415
+ "целом cookie используются, чтобы сохранить пользовательские настройки, "
416
+ "хранить информацию для вещей как магазинные тележки и обеспечить "
417
+ "анонимизированные данные отслеживания для сторонних приложений как Google "
418
+ "Analytics. Как правило cookie заставят Ваш просмотр испытать лучше. Однако "
419
+ "Вы можете предпочесть отключать cookie на этом сайте и на других. Самый "
420
+ "эффективный способ сделать это должно отключить cookie в Вашем браузере. Мы "
421
+ "предлагаем консультироваться с разделом Help Вашего браузера или смотреть на "
422
+ "<a href=\"http://www.aboutcookies.org\"> О веб-сайте Cookie , который "
423
+ "предлагает руководство для всех современных браузеров</href>"
424
+
425
+ #. Plugin URI of the plugin/theme
426
+ msgid "http://catapultthemes.com/cookie-consent/"
427
+ msgstr "http://catapultthemes.com/cookie-consent/"
428
+
429
+ #. Description of the plugin/theme
430
+ msgid "The only cookie consent plugin you'll ever need."
431
+ msgstr "Единственный cookie плагин, в котором Вы будете когда-либо нуждаться."
432
+
433
+ #. Author of the plugin/theme
434
+ msgid "Catapult_Themes"
435
+ msgstr "Catapult_Themes"
436
+
437
+ #. Author URI of the plugin/theme
438
+ msgid "http://catapultthemes.com/"
439
+ msgstr "http://catapultthemes.com/"
public/class-ctcc-public.php CHANGED
@@ -1,311 +1,316 @@
1
- <?php
2
- /*
3
- * Public class
4
- */
5
-
6
- // Exit if accessed directly
7
- if ( ! defined( 'ABSPATH' ) ) {
8
- exit;
9
- }
10
-
11
- /**
12
- * Plugin public class
13
- **/
14
- if ( ! class_exists( 'CTCC_Public' ) ) { // Don't initialise if there's already a class activated
15
-
16
- class CTCC_Public {
17
-
18
- public function __construct() {
19
- //
20
- }
21
-
22
- /*
23
- * Initialize the class and start calling our hooks and filters
24
- * @since 2.0.0
25
- */
26
- public function init() {
27
- add_action ( 'wp_enqueue_scripts', array ( $this, 'enqueue_scripts' ) );
28
- add_action ( 'wp_head', array ( $this, 'add_css' ) );
29
- add_action ( 'wp_footer', array ( $this, 'add_js' ) );
30
- add_action ( 'wp_footer', array ( $this, 'add_notification_bar' ), 1000 );
31
- }
32
-
33
- /*
34
- * Enqueue styles and scripts
35
- * @since 2.0.0
36
- */
37
- public function enqueue_scripts() {
38
- $ctcc_options_settings = get_option ( 'ctcc_options_settings' );
39
- $options = get_option ( 'ctcc_styles_settings' );
40
- if ( $options['enqueue_styles'] ) {
41
- wp_enqueue_style ( 'cookie-consent-style', CTCC_PLUGIN_URL . 'assets/css/style.css', '2.0.0' );
42
- }
43
- wp_enqueue_script ( 'cookie-consent', CTCC_PLUGIN_URL . 'assets/js/uk-cookie-consent-js.js', array ( 'jquery' ), '2.0.0', true );
44
- wp_localize_script (
45
- 'cookie-consent',
46
- 'ctcc_vars',
47
- array (
48
- 'expiry' => $ctcc_options_settings['cookie_expiry'],
49
- 'method' => isset ( $ctcc_options_settings['first_page'] ),
50
- 'version' => $ctcc_options_settings['cookie_version'],
51
- )
52
- );
53
- }
54
-
55
- /*
56
- * Add some CSS to the header
57
- * @since 2.0.0
58
- */
59
- public function add_css() {
60
-
61
- $options = get_option ( 'ctcc_options_settings' );
62
- $ctcc_styles_settings = get_option ( 'ctcc_styles_settings' );
63
-
64
- $position_css = 'position: fixed;
65
- left: 0;
66
- top: 0;
67
- width: 100%;';
68
- // Figure out the bar position
69
- if ( $ctcc_styles_settings['position'] == 'top-bar' ) {
70
- $position_css = 'position: fixed;
71
- left: 0;
72
- top: 0;
73
- width: 100%;';
74
- } else if ( $ctcc_styles_settings['position'] == 'bottom-bar' ) {
75
- $position_css = 'position: fixed;
76
- left: 0;
77
- bottom: 0;
78
- width: 100%;';
79
- } else if ( $ctcc_styles_settings['position'] == 'top-right-block' ) {
80
- $position_css = 'position: fixed;
81
- right: 20px;
82
- top: 6%;
83
- width: 300px;';
84
- } else if ( $ctcc_styles_settings['position'] == 'top-left-block' ) {
85
- $position_css = 'position: fixed;
86
- left: 20px;
87
- top: 6%;
88
- width: 300px;';
89
- } else if ( $ctcc_styles_settings['position'] == 'bottom-left-block' ) {
90
- $position_css = 'position: fixed;
91
- left: 20px;
92
- bottom: 6%;
93
- width: 300px;';
94
- } else if ( $ctcc_styles_settings['position'] == 'bottom-right-block' ) {
95
- $position_css = 'position: fixed;
96
- right: 20px;
97
- bottom: 6%;
98
- width: 300px;';
99
- }
100
- // Get our styles
101
- $text_color = $ctcc_styles_settings['text_color'];
102
- $position = 'top';
103
- $bg_color = $ctcc_styles_settings['bg_color'];
104
- $link_color = $ctcc_styles_settings['link_color'];
105
- $button_bg = $ctcc_styles_settings['button_bg_color'];
106
- $button_color = $ctcc_styles_settings['button_color'];
107
-
108
- // Build our CSS
109
- $css = '<style id="ctcc-css" type="text/css" media="screen">';
110
- $css .= '
111
- #catapult-cookie-bar {
112
- box-sizing: border-box;
113
- max-height: 0;
114
- opacity: 0;
115
- z-index: 99999;
116
- overflow: hidden;
117
- color: ' . $text_color . ';
118
- ' . $position_css . '
119
- background-color: ' . $bg_color . ';
120
- }
121
- #catapult-cookie-bar a {
122
- color: ' . $link_color . ';
123
- }
124
- button#catapultCookie {
125
- background:' . $button_bg . ';
126
- color: ' . $button_color . ';
127
- }
128
- #catapult-cookie-bar h3 {
129
- color: ' . $text_color . ';
130
- }
131
- .has-cookie-bar #catapult-cookie-bar {
132
- opacity: 1;
133
- max-height: 999px;
134
- min-height: 30px;
135
- }';
136
-
137
- $css .= '</style>';
138
-
139
- echo $css;
140
-
141
- // Add it to the header
142
-
143
- }
144
-
145
- /*
146
- * Add some JS to the footer
147
- * @since 2.0.0
148
- */
149
- public function add_js() {
150
-
151
- $options = get_option( 'ctcc_options_settings' );
152
- $ctcc_styles_settings = get_option ( 'ctcc_styles_settings' );
153
-
154
- if ( $ctcc_styles_settings['position'] == 'top-bar' || $ctcc_styles_settings['position'] == 'bottom-bar' ) {
155
- $type = 'bar';
156
- } else {
157
- $type = 'block';
158
- } ?>
159
-
160
- <script type="text/javascript">
161
- jQuery(document).ready(function($){
162
- <?php if ( isset ( $_GET['cookie'] ) ) { ?>
163
- catapultDeleteCookie('catAccCookies');
164
- <?php } ?>
165
- if(!catapultReadCookie("catAccCookies")){ // If the cookie has not been set then show the bar
166
- $("html").addClass("has-cookie-bar");
167
- $("html").addClass("cookie-bar-<?php echo $ctcc_styles_settings['position']; ?>");
168
- $("html").addClass("cookie-bar-<?php echo $type; ?>");
169
- <?php // Move the HTML down if the bar is at the top
170
- if ( $ctcc_styles_settings['position'] == 'top-bar' ) {
171
- ?>
172
- // Wait for the animation on the html to end before recalculating the required top margin
173
- $("html").on('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(e) {
174
- // code to execute after transition ends
175
- var barHeight = $('#catapult-cookie-bar').outerHeight();
176
- $("html").css("margin-top",barHeight);
177
- $("body.admin-bar").css("margin-top",barHeight-32); // Push the body down if the admin bar is active
178
- });
179
- <?php } ?>
180
- }
181
-
182
- <?php if ( $options['closure'] == 'timed' ) {
183
- // Add some script if it's on a timer
184
- $duration = absint($options['duration']) * 1000; ?>
185
- setTimeout(ctccCloseNotification, <?php echo $duration; ?>);
186
- <?php } ?>
187
- <?php if ( ! empty ( $options['first_page'] ) ) {
188
- // Add some script if the notification only displays on the first page ?>
189
- ctccFirstPage();
190
- <?php } ?>
191
- });
192
- </script>
193
-
194
- <?php }
195
-
196
- /*
197
- * Add the notification bar itself
198
- * @since 2.0.0
199
- */
200
- public function add_notification_bar() {
201
-
202
- $ctcc_options_settings = get_option ( 'ctcc_options_settings' );
203
- $ctcc_content_settings = get_option ( 'ctcc_content_settings' );
204
- $ctcc_styles_settings = get_option ( 'ctcc_styles_settings' );
205
-
206
- // Check if it's a block or a bar
207
- $is_block = true;
208
- if ( $ctcc_styles_settings['position'] == 'top-bar' || $ctcc_styles_settings['position'] == 'bottom-bar' ) {
209
- $is_block = false; // It's a bar
210
- }
211
-
212
- // Add some classes to the block
213
- $classes = '';
214
- if ( $is_block ) {
215
- if ( ! empty ( $ctcc_styles_settings['rounded_corners'] ) ) {
216
- $classes .= ' rounded-corners';
217
- }
218
- if ( ! empty ( $ctcc_styles_settings['drop_shadow'] ) ) {
219
- $classes .= ' drop-shadow';
220
- }
221
- }
222
- if ( ! empty ( $ctcc_styles_settings['x_close'] ) ) {
223
- $classes .= ' use_x_close';
224
- }
225
- if ( empty ( $ctcc_styles_settings['display_accept_with_text'] ) ) {
226
- $classes .= ' float-accept';
227
- }
228
-
229
- // Allowed tags
230
- $allowed = array (
231
- 'a' => array (
232
- 'href' => array(),
233
- 'title' => array()
234
- ),
235
- 'br' => array(),
236
- 'em' => array(),
237
- 'strong' => array(),
238
- 'p' => array()
239
- );
240
-
241
- $content = '';
242
- $close_content = '';
243
-
244
- // Print the notification bar
245
- $content = '<div id="catapult-cookie-bar" class="' . $classes . '">';
246
-
247
- // Add a custom wrapper class if specified
248
- if ( $ctcc_styles_settings['position'] == 'top-bar' || $ctcc_styles_settings['position'] == 'bottom-bar' ) {
249
- $content .= '<div class="ctcc-inner ' . esc_attr ( str_replace ( '.', '', $ctcc_styles_settings['container_class'] ) ) . '">';
250
- $close_content = '</div><!-- custom wrapper class -->';
251
- }
252
-
253
- // Add a title if it's a block
254
- if ( $ctcc_styles_settings['position'] != 'top-bar' && $ctcc_styles_settings['position'] != 'bottom-bar' ) {
255
- $content .= sprintf ( '<h3>%s</h3>',
256
- wp_kses ( $ctcc_content_settings['heading_text'], $allowed )
257
- );
258
- }
259
-
260
- // Make the Read More link
261
- $more_text = '';
262
- if ( $ctcc_content_settings['more_info_text'] ) {
263
- // Find what page we're linking to
264
- if ( ! empty ( $ctcc_content_settings['more_info_url'] ) ) {
265
- // Check the absolute URL first
266
- $link = $ctcc_content_settings['more_info_url'];
267
- } else {
268
- // Use the internal page
269
- $link = get_permalink ( $ctcc_content_settings['more_info_page'] );
270
- }
271
- $more_text = sprintf (
272
- '<a tabindex=1 target="%s" href="%s">%s</a>',
273
- esc_attr ( $ctcc_content_settings['more_info_target'] ),
274
- esc_url ( $link ),
275
- wp_kses ( $ctcc_content_settings['more_info_text'], $allowed )
276
- );
277
- }
278
-
279
- $button_text = '';
280
- if ( empty ( $ctcc_styles_settings['x_close'] ) ) {
281
- $button_text = sprintf (
282
- '<button id="catapultCookie" tabindex=1 onclick="catapultAcceptCookies();">%s</button>',
283
- wp_kses ( $ctcc_content_settings['accept_text'], $allowed )
284
- );
285
- }
286
-
287
- // The main bar content
288
- $content .= sprintf (
289
- '<span class="ctcc-left-side">%s %s</span><span class="ctcc-right-side">%s</span>',
290
- wp_kses ( $ctcc_content_settings['notification_text'], $allowed ),
291
- $more_text,
292
- $button_text
293
- );
294
-
295
- // X close button
296
- if ( ! empty ( $ctcc_styles_settings['x_close'] ) ) {
297
- $content .= '<div class="x_close"></div>';
298
- }
299
-
300
- // Close custom wrapper class if used
301
- $content .= $close_content;
302
-
303
- $content .= '</div><!-- #catapult-cookie-bar -->';
304
-
305
- echo apply_filters ( 'catapult_cookie_content', $content, $ctcc_content_settings );
306
-
307
- }
308
-
309
- }
310
-
 
 
 
 
 
311
  }
1
+ <?php
2
+ /*
3
+ * Public class
4
+ */
5
+
6
+ // Exit if accessed directly
7
+ if ( ! defined( 'ABSPATH' ) ) {
8
+ exit;
9
+ }
10
+
11
+ /**
12
+ * Plugin public class
13
+ **/
14
+ if ( ! class_exists( 'CTCC_Public' ) ) { // Don't initialise if there's already a class activated
15
+
16
+ class CTCC_Public {
17
+
18
+ public function __construct() {
19
+ //
20
+ }
21
+
22
+ /*
23
+ * Initialize the class and start calling our hooks and filters
24
+ * @since 2.0.0
25
+ */
26
+ public function init() {
27
+ add_action ( 'wp_enqueue_scripts', array ( $this, 'enqueue_scripts' ) );
28
+ add_action ( 'wp_head', array ( $this, 'add_css' ) );
29
+ add_action ( 'wp_footer', array ( $this, 'add_js' ) );
30
+ add_action ( 'wp_footer', array ( $this, 'add_notification_bar' ), 1000 );
31
+ }
32
+
33
+ /*
34
+ * Enqueue styles and scripts
35
+ * @since 2.0.0
36
+ */
37
+ public function enqueue_scripts() {
38
+ $ctcc_options_settings = get_option ( 'ctcc_options_settings' );
39
+ $options = get_option ( 'ctcc_styles_settings' );
40
+ if ( $options['enqueue_styles'] ) {
41
+ wp_enqueue_style ( 'cookie-consent-style', CTCC_PLUGIN_URL . 'assets/css/style.css', '2.0.0' );
42
+ }
43
+ wp_enqueue_script ( 'cookie-consent', CTCC_PLUGIN_URL . 'assets/js/uk-cookie-consent-js.js', array ( 'jquery' ), '2.0.0', true );
44
+ wp_localize_script (
45
+ 'cookie-consent',
46
+ 'ctcc_vars',
47
+ array (
48
+ 'expiry' => $ctcc_options_settings['cookie_expiry'],
49
+ 'method' => isset ( $ctcc_options_settings['first_page'] ),
50
+ 'version' => $ctcc_options_settings['cookie_version'],
51
+ )
52
+ );
53
+ }
54
+
55
+ /*
56
+ * Add some CSS to the header
57
+ * @since 2.0.0
58
+ */
59
+ public function add_css() {
60
+
61
+ $options = get_option ( 'ctcc_options_settings' );
62
+ $ctcc_styles_settings = get_option ( 'ctcc_styles_settings' );
63
+
64
+ $position_css = 'position: fixed;
65
+ left: 0;
66
+ top: 0;
67
+ width: 100%;';
68
+ // Figure out the bar position
69
+ if ( $ctcc_styles_settings['position'] == 'top-bar' ) {
70
+ $position_css = 'position: fixed;
71
+ left: 0;
72
+ top: 0;
73
+ width: 100%;';
74
+ } else if ( $ctcc_styles_settings['position'] == 'bottom-bar' ) {
75
+ $position_css = 'position: fixed;
76
+ left: 0;
77
+ bottom: 0;
78
+ width: 100%;';
79
+ } else if ( $ctcc_styles_settings['position'] == 'top-right-block' ) {
80
+ $position_css = 'position: fixed;
81
+ right: 20px;
82
+ top: 6%;
83
+ width: 300px;';
84
+ } else if ( $ctcc_styles_settings['position'] == 'top-left-block' ) {
85
+ $position_css = 'position: fixed;
86
+ left: 20px;
87
+ top: 6%;
88
+ width: 300px;';
89
+ } else if ( $ctcc_styles_settings['position'] == 'bottom-left-block' ) {
90
+ $position_css = 'position: fixed;
91
+ left: 20px;
92
+ bottom: 6%;
93
+ width: 300px;';
94
+ } else if ( $ctcc_styles_settings['position'] == 'bottom-right-block' ) {
95
+ $position_css = 'position: fixed;
96
+ right: 20px;
97
+ bottom: 6%;
98
+ width: 300px;';
99
+ }
100
+ // Get our styles
101
+ $text_color = $ctcc_styles_settings['text_color'];
102
+ $position = 'top';
103
+ $bg_color = $ctcc_styles_settings['bg_color'];
104
+ $link_color = $ctcc_styles_settings['link_color'];
105
+ $button_bg = $ctcc_styles_settings['button_bg_color'];
106
+ $button_color = $ctcc_styles_settings['button_color'];
107
+ if ( ! empty ( $ctcc_styles_settings['flat_button'] ) ){
108
+ $button_style = 'border: 0; padding: 6px 9px; border-radius: 3px;';
109
+ } else {
110
+ $button_style = '';
111
+ }
112
+ // Build our CSS
113
+ $css = '<style id="ctcc-css" type="text/css" media="screen">';
114
+ $css .= '
115
+ #catapult-cookie-bar {
116
+ box-sizing: border-box;
117
+ max-height: 0;
118
+ opacity: 0;
119
+ z-index: 99999;
120
+ overflow: hidden;
121
+ color: ' . $text_color . ';
122
+ ' . $position_css . '
123
+ background-color: ' . $bg_color . ';
124
+ }
125
+ #catapult-cookie-bar a {
126
+ color: ' . $link_color . ';
127
+ }
128
+ button#catapultCookie {
129
+ background:' . $button_bg . ';
130
+ color: ' . $button_color . ';
131
+ ' . $button_style . '
132
+ }
133
+ #catapult-cookie-bar h3 {
134
+ color: ' . $text_color . ';
135
+ }
136
+ .has-cookie-bar #catapult-cookie-bar {
137
+ opacity: 1;
138
+ max-height: 999px;
139
+ min-height: 30px;
140
+ }';
141
+
142
+ $css .= '</style>';
143
+
144
+ echo $css;
145
+
146
+ // Add it to the header
147
+
148
+ }
149
+
150
+ /*
151
+ * Add some JS to the footer
152
+ * @since 2.0.0
153
+ */
154
+ public function add_js() {
155
+
156
+ $options = get_option( 'ctcc_options_settings' );
157
+ $ctcc_styles_settings = get_option ( 'ctcc_styles_settings' );
158
+
159
+ if ( $ctcc_styles_settings['position'] == 'top-bar' || $ctcc_styles_settings['position'] == 'bottom-bar' ) {
160
+ $type = 'bar';
161
+ } else {
162
+ $type = 'block';
163
+ } ?>
164
+
165
+ <script type="text/javascript">
166
+ jQuery(document).ready(function($){
167
+ <?php if ( isset ( $_GET['cookie'] ) ) { ?>
168
+ catapultDeleteCookie('catAccCookies');
169
+ <?php } ?>
170
+ if(!catapultReadCookie("catAccCookies")){ // If the cookie has not been set then show the bar
171
+ $("html").addClass("has-cookie-bar");
172
+ $("html").addClass("cookie-bar-<?php echo $ctcc_styles_settings['position']; ?>");
173
+ $("html").addClass("cookie-bar-<?php echo $type; ?>");
174
+ <?php // Move the HTML down if the bar is at the top
175
+ if ( $ctcc_styles_settings['position'] == 'top-bar' ) {
176
+ ?>
177
+ // Wait for the animation on the html to end before recalculating the required top margin
178
+ $("html").on('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(e) {
179
+ // code to execute after transition ends
180
+ var barHeight = $('#catapult-cookie-bar').outerHeight();
181
+ $("html").css("margin-top",barHeight);
182
+ $("body.admin-bar").css("margin-top",barHeight-32); // Push the body down if the admin bar is active
183
+ });
184
+ <?php } ?>
185
+ }
186
+
187
+ <?php if ( $options['closure'] == 'timed' ) {
188
+ // Add some script if it's on a timer
189
+ $duration = absint($options['duration']) * 1000; ?>
190
+ setTimeout(ctccCloseNotification, <?php echo $duration; ?>);
191
+ <?php } ?>
192
+ <?php if ( ! empty ( $options['first_page'] ) ) {
193
+ // Add some script if the notification only displays on the first page ?>
194
+ ctccFirstPage();
195
+ <?php } ?>
196
+ });
197
+ </script>
198
+
199
+ <?php }
200
+
201
+ /*
202
+ * Add the notification bar itself
203
+ * @since 2.0.0
204
+ */
205
+ public function add_notification_bar() {
206
+
207
+ $ctcc_options_settings = get_option ( 'ctcc_options_settings' );
208
+ $ctcc_content_settings = get_option ( 'ctcc_content_settings' );
209
+ $ctcc_styles_settings = get_option ( 'ctcc_styles_settings' );
210
+
211
+ // Check if it's a block or a bar
212
+ $is_block = true;
213
+ if ( $ctcc_styles_settings['position'] == 'top-bar' || $ctcc_styles_settings['position'] == 'bottom-bar' ) {
214
+ $is_block = false; // It's a bar
215
+ }
216
+
217
+ // Add some classes to the block
218
+ $classes = '';
219
+ if ( $is_block ) {
220
+ if ( ! empty ( $ctcc_styles_settings['rounded_corners'] ) ) {
221
+ $classes .= ' rounded-corners';
222
+ }
223
+ if ( ! empty ( $ctcc_styles_settings['drop_shadow'] ) ) {
224
+ $classes .= ' drop-shadow';
225
+ }
226
+ }
227
+ if ( ! empty ( $ctcc_styles_settings['x_close'] ) ) {
228
+ $classes .= ' use_x_close';
229
+ }
230
+ if ( empty ( $ctcc_styles_settings['display_accept_with_text'] ) ) {
231
+ $classes .= ' float-accept';
232
+ }
233
+
234
+ // Allowed tags
235
+ $allowed = array (
236
+ 'a' => array (
237
+ 'href' => array(),
238
+ 'title' => array()
239
+ ),
240
+ 'br' => array(),
241
+ 'em' => array(),
242
+ 'strong' => array(),
243
+ 'p' => array()
244
+ );
245
+
246
+ $content = '';
247
+ $close_content = '';
248
+
249
+ // Print the notification bar
250
+ $content = '<div id="catapult-cookie-bar" class="' . $classes . '">';
251
+
252
+ // Add a custom wrapper class if specified
253
+ if ( $ctcc_styles_settings['position'] == 'top-bar' || $ctcc_styles_settings['position'] == 'bottom-bar' ) {
254
+ $content .= '<div class="ctcc-inner ' . esc_attr ( str_replace ( '.', '', $ctcc_styles_settings['container_class'] ) ) . '">';
255
+ $close_content = '</div><!-- custom wrapper class -->';
256
+ }
257
+
258
+ // Add a title if it's a block
259
+ if ( $ctcc_styles_settings['position'] != 'top-bar' && $ctcc_styles_settings['position'] != 'bottom-bar' ) {
260
+ $content .= sprintf ( '<h3>%s</h3>',
261
+ wp_kses ( $ctcc_content_settings['heading_text'], $allowed )
262
+ );
263
+ }
264
+
265
+ // Make the Read More link
266
+ $more_text = '';
267
+ if ( $ctcc_content_settings['more_info_text'] ) {
268
+ // Find what page we're linking to
269
+ if ( ! empty ( $ctcc_content_settings['more_info_url'] ) ) {
270
+ // Check the absolute URL first
271
+ $link = $ctcc_content_settings['more_info_url'];
272
+ } else {
273
+ // Use the internal page
274
+ $link = get_permalink ( $ctcc_content_settings['more_info_page'] );
275
+ }
276
+ $more_text = sprintf (
277
+ '<a tabindex=1 target="%s" href="%s">%s</a>',
278
+ esc_attr ( $ctcc_content_settings['more_info_target'] ),
279
+ esc_url ( $link ),
280
+ wp_kses ( $ctcc_content_settings['more_info_text'], $allowed )
281
+ );
282
+ }
283
+
284
+ $button_text = '';
285
+ if ( empty ( $ctcc_styles_settings['x_close'] ) ) {
286
+ $button_text = sprintf (
287
+ '<button id="catapultCookie" tabindex=1 onclick="catapultAcceptCookies();">%s</button>',
288
+ wp_kses ( $ctcc_content_settings['accept_text'], $allowed )
289
+ );
290
+ }
291
+
292
+ // The main bar content
293
+ $content .= sprintf (
294
+ '<span class="ctcc-left-side">%s %s</span><span class="ctcc-right-side">%s</span>',
295
+ wp_kses ( $ctcc_content_settings['notification_text'], $allowed ),
296
+ $more_text,
297
+ $button_text
298
+ );
299
+
300
+ // X close button
301
+ if ( ! empty ( $ctcc_styles_settings['x_close'] ) ) {
302
+ $content .= '<div class="x_close"></div>';
303
+ }
304
+
305
+ // Close custom wrapper class if used
306
+ $content .= $close_content;
307
+
308
+ $content .= '</div><!-- #catapult-cookie-bar -->';
309
+
310
+ echo apply_filters ( 'catapult_cookie_content', $content, $ctcc_content_settings );
311
+
312
+ }
313
+
314
+ }
315
+
316
  }
public/customizer.php CHANGED
@@ -1,222 +1,238 @@
1
- <?php
2
- /*
3
- * Customizer
4
- */
5
-
6
- // Exit if accessed directly
7
- if ( ! defined( 'ABSPATH' ) ) {
8
- exit;
9
- }
10
-
11
- function ctcc_customize_register( $wp_customize ) {
12
- // Do stuff with $wp_customize, the WP_Customize_Manager object.
13
- //$options = get_option( 'ctcc_styles_settings' );
14
- //echo $options['text_color'];
15
-
16
- $wp_customize -> add_section ( 'cctc', array (
17
- 'title' => __( 'Cookie Consent', 'uk-cookie-consent' ),
18
- 'priority' => 999
19
- ) );
20
-
21
- $wp_customize -> add_setting( 'ctcc_styles_settings[position]', array(
22
- 'type' => 'option', // or 'option'
23
- 'capability' => 'edit_theme_options',
24
- 'theme_supports' => '', // Rarely needed.
25
- 'default' => '',
26
- 'transport' => 'refresh', // or postMessage
27
- 'sanitize_callback' => '',
28
- 'sanitize_js_callback' => '', // Basically to_json.
29
- ) );
30
- $wp_customize -> add_control( 'ctcc_styles_settings[position]', array(
31
- 'type' => 'select',
32
- 'priority' => 1, // Within the section.
33
- 'section' => 'cctc', // Required, core or custom.
34
- 'label' => __( 'Position', 'uk-cookie-consent' ),
35
- 'choices' => array (
36
- 'top-bar' => __( 'Top Bar', 'uk-cookie-consent' ),
37
- 'bottom-bar' => __( 'Bottom Bar', 'uk-cookie-consent' ),
38
- 'top-left-block' => __( 'Top Left Block', 'uk-cookie-consent' ),
39
- 'top-right-block' => __( 'Top Right Block', 'uk-cookie-consent' ),
40
- 'bottom-left-block' => __( 'Bottom Left Block', 'uk-cookie-consent' ),
41
- 'bottom-right-block' => __( 'Bottom Right Block', 'uk-cookie-consent' ),
42
- ),
43
- 'description' => __( 'Position and placement.', 'uk-cookie-consent' )
44
- ) );
45
- $wp_customize -> add_setting( 'ctcc_styles_settings[container_class]', array(
46
- 'type' => 'option', // or 'option'
47
- 'capability' => 'edit_theme_options',
48
- 'theme_supports' => '', // Rarely needed.
49
- 'default' => '',
50
- 'transport' => 'refresh', // or postMessage
51
- 'sanitize_callback' => '',
52
- 'sanitize_js_callback' => '', // Basically to_json.
53
- ) );
54
- $wp_customize -> add_control( 'ctcc_styles_settings[container_class]', array(
55
- 'type' => 'text',
56
- 'priority' => 2, // Within the section.
57
- 'section' => 'cctc', // Required, core or custom.
58
- 'label' => __( 'Container Class', 'uk-cookie-consent' ),
59
- 'description' => __( 'Optional wrapper class.', 'uk-cookie-consent' )
60
- ) );
61
- $wp_customize -> add_setting( 'ctcc_styles_settings[enqueue_styles]', array(
62
- 'type' => 'option', // or 'option'
63
- 'capability' => 'edit_theme_options',
64
- 'theme_supports' => '', // Rarely needed.
65
- 'default' => '',
66
- 'transport' => 'refresh', // or postMessage
67
- 'sanitize_callback' => '',
68
- 'sanitize_js_callback' => '', // Basically to_json.
69
- ) );
70
- $wp_customize -> add_control( 'ctcc_styles_settings[enqueue_styles]', array(
71
- 'type' => 'checkbox',
72
- 'priority' => 4, // Within the section.
73
- 'section' => 'cctc', // Required, core or custom.
74
- 'label' => __( 'Enqueue Styles', 'uk-cookie-consent' ),
75
- 'description' => __( 'Deselect this to dequeue the plugin stylesheet.', 'uk-cookie-consent' )
76
- ) );
77
- $wp_customize -> add_setting( 'ctcc_styles_settings[rounded_corners]', array(
78
- 'type' => 'option', // or 'option'
79
- 'capability' => 'edit_theme_options',
80
- 'theme_supports' => '', // Rarely needed.
81
- 'default' => '',
82
- 'transport' => 'refresh', // or postMessage
83
- 'sanitize_callback' => '',
84
- 'sanitize_js_callback' => '', // Basically to_json.
85
- ) );
86
- $wp_customize -> add_control( 'ctcc_styles_settings[rounded_corners]', array(
87
- 'type' => 'checkbox',
88
- 'priority' => 6, // Within the section.
89
- 'section' => 'cctc', // Required, core or custom.
90
- 'label' => __( 'Rounded Corners', 'uk-cookie-consent' ),
91
- 'description' => __( 'Round the corners on the block.', 'uk-cookie-consent' )
92
- ) );
93
- $wp_customize -> add_setting( 'ctcc_styles_settings[drop_shadow]', array(
94
- 'type' => 'option', // or 'option'
95
- 'capability' => 'edit_theme_options',
96
- 'theme_supports' => '', // Rarely needed.
97
- 'default' => '',
98
- 'transport' => 'refresh', // or postMessage
99
- 'sanitize_callback' => '',
100
- 'sanitize_js_callback' => '', // Basically to_json.
101
- ) );
102
- $wp_customize -> add_control( 'ctcc_styles_settings[drop_shadow]', array(
103
- 'type' => 'checkbox',
104
- 'priority' => 8, // Within the section.
105
- 'section' => 'cctc', // Required, core or custom.
106
- 'label' => __( 'Drop Shadow', 'uk-cookie-consent' ),
107
- 'description' => __( 'Add drop shadow to the block.', 'uk-cookie-consent' )
108
- ) );
109
- $wp_customize -> add_setting( 'ctcc_styles_settings[display_accept_with_text]', array(
110
- 'type' => 'option', // or 'option'
111
- 'capability' => 'edit_theme_options',
112
- 'theme_supports' => '', // Rarely needed.
113
- 'default' => '',
114
- 'transport' => 'refresh', // or postMessage
115
- 'sanitize_callback' => '',
116
- 'sanitize_js_callback' => '', // Basically to_json.
117
- ) );
118
- $wp_customize -> add_control( 'ctcc_styles_settings[display_accept_with_text]', array(
119
- 'type' => 'checkbox',
120
- 'priority' => 9, // Within the section.
121
- 'section' => 'cctc', // Required, core or custom.
122
- 'label' => __( 'Display Button With Text', 'uk-cookie-consent' ),
123
- 'description' => __( 'Deselect to float button to right.', 'uk-cookie-consent' )
124
- ) );
125
- $wp_customize -> add_setting( 'ctcc_styles_settings[x_close]', array(
126
- 'type' => 'option', // or 'option'
127
- 'capability' => 'edit_theme_options',
128
- 'theme_supports' => '', // Rarely needed.
129
- 'default' => '',
130
- 'transport' => 'refresh', // or postMessage
131
- 'sanitize_callback' => '',
132
- 'sanitize_js_callback' => '', // Basically to_json.
133
- ) );
134
- $wp_customize -> add_control( 'ctcc_styles_settings[x_close]', array(
135
- 'type' => 'checkbox',
136
- 'priority' => 10, // Within the section.
137
- 'section' => 'cctc', // Required, core or custom.
138
- 'label' => __( 'Use X Close', 'uk-cookie-consent' ),
139
- 'description' => __( 'Replace confirmation button with \'X\' icon.', 'uk-cookie-consent' )
140
- ) );
141
- $wp_customize -> add_setting( 'ctcc_styles_settings[text_color]', array(
142
- 'type' => 'option', // or 'option'
143
- 'capability' => 'edit_theme_options',
144
- 'theme_supports' => '', // Rarely needed.
145
- 'default' => '',
146
- 'transport' => 'refresh', // or postMessage
147
- 'sanitize_callback' => '',
148
- 'sanitize_js_callback' => '', // Basically to_json.
149
- ) );
150
- $wp_customize -> add_control( 'ctcc_styles_settings[text_color]', array(
151
- 'type' => 'color',
152
- 'priority' => 15, // Within the section.
153
- 'section' => 'cctc', // Required, core or custom.
154
- 'label' => __( 'Text Color', 'uk-cookie-consent' ),
155
- 'description' => __( 'Text color for your notification bar.', 'uk-cookie-consent' )
156
- ) );
157
- $wp_customize -> add_setting( 'ctcc_styles_settings[bg_color]', array(
158
- 'type' => 'option', // or 'option'
159
- 'capability' => 'edit_theme_options',
160
- 'theme_supports' => '', // Rarely needed.
161
- 'default' => '',
162
- 'transport' => 'refresh', // or postMessage
163
- 'sanitize_callback' => '',
164
- 'sanitize_js_callback' => '', // Basically to_json.
165
- ) );
166
- $wp_customize -> add_control( 'ctcc_styles_settings[bg_color]', array(
167
- 'type' => 'color',
168
- 'priority' => 20, // Within the section.
169
- 'section' => 'cctc', // Required, core or custom.
170
- 'label' => __( 'Background Color', 'uk-cookie-consent' ),
171
- 'description' => __( 'Background color for your notification bar.', 'uk-cookie-consent' )
172
- ) );
173
- $wp_customize -> add_setting( 'ctcc_styles_settings[link_color]', array(
174
- 'type' => 'option', // or 'option'
175
- 'capability' => 'edit_theme_options',
176
- 'theme_supports' => '', // Rarely needed.
177
- 'default' => '',
178
- 'transport' => 'refresh', // or postMessage
179
- 'sanitize_callback' => '',
180
- 'sanitize_js_callback' => '', // Basically to_json.
181
- ) );
182
- $wp_customize -> add_control( 'ctcc_styles_settings[link_color]', array(
183
- 'type' => 'color',
184
- 'priority' => 30, // Within the section.
185
- 'section' => 'cctc', // Required, core or custom.
186
- 'label' => __( 'Link Color', 'uk-cookie-consent' ),
187
- 'description' => __( 'Link color for your notification bar.', 'uk-cookie-consent' )
188
- ) );
189
- $wp_customize -> add_setting( 'ctcc_styles_settings[button_color]', array(
190
- 'type' => 'option', // or 'option'
191
- 'capability' => 'edit_theme_options',
192
- 'theme_supports' => '', // Rarely needed.
193
- 'default' => '',
194
- 'transport' => 'refresh', // or postMessage
195
- 'sanitize_callback' => '',
196
- 'sanitize_js_callback' => '', // Basically to_json.
197
- ) );
198
- $wp_customize -> add_control( 'ctcc_styles_settings[button_color]', array(
199
- 'type' => 'color',
200
- 'priority' => 40, // Within the section.
201
- 'section' => 'cctc', // Required, core or custom.
202
- 'label' => __( 'Button Color', 'uk-cookie-consent' ),
203
- 'description' => __( 'Text color for your notification bar button.', 'uk-cookie-consent' )
204
- ) );
205
- $wp_customize -> add_setting( 'ctcc_styles_settings[button_bg_color]', array(
206
- 'type' => 'option', // or 'option'
207
- 'capability' => 'edit_theme_options',
208
- 'theme_supports' => '', // Rarely needed.
209
- 'default' => '',
210
- 'transport' => 'refresh', // or postMessage
211
- 'sanitize_callback' => '',
212
- 'sanitize_js_callback' => '', // Basically to_json.
213
- ) );
214
- $wp_customize -> add_control( 'ctcc_styles_settings[button_bg_color]', array(
215
- 'type' => 'color',
216
- 'priority' => 50, // Within the section.
217
- 'section' => 'cctc', // Required, core or custom.
218
- 'label' => __( 'Button Background', 'uk-cookie-consent' ),
219
- 'description' => __( 'Background color for your notification bar button.', 'uk-cookie-consent' )
220
- ) );
221
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  add_action( 'customize_register', 'ctcc_customize_register' );
1
+ <?php
2
+ /*
3
+ * Customizer
4
+ */
5
+
6
+ // Exit if accessed directly
7
+ if ( ! defined( 'ABSPATH' ) ) {
8
+ exit;
9
+ }
10
+
11
+ function ctcc_customize_register( $wp_customize ) {
12
+ // Do stuff with $wp_customize, the WP_Customize_Manager object.
13
+ //$options = get_option( 'ctcc_styles_settings' );
14
+ //echo $options['text_color'];
15
+
16
+ $wp_customize -> add_section ( 'cctc', array (
17
+ 'title' => __( 'Cookie Consent', 'uk-cookie-consent' ),
18
+ 'priority' => 999
19
+ ) );
20
+
21
+ $wp_customize -> add_setting( 'ctcc_styles_settings[position]', array(
22
+ 'type' => 'option', // or 'option'
23
+ 'capability' => 'edit_theme_options',
24
+ 'theme_supports' => '', // Rarely needed.
25
+ 'default' => '',
26
+ 'transport' => 'refresh', // or postMessage
27
+ 'sanitize_callback' => '',
28
+ 'sanitize_js_callback' => '', // Basically to_json.
29
+ ) );
30
+ $wp_customize -> add_control( 'ctcc_styles_settings[position]', array(
31
+ 'type' => 'select',
32
+ 'priority' => 1, // Within the section.
33
+ 'section' => 'cctc', // Required, core or custom.
34
+ 'label' => __( 'Position', 'uk-cookie-consent' ),
35
+ 'choices' => array (
36
+ 'top-bar' => __( 'Top Bar', 'uk-cookie-consent' ),
37
+ 'bottom-bar' => __( 'Bottom Bar', 'uk-cookie-consent' ),
38
+ 'top-left-block' => __( 'Top Left Block', 'uk-cookie-consent' ),
39
+ 'top-right-block' => __( 'Top Right Block', 'uk-cookie-consent' ),
40
+ 'bottom-left-block' => __( 'Bottom Left Block', 'uk-cookie-consent' ),
41
+ 'bottom-right-block' => __( 'Bottom Right Block', 'uk-cookie-consent' ),
42
+ ),
43
+ 'description' => __( 'Position and placement.', 'uk-cookie-consent' )
44
+ ) );
45
+ $wp_customize -> add_setting( 'ctcc_styles_settings[container_class]', array(
46
+ 'type' => 'option', // or 'option'
47
+ 'capability' => 'edit_theme_options',
48
+ 'theme_supports' => '', // Rarely needed.
49
+ 'default' => '',
50
+ 'transport' => 'refresh', // or postMessage
51
+ 'sanitize_callback' => '',
52
+ 'sanitize_js_callback' => '', // Basically to_json.
53
+ ) );
54
+ $wp_customize -> add_control( 'ctcc_styles_settings[container_class]', array(
55
+ 'type' => 'text',
56
+ 'priority' => 2, // Within the section.
57
+ 'section' => 'cctc', // Required, core or custom.
58
+ 'label' => __( 'Container Class', 'uk-cookie-consent' ),
59
+ 'description' => __( 'Optional wrapper class.', 'uk-cookie-consent' )
60
+ ) );
61
+ $wp_customize -> add_setting( 'ctcc_styles_settings[enqueue_styles]', array(
62
+ 'type' => 'option', // or 'option'
63
+ 'capability' => 'edit_theme_options',
64
+ 'theme_supports' => '', // Rarely needed.
65
+ 'default' => '',
66
+ 'transport' => 'refresh', // or postMessage
67
+ 'sanitize_callback' => '',
68
+ 'sanitize_js_callback' => '', // Basically to_json.
69
+ ) );
70
+ $wp_customize -> add_control( 'ctcc_styles_settings[enqueue_styles]', array(
71
+ 'type' => 'checkbox',
72
+ 'priority' => 4, // Within the section.
73
+ 'section' => 'cctc', // Required, core or custom.
74
+ 'label' => __( 'Enqueue Styles', 'uk-cookie-consent' ),
75
+ 'description' => __( 'Deselect this to dequeue the plugin stylesheet.', 'uk-cookie-consent' )
76
+ ) );
77
+ $wp_customize -> add_setting( 'ctcc_styles_settings[rounded_corners]', array(
78
+ 'type' => 'option', // or 'option'
79
+ 'capability' => 'edit_theme_options',
80
+ 'theme_supports' => '', // Rarely needed.
81
+ 'default' => '',
82
+ 'transport' => 'refresh', // or postMessage
83
+ 'sanitize_callback' => '',
84
+ 'sanitize_js_callback' => '', // Basically to_json.
85
+ ) );
86
+ $wp_customize -> add_control( 'ctcc_styles_settings[rounded_corners]', array(
87
+ 'type' => 'checkbox',
88
+ 'priority' => 6, // Within the section.
89
+ 'section' => 'cctc', // Required, core or custom.
90
+ 'label' => __( 'Rounded Corners', 'uk-cookie-consent' ),
91
+ 'description' => __( 'Round the corners on the block.', 'uk-cookie-consent' )
92
+ ) );
93
+ $wp_customize -> add_setting( 'ctcc_styles_settings[drop_shadow]', array(
94
+ 'type' => 'option', // or 'option'
95
+ 'capability' => 'edit_theme_options',
96
+ 'theme_supports' => '', // Rarely needed.
97
+ 'default' => '',
98
+ 'transport' => 'refresh', // or postMessage
99
+ 'sanitize_callback' => '',
100
+ 'sanitize_js_callback' => '', // Basically to_json.
101
+ ) );
102
+ $wp_customize -> add_control( 'ctcc_styles_settings[drop_shadow]', array(
103
+ 'type' => 'checkbox',
104
+ 'priority' => 8, // Within the section.
105
+ 'section' => 'cctc', // Required, core or custom.
106
+ 'label' => __( 'Drop Shadow', 'uk-cookie-consent' ),
107
+ 'description' => __( 'Add drop shadow to the block.', 'uk-cookie-consent' )
108
+ ) );
109
+ $wp_customize -> add_setting( 'ctcc_styles_settings[display_accept_with_text]', array(
110
+ 'type' => 'option', // or 'option'
111
+ 'capability' => 'edit_theme_options',
112
+ 'theme_supports' => '', // Rarely needed.
113
+ 'default' => '',
114
+ 'transport' => 'refresh', // or postMessage
115
+ 'sanitize_callback' => '',
116
+ 'sanitize_js_callback' => '', // Basically to_json.
117
+ ) );
118
+ $wp_customize -> add_control( 'ctcc_styles_settings[display_accept_with_text]', array(
119
+ 'type' => 'checkbox',
120
+ 'priority' => 9, // Within the section.
121
+ 'section' => 'cctc', // Required, core or custom.
122
+ 'label' => __( 'Display Button With Text', 'uk-cookie-consent' ),
123
+ 'description' => __( 'Deselect to float button to right.', 'uk-cookie-consent' )
124
+ ) );
125
+ $wp_customize -> add_setting( 'ctcc_styles_settings[x_close]', array(
126
+ 'type' => 'option', // or 'option'
127
+ 'capability' => 'edit_theme_options',
128
+ 'theme_supports' => '', // Rarely needed.
129
+ 'default' => '',
130
+ 'transport' => 'refresh', // or postMessage
131
+ 'sanitize_callback' => '',
132
+ 'sanitize_js_callback' => '', // Basically to_json.
133
+ ) );
134
+ $wp_customize -> add_control( 'ctcc_styles_settings[x_close]', array(
135
+ 'type' => 'checkbox',
136
+ 'priority' => 10, // Within the section.
137
+ 'section' => 'cctc', // Required, core or custom.
138
+ 'label' => __( 'Use X Close', 'uk-cookie-consent' ),
139
+ 'description' => __( 'Replace confirmation button with \'X\' icon.', 'uk-cookie-consent' )
140
+ ) );
141
+ $wp_customize -> add_setting( 'ctcc_styles_settings[text_color]', array(
142
+ 'type' => 'option', // or 'option'
143
+ 'capability' => 'edit_theme_options',
144
+ 'theme_supports' => '', // Rarely needed.
145
+ 'default' => '',
146
+ 'transport' => 'refresh', // or postMessage
147
+ 'sanitize_callback' => '',
148
+ 'sanitize_js_callback' => '', // Basically to_json.
149
+ ) );
150
+ $wp_customize -> add_control( 'ctcc_styles_settings[text_color]', array(
151
+ 'type' => 'color',
152
+ 'priority' => 15, // Within the section.
153
+ 'section' => 'cctc', // Required, core or custom.
154
+ 'label' => __( 'Text Color', 'uk-cookie-consent' ),
155
+ 'description' => __( 'Text color for your notification bar.', 'uk-cookie-consent' )
156
+ ) );
157
+ $wp_customize -> add_setting( 'ctcc_styles_settings[bg_color]', array(
158
+ 'type' => 'option', // or 'option'
159
+ 'capability' => 'edit_theme_options',
160
+ 'theme_supports' => '', // Rarely needed.
161
+ 'default' => '',
162
+ 'transport' => 'refresh', // or postMessage
163
+ 'sanitize_callback' => '',
164
+ 'sanitize_js_callback' => '', // Basically to_json.
165
+ ) );
166
+ $wp_customize -> add_control( 'ctcc_styles_settings[bg_color]', array(
167
+ 'type' => 'color',
168
+ 'priority' => 20, // Within the section.
169
+ 'section' => 'cctc', // Required, core or custom.
170
+ 'label' => __( 'Background Color', 'uk-cookie-consent' ),
171
+ 'description' => __( 'Background color for your notification bar.', 'uk-cookie-consent' )
172
+ ) );
173
+ $wp_customize -> add_setting( 'ctcc_styles_settings[link_color]', array(
174
+ 'type' => 'option', // or 'option'
175
+ 'capability' => 'edit_theme_options',
176
+ 'theme_supports' => '', // Rarely needed.
177
+ 'default' => '',
178
+ 'transport' => 'refresh', // or postMessage
179
+ 'sanitize_callback' => '',
180
+ 'sanitize_js_callback' => '', // Basically to_json.
181
+ ) );
182
+ $wp_customize -> add_control( 'ctcc_styles_settings[link_color]', array(
183
+ 'type' => 'color',
184
+ 'priority' => 30, // Within the section.
185
+ 'section' => 'cctc', // Required, core or custom.
186
+ 'label' => __( 'Link Color', 'uk-cookie-consent' ),
187
+ 'description' => __( 'Link color for your notification bar.', 'uk-cookie-consent' )
188
+ ) );
189
+ $wp_customize -> add_setting( 'ctcc_styles_settings[button_color]', array(
190
+ 'type' => 'option', // or 'option'
191
+ 'capability' => 'edit_theme_options',
192
+ 'theme_supports' => '', // Rarely needed.
193
+ 'default' => '',
194
+ 'transport' => 'refresh', // or postMessage
195
+ 'sanitize_callback' => '',
196
+ 'sanitize_js_callback' => '', // Basically to_json.
197
+ ) );
198
+ $wp_customize -> add_control( 'ctcc_styles_settings[button_color]', array(
199
+ 'type' => 'color',
200
+ 'priority' => 40, // Within the section.
201
+ 'section' => 'cctc', // Required, core or custom.
202
+ 'label' => __( 'Button Color', 'uk-cookie-consent' ),
203
+ 'description' => __( 'Text color for your notification bar button.', 'uk-cookie-consent' )
204
+ ) );
205
+ $wp_customize -> add_setting( 'ctcc_styles_settings[button_bg_color]', array(
206
+ 'type' => 'option', // or 'option'
207
+ 'capability' => 'edit_theme_options',
208
+ 'theme_supports' => '', // Rarely needed.
209
+ 'default' => '',
210
+ 'transport' => 'refresh', // or postMessage
211
+ 'sanitize_callback' => '',
212
+ 'sanitize_js_callback' => '', // Basically to_json.
213
+ ) );
214
+ $wp_customize -> add_control( 'ctcc_styles_settings[button_bg_color]', array(
215
+ 'type' => 'color',
216
+ 'priority' => 50, // Within the section.
217
+ 'section' => 'cctc', // Required, core or custom.
218
+ 'label' => __( 'Button Background', 'uk-cookie-consent' ),
219
+ 'description' => __( 'Background color for your notification bar button.', 'uk-cookie-consent' )
220
+ ) );
221
+ $wp_customize -> add_setting( 'ctcc_styles_settings[flat_button]', array(
222
+ 'type' => 'option', // or 'option'
223
+ 'capability' => 'edit_theme_options',
224
+ 'theme_supports' => '', // Rarely needed.
225
+ 'default' => '',
226
+ 'transport' => 'refresh', // or postMessage
227
+ 'sanitize_callback' => '',
228
+ 'sanitize_js_callback' => '', // Basically to_json.
229
+ ) );
230
+ $wp_customize -> add_control( 'ctcc_styles_settings[flat_button]', array(
231
+ 'type' => 'checkbox',
232
+ 'priority' => 60, // Within the section.
233
+ 'section' => 'cctc', // Required, core or custom.
234
+ 'label' => __( 'Flat Button', 'uk-cookie-consent' ),
235
+ 'description' => __( 'Deselect to inherit button styles from the theme.', 'uk-cookie-consent' )
236
+ ) );
237
+ }
238
  add_action( 'customize_register', 'ctcc_customize_register' );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate Link: https://paypal.com
4
  Tags: cookie law, cookies, EU, implied consent, uk cookie consent, compliance, eu cookie law, eu privacy directive, privacy, privacy directive, consent, cookie, cookie compliance, cookie law, eu cookie, notice, notification, notify, cookie notice, cookie notification, cookie notify
5
  Requires at least: 4.3
6
  Tested up to: 4.4.1
7
- Stable tag: 2.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -34,6 +34,11 @@ We've extended the options with the plugin and in version 2.0, we've added many
34
  * Set the cookie duration
35
  * Set the cookie version - updating a version will reset the cookie on all user sites
36
 
 
 
 
 
 
37
  = EU Directive =
38
 
39
  We think this is the simplest but most effective method of dealing with the legislation.
@@ -76,6 +81,10 @@ You will find more details of the regulations on the [Information Commissioner's
76
 
77
  == Changelog ==
78
 
 
 
 
 
79
  = 2.0.5 =
80
  * Fixed: notification hides correctly when stylesheet is dequeued
81
 
4
  Tags: cookie law, cookies, EU, implied consent, uk cookie consent, compliance, eu cookie law, eu privacy directive, privacy, privacy directive, consent, cookie, cookie compliance, cookie law, eu cookie, notice, notification, notify, cookie notice, cookie notification, cookie notify
5
  Requires at least: 4.3
6
  Tested up to: 4.4.1
7
+ Stable tag: 2.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
34
  * Set the cookie duration
35
  * Set the cookie version - updating a version will reset the cookie on all user sites
36
 
37
+ = Translations =
38
+
39
+ * Polish
40
+ * Russian
41
+
42
  = EU Directive =
43
 
44
  We think this is the simplest but most effective method of dealing with the legislation.
81
 
82
  == Changelog ==
83
 
84
+ = 2.0.6 =
85
+ * Added: flat button option
86
+ * Added: Russian translation
87
+
88
  = 2.0.5 =
89
  * Fixed: notification hides correctly when stylesheet is dequeued
90
 
uk-cookie-consent.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Cookie Consent
4
  Plugin URI: http://catapultthemes.com/cookie-consent/
5
  Description: The only cookie consent plugin you'll ever need.
6
- Version: 2.0.5
7
  Author: Catapult_Themes
8
  Author URI: http://catapultthemes.com/
9
  Text Domain: uk-cookie-consent
3
  Plugin Name: Cookie Consent
4
  Plugin URI: http://catapultthemes.com/cookie-consent/
5
  Description: The only cookie consent plugin you'll ever need.
6
+ Version: 2.0.6
7
  Author: Catapult_Themes
8
  Author URI: http://catapultthemes.com/
9
  Text Domain: uk-cookie-consent