Version Description
Release Date: June 24th, 2015
Dev time: 100h
- New file structure
- Removed scroll event on cookie policy page
- Fixed compatibility to pre WP 4.1
- Added scripts allowed in body
- Added dumb regex for custom javascript
<script src="/assets/js/<---------SOMETHING--------->.js" ></script>
- Fixed dialog off-screen in mobile devices
- Fixed typo
- Fixed fallback color for Text & BG in banner
- Added multilingual support only for banner
- Added uninstall.php
- Added text area for custom CSS
- Added input for custom CSS class
- Added filter
icc_output_html
on snippet output for developer
Download this release
Release Info
Developer | overclokk |
Plugin | Italy Cookie Choices (for EU Cookie Law) |
Version | 2.2.0 |
Comparing to | |
See all releases |
Code changes from version 2.1.0 to 2.2.0
- admin/class-italy-cookie-choices-admin.php +1192 -0
- admin/class-italy-cookie-choices-sanitize.php +123 -0
- admin/index.php +1 -0
- admin/js/index.php +1 -0
- admin/js/src/index.php +1 -0
- classes/class-italy-cookie-choices-front-end.php +694 -0
- includes/functions-italy-cookie-choices-lang.php +102 -0
- index.php +1 -0
- italy-cookie-choices.php +107 -1405
- js/bigbutton/cookiechoices.js +45 -35
- js/bigbutton/cookiechoices.php +1 -1
- js/bigbutton/index.php +1 -0
- js/custom/cookiechoices.js +314 -0
- js/custom/cookiechoices.php +0 -0
- js/default/cookiechoices.js +45 -34
- js/default/cookiechoices.php +1 -1
- js/default/index.php +1 -0
- js/index.php +1 -0
- js/smallbutton/cookiechoices.js +45 -35
- js/smallbutton/cookiechoices.php +1 -1
- js/smallbutton/index.php +1 -0
- lang/index.php +1 -0
- lang/italy-cookie-choices-it_IT.mo +0 -0
- lang/italy-cookie-choices-it_IT.po +185 -67
- lang/italy-cookie-choices-ro_RO.mo +0 -0
- lang/italy-cookie-choices-ro_RO.po +180 -66
- lang/italy-cookie-choices.pot +162 -63
- readme.txt +57 -8
- uninstall.php +59 -0
admin/class-italy-cookie-choices-admin.php
ADDED
@@ -0,0 +1,1192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class for Italy Cookie Choices Admin
|
4 |
+
*/
|
5 |
+
if ( !class_exists( 'Italy_Cookie_Choices_Admin' ) ){
|
6 |
+
|
7 |
+
class Italy_Cookie_Choices_Admin{
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Definition of variables containing the configuration
|
11 |
+
* to be applied to the various function calls wordpress
|
12 |
+
*/
|
13 |
+
protected $capability = 'manage_options';
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Global variables and default values
|
17 |
+
* @var array
|
18 |
+
*/
|
19 |
+
protected $default_options = array();
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Option
|
23 |
+
* @var array
|
24 |
+
*/
|
25 |
+
private $options = array();
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Default Cookie name
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
private $cookieName = 'displayCookieConsent';
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Default cookie value
|
35 |
+
* @var string
|
36 |
+
*/
|
37 |
+
private $cookieVal = 'y';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Inizialize banner template to default
|
41 |
+
* @var string
|
42 |
+
*/
|
43 |
+
private $js_template = 'default';
|
44 |
+
|
45 |
+
/**
|
46 |
+
* [__construct description]
|
47 |
+
*/
|
48 |
+
public function __construct(){
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Add Admin menù page
|
52 |
+
*/
|
53 |
+
add_action( 'admin_menu', array( $this, 'addMenuPage') );
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Init settings
|
57 |
+
*/
|
58 |
+
add_action( 'admin_init', array( $this, 'italy_cl_settings_init') );
|
59 |
+
|
60 |
+
/**
|
61 |
+
* Add color picker in admin menù
|
62 |
+
*/
|
63 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_color_picker') );
|
64 |
+
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Add page for italy-cookie-choices admin page
|
70 |
+
*/
|
71 |
+
public function addMenuPage(){
|
72 |
+
|
73 |
+
add_options_page(
|
74 |
+
__('Italy Cookie Choices Dashboard', 'italy-cookie-choices'),
|
75 |
+
'Italy Cookie Choices',
|
76 |
+
$this->capability,
|
77 |
+
'italy-cookie-choices',
|
78 |
+
array( $this, 'dashboard')
|
79 |
+
);
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* The dashboard callback
|
84 |
+
*/
|
85 |
+
public function dashboard(){
|
86 |
+
|
87 |
+
if ( !current_user_can( $this->capability ) )
|
88 |
+
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
89 |
+
|
90 |
+
?>
|
91 |
+
<div class="wrap">
|
92 |
+
|
93 |
+
<?php //settings_errors('italy_cookie_id'); ?>
|
94 |
+
|
95 |
+
<form action='options.php' method='post'>
|
96 |
+
|
97 |
+
<?php
|
98 |
+
settings_fields( 'italy_cl_options_group' );
|
99 |
+
do_settings_sections( 'italy_cl_options_group' );
|
100 |
+
submit_button();
|
101 |
+
?>
|
102 |
+
|
103 |
+
</form>
|
104 |
+
</div>
|
105 |
+
<?php
|
106 |
+
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Initialize plugin
|
111 |
+
* @return [type] [description]
|
112 |
+
*/
|
113 |
+
public function italy_cl_settings_init() {
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Create default options
|
117 |
+
* @var array
|
118 |
+
*/
|
119 |
+
$this->default_options = array(
|
120 |
+
|
121 |
+
'text' => '',
|
122 |
+
'url' => '',
|
123 |
+
'anchor_text' => '',
|
124 |
+
'button_text' => '',
|
125 |
+
'cookie_name' => $this->cookieName,
|
126 |
+
'cookie_value' => $this->cookieVal,
|
127 |
+
'content_message_text' => '',
|
128 |
+
'content_message_button_text' => ''
|
129 |
+
|
130 |
+
);
|
131 |
+
|
132 |
+
/**
|
133 |
+
* All options in array
|
134 |
+
* @var array
|
135 |
+
*/
|
136 |
+
$this->options = get_option( 'italy_cookie_choices' );
|
137 |
+
|
138 |
+
/**
|
139 |
+
* If the theme options don't exist, create them.
|
140 |
+
*/
|
141 |
+
if( false === $this->options )
|
142 |
+
add_option( 'italy_cookie_choices', $this->default_options );
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Section options page
|
146 |
+
*/
|
147 |
+
add_settings_section(
|
148 |
+
'setting_section',
|
149 |
+
__( 'Italy Cookie Choices options page', 'italy-cookie-choices' ),
|
150 |
+
array( $this, 'italy_cl_settings_section_callback'),
|
151 |
+
'italy_cl_options_group'
|
152 |
+
);
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Checkbox for activation
|
156 |
+
*/
|
157 |
+
add_settings_field(
|
158 |
+
'active',
|
159 |
+
__( 'Activate', 'italy-cookie-choices' ),
|
160 |
+
array( $this, 'italy_cl_option_active'),
|
161 |
+
'italy_cl_options_group',
|
162 |
+
'setting_section'
|
163 |
+
);
|
164 |
+
|
165 |
+
/**
|
166 |
+
* How to display banner
|
167 |
+
* Default Bar
|
168 |
+
*/
|
169 |
+
add_settings_field(
|
170 |
+
'banner',
|
171 |
+
__( 'Where display the banner', 'italy-cookie-choices' ),
|
172 |
+
array( $this, 'italy_cl_option_banner'),
|
173 |
+
'italy_cl_options_group',
|
174 |
+
'setting_section'
|
175 |
+
);
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Checkbox for scroll event
|
179 |
+
*/
|
180 |
+
add_settings_field(
|
181 |
+
'scroll',
|
182 |
+
__( 'Mouse scroll event', 'italy-cookie-choices' ),
|
183 |
+
array( $this, 'italy_cl_option_scroll'),
|
184 |
+
'italy_cl_options_group',
|
185 |
+
'setting_section'
|
186 |
+
);
|
187 |
+
|
188 |
+
/**
|
189 |
+
* Checkbox for open in new page
|
190 |
+
*/
|
191 |
+
add_settings_field(
|
192 |
+
'secondView',
|
193 |
+
__( 'Accept on second view', 'italy-cookie-choices' ),
|
194 |
+
array( $this, 'italy_cl_option_secondView'),
|
195 |
+
'italy_cl_options_group',
|
196 |
+
'setting_section'
|
197 |
+
);
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Checkbox for reload page
|
201 |
+
*/
|
202 |
+
add_settings_field(
|
203 |
+
'reload',
|
204 |
+
__( 'Refresh page', 'italy-cookie-choices' ),
|
205 |
+
array( $this, 'italy_cl_option_reload'),
|
206 |
+
'italy_cl_options_group',
|
207 |
+
'setting_section'
|
208 |
+
);
|
209 |
+
|
210 |
+
/**
|
211 |
+
* Input for short policy text
|
212 |
+
*/
|
213 |
+
add_settings_field(
|
214 |
+
'text',
|
215 |
+
__( 'Text to display', 'italy-cookie-choices' ),
|
216 |
+
array( $this, 'italy_cl_option_text'),
|
217 |
+
'italy_cl_options_group',
|
218 |
+
'setting_section'
|
219 |
+
);
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Input for url policy page
|
223 |
+
*/
|
224 |
+
add_settings_field(
|
225 |
+
'url',
|
226 |
+
__( 'URL for cookie policy', 'italy-cookie-choices' ),
|
227 |
+
array( $this, 'italy_cl_option_url'),
|
228 |
+
'italy_cl_options_group',
|
229 |
+
'setting_section'
|
230 |
+
);
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Input for anchor text
|
234 |
+
*/
|
235 |
+
add_settings_field(
|
236 |
+
'anchor_text',
|
237 |
+
__( 'Anchor text for URL', 'italy-cookie-choices' ),
|
238 |
+
array( $this, 'italy_cl_option_anchor_text'),
|
239 |
+
'italy_cl_options_group',
|
240 |
+
'setting_section'
|
241 |
+
);
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Input for button text
|
245 |
+
*/
|
246 |
+
add_settings_field(
|
247 |
+
'button_text',
|
248 |
+
__( 'Button text', 'italy-cookie-choices' ),
|
249 |
+
array( $this, 'italy_cl_option_button_text'),
|
250 |
+
'italy_cl_options_group',
|
251 |
+
'setting_section'
|
252 |
+
);
|
253 |
+
|
254 |
+
/**
|
255 |
+
* Settings sections for Style
|
256 |
+
*/
|
257 |
+
add_settings_section(
|
258 |
+
'style_setting_section',
|
259 |
+
__( 'Style settings', 'italy-cookie-choices' ),
|
260 |
+
array( $this, 'italy_cl_style_settings_section_callback'),
|
261 |
+
'italy_cl_options_group'
|
262 |
+
);
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Select box for js_template selection
|
266 |
+
*/
|
267 |
+
add_settings_field(
|
268 |
+
'js_template',
|
269 |
+
__( 'CookieChoices Template', 'italy-cookie-choices' ),
|
270 |
+
array( $this, 'italy_cl_option_js_template'),
|
271 |
+
'italy_cl_options_group',
|
272 |
+
'style_setting_section'
|
273 |
+
);
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Checkbox for activation
|
277 |
+
*/
|
278 |
+
add_settings_field(
|
279 |
+
'html_margin',
|
280 |
+
__( 'HTML top margin', 'italy-cookie-choices' ),
|
281 |
+
array( $this, 'italy_cl_option_html_margin'),
|
282 |
+
'italy_cl_options_group',
|
283 |
+
'style_setting_section'
|
284 |
+
);
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Background color for banner
|
288 |
+
*/
|
289 |
+
add_settings_field(
|
290 |
+
'banner_bg',
|
291 |
+
__( 'Banner Background color', 'italy-cookie-choices' ),
|
292 |
+
array( $this, 'italy_cl_option_banner_bg'),
|
293 |
+
'italy_cl_options_group',
|
294 |
+
'style_setting_section'
|
295 |
+
);
|
296 |
+
|
297 |
+
/**
|
298 |
+
* Color for text in banner
|
299 |
+
*/
|
300 |
+
add_settings_field(
|
301 |
+
'banner_text_color',
|
302 |
+
__( 'Banner text color', 'italy-cookie-choices' ),
|
303 |
+
array( $this, 'italy_cl_option_banner_text_color'),
|
304 |
+
'italy_cl_options_group',
|
305 |
+
'style_setting_section'
|
306 |
+
);
|
307 |
+
|
308 |
+
/**
|
309 |
+
* Text area for custom CSS
|
310 |
+
*/
|
311 |
+
add_settings_field(
|
312 |
+
'customCSS',
|
313 |
+
__( 'Custom CSS', 'italy-cookie-choices' ),
|
314 |
+
array( $this, 'italy_cl_option_customCSS'),
|
315 |
+
'italy_cl_options_group',
|
316 |
+
'style_setting_section'
|
317 |
+
);
|
318 |
+
|
319 |
+
/**
|
320 |
+
* Text area for custom CSS class
|
321 |
+
*/
|
322 |
+
add_settings_field(
|
323 |
+
'customClass',
|
324 |
+
__( 'Custom CSS Class (Optional)', 'italy-cookie-choices' ),
|
325 |
+
array( $this, 'italy_cl_option_customClass'),
|
326 |
+
'italy_cl_options_group',
|
327 |
+
'style_setting_section'
|
328 |
+
);
|
329 |
+
|
330 |
+
/**
|
331 |
+
* Settings sections for Advanced options
|
332 |
+
*/
|
333 |
+
add_settings_section(
|
334 |
+
'advanced_setting_section',
|
335 |
+
__( 'Advanced settings', 'italy-cookie-choices' ),
|
336 |
+
array( $this, 'italy_cl_advanced_settings_section_callback'),
|
337 |
+
'italy_cl_options_group'
|
338 |
+
);
|
339 |
+
|
340 |
+
/**
|
341 |
+
* cookie name
|
342 |
+
*/
|
343 |
+
add_settings_field(
|
344 |
+
'cookie_name',
|
345 |
+
__( 'Cookie name', 'italy-cookie-choices' ),
|
346 |
+
array( $this, 'italy_cl_option_cookie_name'),
|
347 |
+
'italy_cl_options_group',
|
348 |
+
'advanced_setting_section'
|
349 |
+
);
|
350 |
+
|
351 |
+
/**
|
352 |
+
* cookie value
|
353 |
+
*/
|
354 |
+
add_settings_field(
|
355 |
+
'cookie_value',
|
356 |
+
__( 'Cookie value', 'italy-cookie-choices' ),
|
357 |
+
array( $this, 'italy_cl_option_cookie_value'),
|
358 |
+
'italy_cl_options_group',
|
359 |
+
'advanced_setting_section'
|
360 |
+
);
|
361 |
+
|
362 |
+
/**
|
363 |
+
* Cookie policy page slug
|
364 |
+
*/
|
365 |
+
add_settings_field(
|
366 |
+
'slug',
|
367 |
+
__( 'Cookie policy page slug', 'italy-cookie-choices' ),
|
368 |
+
array( $this, 'italy_cl_option_slug'),
|
369 |
+
'italy_cl_options_group',
|
370 |
+
'advanced_setting_section'
|
371 |
+
);
|
372 |
+
|
373 |
+
/**
|
374 |
+
* Checkbox for open in new page
|
375 |
+
*/
|
376 |
+
add_settings_field(
|
377 |
+
'target',
|
378 |
+
__( 'Open policy in new page', 'italy-cookie-choices' ),
|
379 |
+
array( $this, 'italy_cl_option_target'),
|
380 |
+
'italy_cl_options_group',
|
381 |
+
'advanced_setting_section'
|
382 |
+
);
|
383 |
+
|
384 |
+
/**
|
385 |
+
* Checkbox for activation third part cookie eraser
|
386 |
+
*/
|
387 |
+
add_settings_field(
|
388 |
+
'block',
|
389 |
+
__( 'Third part cookie block (beta)', 'italy-cookie-choices' ),
|
390 |
+
array( $this, 'italy_cl_option_block'),
|
391 |
+
'italy_cl_options_group',
|
392 |
+
'advanced_setting_section'
|
393 |
+
);
|
394 |
+
|
395 |
+
/**
|
396 |
+
* Function for custom script allow
|
397 |
+
*/
|
398 |
+
add_settings_field(
|
399 |
+
'custom_script_block_body_exclude',
|
400 |
+
__( 'Scripts allowed in body', 'italy-cookie-choices' ),
|
401 |
+
array( $this, 'italy_cl_option_custom_script_block_body_exclude'),
|
402 |
+
'italy_cl_options_group',
|
403 |
+
'advanced_setting_section'
|
404 |
+
);
|
405 |
+
|
406 |
+
/**
|
407 |
+
* Function for custom script block
|
408 |
+
*/
|
409 |
+
add_settings_field(
|
410 |
+
'custom_script_block',
|
411 |
+
__( 'Scripts to be blocked', 'italy-cookie-choices' ),
|
412 |
+
array( $this, 'italy_cl_option_custom_script_block'),
|
413 |
+
'italy_cl_options_group',
|
414 |
+
'advanced_setting_section'
|
415 |
+
);
|
416 |
+
|
417 |
+
/**
|
418 |
+
* Function for content message text
|
419 |
+
*/
|
420 |
+
add_settings_field(
|
421 |
+
'content_message_text',
|
422 |
+
__( 'Text message for locked embedded content', 'italy-cookie-choices' ),
|
423 |
+
array( $this, 'italy_cl_option_content_message_text'),
|
424 |
+
'italy_cl_options_group',
|
425 |
+
'advanced_setting_section'
|
426 |
+
);
|
427 |
+
|
428 |
+
/**
|
429 |
+
* Function for button text in message
|
430 |
+
*/
|
431 |
+
add_settings_field(
|
432 |
+
'content_message_button_text',
|
433 |
+
__( 'Button text to activate locked embedded content', 'italy-cookie-choices' ),
|
434 |
+
array( $this, 'italy_cl_option_content_message_button_text'),
|
435 |
+
'italy_cl_options_group',
|
436 |
+
'advanced_setting_section'
|
437 |
+
);
|
438 |
+
|
439 |
+
/**
|
440 |
+
* Register setting
|
441 |
+
*/
|
442 |
+
register_setting(
|
443 |
+
'italy_cl_options_group',
|
444 |
+
'italy_cookie_choices',
|
445 |
+
array( $this, 'sanitize_callback')
|
446 |
+
);
|
447 |
+
|
448 |
+
|
449 |
+
}
|
450 |
+
|
451 |
+
|
452 |
+
/**
|
453 |
+
* Display message in plugin control panel
|
454 |
+
* @return string Return message
|
455 |
+
*/
|
456 |
+
public function italy_cl_settings_section_callback() {
|
457 |
+
|
458 |
+
_e( 'Customize your banner for cookie law', 'italy-cookie-choices' );
|
459 |
+
|
460 |
+
}
|
461 |
+
|
462 |
+
/**
|
463 |
+
* Snippet for checkbox
|
464 |
+
* @return strimg Activate banner in front-end Default doesn't display
|
465 |
+
*/
|
466 |
+
public function italy_cl_option_active($args) {
|
467 |
+
|
468 |
+
$active = ( isset( $this->options['active'] ) ) ? $this->options['active'] : '' ;
|
469 |
+
?>
|
470 |
+
|
471 |
+
<input type='checkbox' name='italy_cookie_choices[active]' <?php checked( $active, 1 ); ?> value='1'>
|
472 |
+
<label for="italy_cookie_choices[active]">
|
473 |
+
<?php _e( 'Display banner for Cookie Law in front-end', 'italy-cookie-choices' ); ?>
|
474 |
+
</label>
|
475 |
+
|
476 |
+
<?php
|
477 |
+
|
478 |
+
}
|
479 |
+
|
480 |
+
/**
|
481 |
+
* Choose how to display banner in page
|
482 |
+
* @return string Display input and labels in plugin options page
|
483 |
+
*/
|
484 |
+
public function italy_cl_option_banner($args) {
|
485 |
+
|
486 |
+
$banner = ( isset( $this->options['banner'] ) ) ? $this->options['banner'] : '1' ;
|
487 |
+
|
488 |
+
?>
|
489 |
+
|
490 |
+
<input name="italy_cookie_choices[banner]" type="radio" value="1" id="radio_1" <?php checked( '1', $banner ); ?> />
|
491 |
+
|
492 |
+
<label for="radio_1">
|
493 |
+
<?php _e( 'Top Bar (Default, Display a top bar with your message)', 'italy-cookie-choices' ); ?>
|
494 |
+
</label>
|
495 |
+
|
496 |
+
<br>
|
497 |
+
|
498 |
+
<input name="italy_cookie_choices[banner]" type="radio" value="2" id="radio_2" <?php checked( '2', $banner ); ?> />
|
499 |
+
|
500 |
+
<label for="radio_2">
|
501 |
+
<?php _e( 'Dialog (Display an overlay with your message)', 'italy-cookie-choices' ); ?>
|
502 |
+
</label>
|
503 |
+
|
504 |
+
<br>
|
505 |
+
|
506 |
+
<input name="italy_cookie_choices[banner]" type="radio" value="3" id="radio_3" <?php checked( '3', $banner ); ?> />
|
507 |
+
|
508 |
+
<label for="radio_3">
|
509 |
+
<?php _e( 'Bottom Bar (Display a bar in the footer with your message)', 'italy-cookie-choices' ); ?>
|
510 |
+
</label>
|
511 |
+
|
512 |
+
|
513 |
+
|
514 |
+
<?php
|
515 |
+
|
516 |
+
}
|
517 |
+
|
518 |
+
/**
|
519 |
+
* Snippet for checkbox
|
520 |
+
* @return strimg Activate banner in front-end Default doesn't display
|
521 |
+
*/
|
522 |
+
public function italy_cl_option_scroll($args) {
|
523 |
+
|
524 |
+
$scroll = ( isset( $this->options['scroll'] ) ) ? $this->options['scroll'] : '' ;
|
525 |
+
?>
|
526 |
+
|
527 |
+
<input type='checkbox' name='italy_cookie_choices[scroll]' <?php checked( $scroll, 1 ); ?> value='1'>
|
528 |
+
<label for="italy_cookie_choices[scroll]">
|
529 |
+
<?php _e( 'Accepts disclosures on mouse scroll event', 'italy-cookie-choices' ); ?>
|
530 |
+
</label>
|
531 |
+
|
532 |
+
<?php
|
533 |
+
|
534 |
+
}
|
535 |
+
|
536 |
+
/**
|
537 |
+
* Snippet for second view checkbox $secondView
|
538 |
+
* @return strimg Activate for accept on second view
|
539 |
+
* Default do nothing
|
540 |
+
*/
|
541 |
+
public function italy_cl_option_secondView($args) {
|
542 |
+
|
543 |
+
$secondView = ( isset( $this->options['secondView'] ) ) ? $this->options['secondView'] : '' ;
|
544 |
+
|
545 |
+
?>
|
546 |
+
|
547 |
+
<input type='checkbox' name='italy_cookie_choices[secondView]' <?php checked( $secondView, 1 ); ?> value='1'>
|
548 |
+
<label for="italy_cookie_choices[secondView]">
|
549 |
+
<?php _e( 'Activate accept on second view', 'italy-cookie-choices' ); ?>
|
550 |
+
</label>
|
551 |
+
|
552 |
+
<?php
|
553 |
+
|
554 |
+
}
|
555 |
+
|
556 |
+
/**
|
557 |
+
* Snippet for reload
|
558 |
+
* @return strimg Reload page after click
|
559 |
+
*/
|
560 |
+
public function italy_cl_option_reload($args) {
|
561 |
+
|
562 |
+
$reload = ( isset( $this->options['reload'] ) ) ? $this->options['reload'] : '' ;
|
563 |
+
?>
|
564 |
+
|
565 |
+
<input type='checkbox' name='italy_cookie_choices[reload]' <?php checked( $reload, 1 ); ?> value='1'>
|
566 |
+
<label for="italy_cookie_choices[reload]">
|
567 |
+
<?php _e( 'Refresh page after button click (DEPRECATED)', 'italy-cookie-choices' ); ?>
|
568 |
+
</label>
|
569 |
+
|
570 |
+
<?php
|
571 |
+
|
572 |
+
}
|
573 |
+
|
574 |
+
/**
|
575 |
+
* Textarea for the message to display
|
576 |
+
* @return string
|
577 |
+
*/
|
578 |
+
public function italy_cl_option_text($args) {
|
579 |
+
|
580 |
+
?>
|
581 |
+
|
582 |
+
<textarea rows="5" cols="70" name="italy_cookie_choices[text]" id="italy_cookie_choices[text]" placeholder="<?php _e( 'Your short cookie policy', 'italy-cookie-choices' ) ?>" ><?php echo esc_textarea( $this->options['text'] ); ?></textarea>
|
583 |
+
<br>
|
584 |
+
<label for="italy_cookie_choices[text]">
|
585 |
+
<?php echo __( 'People will see this notice only the first time that they enter your site', 'italy-cookie-choices' ); ?>
|
586 |
+
</label>
|
587 |
+
|
588 |
+
<?php
|
589 |
+
|
590 |
+
}
|
591 |
+
|
592 |
+
/**
|
593 |
+
* Input for url policy page
|
594 |
+
* @return string
|
595 |
+
*/
|
596 |
+
public function italy_cl_option_url($args) {
|
597 |
+
|
598 |
+
?>
|
599 |
+
<input type="text" id="italy_cookie_choices[url]" name="italy_cookie_choices[url]" value="<?php echo esc_url( $this->options['url'] ); ?>" placeholder="<?php _e( 'e.g. http://www.aboutcookies.org/', 'italy-cookie-choices' ) ?>" size="70" />
|
600 |
+
<br>
|
601 |
+
<label for="italy_cookie_choices[url]">
|
602 |
+
<?php echo __( 'Insert here the link to your policy page', 'italy-cookie-choices' ); ?>
|
603 |
+
</label>
|
604 |
+
|
605 |
+
<?php
|
606 |
+
|
607 |
+
}
|
608 |
+
|
609 |
+
/**
|
610 |
+
* Input for anchor_text
|
611 |
+
* @return string
|
612 |
+
*/
|
613 |
+
public function italy_cl_option_anchor_text($args) {
|
614 |
+
|
615 |
+
?>
|
616 |
+
<input type="text" id="italy_cookie_choices[anchor_text]" name="italy_cookie_choices[anchor_text]" value="<?php echo esc_attr( $this->options['anchor_text'] ); ?>" placeholder="<?php _e( 'e.g. More Info', 'italy-cookie-choices' ) ?>" />
|
617 |
+
|
618 |
+
<label for="italy_cookie_choices[anchor_text]">
|
619 |
+
<?php echo __( 'Insert here anchor text for the link', 'italy-cookie-choices'); ?>
|
620 |
+
</label>
|
621 |
+
|
622 |
+
<?php
|
623 |
+
|
624 |
+
}
|
625 |
+
|
626 |
+
/**
|
627 |
+
* Input for anchor_text
|
628 |
+
* @return string
|
629 |
+
*/
|
630 |
+
public function italy_cl_option_button_text($args) {
|
631 |
+
|
632 |
+
?>
|
633 |
+
<input type="text" id="italy_cookie_choices[button_text]" name="italy_cookie_choices[button_text]" value="<?php echo esc_attr( $this->options['button_text'] ); ?>" placeholder="<?php _e( 'e.g. Close', 'italy-cookie-choices' ) ?>" />
|
634 |
+
|
635 |
+
<label for="italy_cookie_choices[button_text]">
|
636 |
+
<?php echo __( 'Insert here name of button (e.g. "Close") ', 'italy-cookie-choices' ); ?>
|
637 |
+
</label>
|
638 |
+
|
639 |
+
<?php
|
640 |
+
|
641 |
+
}
|
642 |
+
|
643 |
+
/**
|
644 |
+
* NUOVA SETTINGS SECTIONS PER LO STILE
|
645 |
+
*/
|
646 |
+
|
647 |
+
/**
|
648 |
+
* Display message in stile plugin panel
|
649 |
+
* @return string
|
650 |
+
*/
|
651 |
+
public function italy_cl_style_settings_section_callback() {
|
652 |
+
|
653 |
+
_e( 'Customize your style settings', 'italy-cookie-choices' );
|
654 |
+
|
655 |
+
}
|
656 |
+
|
657 |
+
/**
|
658 |
+
* Snippet for checkbox
|
659 |
+
* @return strimg Activate banner in front-end Default doesn't display
|
660 |
+
*/
|
661 |
+
public function italy_cl_option_html_margin($args) {
|
662 |
+
|
663 |
+
$html_margin = ( isset( $this->options['html_margin'] ) ) ? $this->options['html_margin'] : '' ;
|
664 |
+
|
665 |
+
?>
|
666 |
+
|
667 |
+
<input type='checkbox' name='italy_cookie_choices[html_margin]' <?php checked( $html_margin, 1 ); ?> value='1'>
|
668 |
+
<label for="italy_cookie_choices[html_margin]">
|
669 |
+
<?php _e( 'Add a page top margin for info top bar, only for default topbar stile', 'italy-cookie-choices' ); ?>
|
670 |
+
</label>
|
671 |
+
|
672 |
+
<?php
|
673 |
+
|
674 |
+
}
|
675 |
+
|
676 |
+
/**
|
677 |
+
* Snippet for select
|
678 |
+
* @return strimg Chose the JS_Template to use.
|
679 |
+
*/
|
680 |
+
public function italy_cl_option_js_template($args) {
|
681 |
+
|
682 |
+
$js_template = ( isset( $this->options['js_template'] ) ) ? $this->options['js_template'] : $this->js_template ;
|
683 |
+
|
684 |
+
?>
|
685 |
+
<select name='italy_cookie_choices[js_template]'>
|
686 |
+
|
687 |
+
<option value="default" <?php if ( $js_template === 'default' ) echo 'selected';?>><?php _e( 'Default cookiechoices template (centered with text links)', 'italy_cookie_choices' ); ?></option>
|
688 |
+
|
689 |
+
<option value="bigbutton" <?php if ( $js_template === 'bigbutton' ) echo 'selected';?>><?php _e( 'Centered container with left aligned text and big buttons', 'italy_cookie_choices' ); ?></option>
|
690 |
+
|
691 |
+
<option value="smallbutton" <?php if ( $js_template === 'smallbutton' ) echo 'selected';?>><?php _e( 'Centered container with left aligned text and small buttons', 'italy_cookie_choices' ); ?></option>
|
692 |
+
|
693 |
+
<option value="custom" <?php if ( $js_template === 'custom' ) echo 'selected';?>><?php _e( 'My custom CSS', 'italy_cookie_choices' ); ?></option>
|
694 |
+
|
695 |
+
</select>
|
696 |
+
<label for="italy_cookie_choices[js_template]">
|
697 |
+
<?php _e( 'Select the template to use', 'italy-cookie-choices' ); ?>
|
698 |
+
</label>
|
699 |
+
|
700 |
+
<?php
|
701 |
+
|
702 |
+
}
|
703 |
+
|
704 |
+
/**
|
705 |
+
* Snippet for checkbox
|
706 |
+
* @return strimg Activate banner in front-end Default doesn't display
|
707 |
+
*/
|
708 |
+
public function italy_cl_option_banner_bg($args) {
|
709 |
+
|
710 |
+
$banner_bg = ( isset( $this->options['banner_bg'] ) ) ? $this->options['banner_bg'] : '#fff' ;
|
711 |
+
|
712 |
+
?>
|
713 |
+
|
714 |
+
<input type="text" id="italy_cookie_choices[banner_bg]" name="italy_cookie_choices[banner_bg]" value="<?php echo esc_attr( $banner_bg ); ?>" placeholder="<?php echo esc_attr( $banner_bg ); ?>" class="color-field" data-default-color="#fff"/>
|
715 |
+
|
716 |
+
|
717 |
+
<label for="italy_cookie_choices[banner_bg]">
|
718 |
+
<?php _e( 'Custom Background color for banner', 'italy-cookie-choices' ); ?>
|
719 |
+
</label>
|
720 |
+
|
721 |
+
<?php
|
722 |
+
|
723 |
+
}
|
724 |
+
|
725 |
+
/**
|
726 |
+
* Snippet for banner text color
|
727 |
+
* @return strimg Activate banner in front-end Default doesn't display
|
728 |
+
*/
|
729 |
+
public function italy_cl_option_banner_text_color($args) {
|
730 |
+
|
731 |
+
$banner_text_color = ( isset( $this->options['banner_text_color'] ) ) ? $this->options['banner_text_color'] : '#000' ;
|
732 |
+
|
733 |
+
?>
|
734 |
+
|
735 |
+
<input type="text" id="italy_cookie_choices[banner_text_color]" name="italy_cookie_choices[banner_text_color]" value="<?php echo esc_attr( $banner_text_color ); ?>" placeholder="<?php echo esc_attr( $banner_text_color ); ?>" class="color-field" data-default-color="#000"/>
|
736 |
+
|
737 |
+
<label for="italy_cookie_choices[banner_text_color]">
|
738 |
+
<?php _e( 'Custom text color for banner', 'italy-cookie-choices' ); ?>
|
739 |
+
</label>
|
740 |
+
|
741 |
+
<?php
|
742 |
+
|
743 |
+
}
|
744 |
+
|
745 |
+
/**
|
746 |
+
* Textarea for custom CSS
|
747 |
+
* @return string
|
748 |
+
*/
|
749 |
+
public function italy_cl_option_customCSS($args) {
|
750 |
+
|
751 |
+
$customCSS = ( isset( $this->options['customCSS'] ) ) ? $this->options['customCSS'] : '' ;
|
752 |
+
|
753 |
+
?>
|
754 |
+
|
755 |
+
<textarea rows="5" cols="70" name="italy_cookie_choices[customCSS]" id="italy_cookie_choices[customCSS]" placeholder="<?php _e( 'Your custom css', 'italy-cookie-choices' ) ?>" ><?php echo esc_textarea( $customCSS ); ?></textarea>
|
756 |
+
<br>
|
757 |
+
<label for="italy_cookie_choices[customCSS]">
|
758 |
+
<?php echo __( 'Inset here your custom CSS for banner', 'italy-cookie-choices' ); ?>
|
759 |
+
</label>
|
760 |
+
|
761 |
+
<?php
|
762 |
+
|
763 |
+
}
|
764 |
+
|
765 |
+
/**
|
766 |
+
* Input for custom CSS class
|
767 |
+
* @return string
|
768 |
+
*/
|
769 |
+
public function italy_cl_option_customClass($args) {
|
770 |
+
|
771 |
+
$bannerStyle = ( isset( $this->options['bannerStyle'] ) ) ? esc_attr( $this->options['bannerStyle'] ) : 'bannerStyle' ;
|
772 |
+
|
773 |
+
$contentStyle = ( isset( $this->options['contentStyle'] ) ) ? esc_attr( $this->options['contentStyle'] ) : 'contentStyle' ;
|
774 |
+
|
775 |
+
$consentText = ( isset( $this->options['consentText'] ) ) ? esc_attr( $this->options['consentText'] ) : 'consentText' ;
|
776 |
+
|
777 |
+
$infoClass = ( isset( $this->options['infoClass'] ) ) ? esc_attr( $this->options['infoClass'] ) : 'italybtn' ;
|
778 |
+
|
779 |
+
$closeClass = ( isset( $this->options['closeClass'] ) ) ? esc_attr( $this->options['closeClass'] ) : 'italybtn' ;
|
780 |
+
|
781 |
+
?>
|
782 |
+
|
783 |
+
<input type="text" id="italy_cookie_choices[bannerStyle]" name="italy_cookie_choices[bannerStyle]" value="<?php echo esc_attr( $bannerStyle ); ?>" placeholder="<?php _e( 'Eg: bannerStyle', 'italy-cookie-choices' ); ?>" />
|
784 |
+
<label for="italy_cookie_choices[bannerStyle]">
|
785 |
+
<?php echo __( 'CSS class for div container (Default <code>bannerStyle</code>)', 'italy-cookie-choices' ); ?>
|
786 |
+
</label>
|
787 |
+
<br>
|
788 |
+
<input type="text" id="italy_cookie_choices[contentStyle]" name="italy_cookie_choices[contentStyle]" value="<?php echo esc_attr( $contentStyle ); ?>" placeholder="<?php _e( 'Eg: contentStyle', 'italy-cookie-choices' ); ?>" />
|
789 |
+
<label for="italy_cookie_choices[contentStyle]">
|
790 |
+
<?php echo __( 'CSS class for div content (Default <code>contentStyle</code>)', 'italy-cookie-choices' ); ?>
|
791 |
+
</label>
|
792 |
+
<br>
|
793 |
+
<input type="text" id="italy_cookie_choices[consentText]" name="italy_cookie_choices[consentText]" value="<?php echo esc_attr( $consentText ); ?>" placeholder="<?php _e( 'Eg: consentText', 'italy-cookie-choices' );; ?>" />
|
794 |
+
<label for="italy_cookie_choices[consentText]">
|
795 |
+
<?php echo __( 'CSS class for span content (Default <code>consentText</code>)', 'italy-cookie-choices' ); ?>
|
796 |
+
</label>
|
797 |
+
<br>
|
798 |
+
<input type="text" id="italy_cookie_choices[infoClass]" name="italy_cookie_choices[infoClass]" value="<?php echo esc_attr( $infoClass ); ?>" placeholder="<?php _e( 'Eg: infoClass', 'italy-cookie-choices' ); ?>" />
|
799 |
+
<label for="italy_cookie_choices[infoC]">
|
800 |
+
<?php echo __( 'CSS class for Info link (Default <code>itaybtn</code>)', 'italy-cookie-choices' ); ?>
|
801 |
+
</label>
|
802 |
+
<br>
|
803 |
+
<input type="text" id="italy_cookie_choices[closeClass]" name="italy_cookie_choices[closeClass]" value="<?php echo esc_attr( $closeClass ); ?>" placeholder="<?php _e( 'Eg: closeClass', 'italy-cookie-choices' ); ?>" />
|
804 |
+
<label for="italy_cookie_choices[closeClass]">
|
805 |
+
<?php echo __( 'CSS class for close link (Default <code>itaybtn</code>)', 'italy-cookie-choices' ); ?>
|
806 |
+
</label>
|
807 |
+
|
808 |
+
<p><?php _e( 'Customize with your personal CSS class', 'italy-cookie-choices' ); ?></p>
|
809 |
+
|
810 |
+
<?php
|
811 |
+
|
812 |
+
}
|
813 |
+
|
814 |
+
/**
|
815 |
+
* NUOVA SETTINGS SECTIONS PER LE OPZIONI AVANZATE
|
816 |
+
*/
|
817 |
+
|
818 |
+
/**
|
819 |
+
* Display message in plugin advanced setting section
|
820 |
+
* @return string
|
821 |
+
*/
|
822 |
+
public function italy_cl_advanced_settings_section_callback() {
|
823 |
+
|
824 |
+
_e( 'Customize your advanced settings', 'italy-cookie-choices' );
|
825 |
+
|
826 |
+
}
|
827 |
+
|
828 |
+
/**
|
829 |
+
* Snippet for cookie name
|
830 |
+
* @return strimg Activate banner in front-end Default doesn't display
|
831 |
+
*/
|
832 |
+
public function italy_cl_option_cookie_name($args) {
|
833 |
+
|
834 |
+
$cookie_name = ( isset( $this->options['cookie_name'] ) ) ? $this->options['cookie_name'] : $this->cookieName ;
|
835 |
+
|
836 |
+
?>
|
837 |
+
<input type="text" id="italy_cookie_choices[cookie_name]" name="italy_cookie_choices[cookie_name]" value="<?php echo esc_attr( $cookie_name ); ?>" placeholder="<?php echo esc_attr( $this->cookieName ); ?>" />
|
838 |
+
|
839 |
+
<label for="italy_cookie_choices[cookie_name]">
|
840 |
+
<?php _e( 'Insert your cookie name (Default: displayCookieConsent)', 'italy-cookie-choices' ); ?>
|
841 |
+
</label>
|
842 |
+
|
843 |
+
<?php
|
844 |
+
|
845 |
+
}
|
846 |
+
|
847 |
+
/**
|
848 |
+
* Snippet for cookie value
|
849 |
+
* @return strimg Activate banner in front-end Default doesn't display
|
850 |
+
*/
|
851 |
+
public function italy_cl_option_cookie_value($args) {
|
852 |
+
|
853 |
+
$cookie_value = ( isset( $this->options['cookie_value'] ) ) ? $this->options['cookie_value'] : $this->cookieVal ;
|
854 |
+
|
855 |
+
?>
|
856 |
+
<input type="text" id="italy_cookie_choices[cookie_value]" name="italy_cookie_choices[cookie_value]" value="<?php echo esc_attr( $cookie_value ); ?>" placeholder="<?php echo esc_attr( $this->cookieVal ); ?>" />
|
857 |
+
|
858 |
+
<label for="italy_cookie_choices[cookie_value]">
|
859 |
+
<?php _e( 'Insert your cookie value (Default: y)', 'italy-cookie-choices' ); ?>
|
860 |
+
</label>
|
861 |
+
|
862 |
+
<?php
|
863 |
+
|
864 |
+
}
|
865 |
+
|
866 |
+
/**
|
867 |
+
* Slug for cookie policy page
|
868 |
+
* @return strimg Slug for cookie policy page Default null
|
869 |
+
*/
|
870 |
+
public function italy_cl_option_slug($args) {
|
871 |
+
|
872 |
+
$slug = ( isset( $this->options['slug'] ) ) ? $this->options['slug'] : '' ;
|
873 |
+
|
874 |
+
?>
|
875 |
+
<input type="text" id="italy_cookie_choices[slug]" name="italy_cookie_choices[slug]" value="<?php echo esc_attr( $slug ); ?>" placeholder="<?php _e( 'e.g. your-policy-url.html', 'italy-cookie-choices' ); ?>" />
|
876 |
+
|
877 |
+
<label for="italy_cookie_choices[slug]">
|
878 |
+
<?php _e( 'Insert your cookie policy page slug (e.g. your-policy-url), it will display only topbar in your cookie policy page', 'italy-cookie-choices' ); ?>
|
879 |
+
</label>
|
880 |
+
|
881 |
+
<?php
|
882 |
+
|
883 |
+
}
|
884 |
+
|
885 |
+
/**
|
886 |
+
* Snippet for target checkbox
|
887 |
+
* @return strimg Activate for open policy page in new tab
|
888 |
+
* Default open in same tab
|
889 |
+
*/
|
890 |
+
public function italy_cl_option_target($args) {
|
891 |
+
|
892 |
+
$target = ( isset( $this->options['target'] ) ) ? $this->options['target'] : '' ;
|
893 |
+
|
894 |
+
?>
|
895 |
+
|
896 |
+
<input type='checkbox' name='italy_cookie_choices[target]' <?php checked( $target, 1 ); ?> value='1'>
|
897 |
+
<label for="italy_cookie_choices[target]">
|
898 |
+
<?php _e( 'Open your cookie policy page in new one', 'italy-cookie-choices' ); ?>
|
899 |
+
</label>
|
900 |
+
|
901 |
+
<?php
|
902 |
+
|
903 |
+
}
|
904 |
+
|
905 |
+
/**
|
906 |
+
* Snippet for target checkbox
|
907 |
+
* @return strimg Activate for open policy page in new tab
|
908 |
+
* Default open in same tab
|
909 |
+
*/
|
910 |
+
public function italy_cl_option_block($args) {
|
911 |
+
|
912 |
+
$all_block = ( isset( $this->options['all_block'] ) ) ? $this->options['all_block'] : '' ;
|
913 |
+
|
914 |
+
$block = ( isset( $this->options['block'] ) && $all_block === '' ) ? $this->options['block'] : '' ;
|
915 |
+
|
916 |
+
$widget_block = ( isset( $this->options['widget_block'] ) && $all_block === '' ) ? $this->options['widget_block'] : '' ;
|
917 |
+
|
918 |
+
?>
|
919 |
+
|
920 |
+
<input type='checkbox' name='italy_cookie_choices[block]' <?php checked( $block, 1 ); ?> value='1'>
|
921 |
+
<label for="italy_cookie_choices[block]">
|
922 |
+
<?php _e( 'Cookie from any embed in your content (Beta) (DEPRECATED)', 'italy-cookie-choices' ); ?>
|
923 |
+
</label>
|
924 |
+
<br>
|
925 |
+
<input type='checkbox' name='italy_cookie_choices[widget_block]' <?php checked( $widget_block, 1 ); ?> value='1'>
|
926 |
+
<label for="italy_cookie_choices[widget_block]">
|
927 |
+
<?php _e( 'Cookie from any embed in your widget area (Beta) (DEPRECATED)', 'italy-cookie-choices' ); ?>
|
928 |
+
</label>
|
929 |
+
<br>
|
930 |
+
<input type='checkbox' name='italy_cookie_choices[all_block]' <?php checked( $all_block, 1 ); ?> value='1'>
|
931 |
+
<label for="italy_cookie_choices[all_block]">
|
932 |
+
<?php _e( 'Cookie from any embed in all body, except head and footer (Beta)', 'italy-cookie-choices' ); ?>
|
933 |
+
</label>
|
934 |
+
|
935 |
+
<?php
|
936 |
+
|
937 |
+
}
|
938 |
+
|
939 |
+
/**
|
940 |
+
* Textarea for custom_script_block_body_exclude
|
941 |
+
* Scripts allowed in body
|
942 |
+
* @return string
|
943 |
+
*/
|
944 |
+
public function italy_cl_option_custom_script_block_body_exclude($args) {
|
945 |
+
|
946 |
+
$custom_script_block_body_exclude = ( isset( $this->options['custom_script_block_body_exclude'] ) ) ? $this->options['custom_script_block_body_exclude'] : '' ;
|
947 |
+
|
948 |
+
?>
|
949 |
+
<textarea rows="5" cols="70" name="italy_cookie_choices[custom_script_block_body_exclude]" id="italy_cookie_choices[custom_script_block_body_exclude]" placeholder="<?php _e( '<script src="http://domain.com/widget-example.js"></script>'."\n".'<---------SEP--------->'."\n".'<script src="http://otherdomain.com/script-example.js"></script>'."\n".'<---------SEP--------->'."\n".'<script src="http://lastdomain.com/gadget-example.js"></script>', 'italy-cookie-choices' ) ?>" ><?php echo esc_textarea( $custom_script_block_body_exclude ); ?></textarea>
|
950 |
+
<br>
|
951 |
+
<label for="italy_cookie_choices[custom_script_block_body_exclude]">
|
952 |
+
<?php echo __( 'Scripts to be excluded from the automatic block.<br />Split each script with <strong><em><---------SEP---------></em></strong>', 'italy-cookie-choices' ); ?>
|
953 |
+
</label>
|
954 |
+
<?php
|
955 |
+
|
956 |
+
}
|
957 |
+
|
958 |
+
/**
|
959 |
+
* Textarea for content_message_text
|
960 |
+
* @return string
|
961 |
+
*/
|
962 |
+
public function italy_cl_option_custom_script_block($args) {
|
963 |
+
|
964 |
+
$custom_script_block = ( isset( $this->options['custom_script_block'] ) ) ? $this->options['custom_script_block'] : '' ;
|
965 |
+
|
966 |
+
?>
|
967 |
+
<textarea rows="5" cols="70" name="italy_cookie_choices[custom_script_block]" id="italy_cookie_choices[custom_script_block]" placeholder="<?php _e( '<script src="http://domain.com/widget-example.js"></script>'."\n".'<---------SEP--------->'."\n".'<script src="http://otherdomain.com/script-example.js"></script>'."\n".'<---------SEP--------->'."\n".'<script src="http://lastdomain.com/gadget-example.js"></script>', 'italy-cookie-choices' ) ?>" ><?php echo esc_textarea( $custom_script_block ); ?></textarea>
|
968 |
+
<br>
|
969 |
+
<label for="italy_cookie_choices[custom_script_block]">
|
970 |
+
<?php echo __( 'Scripts shown in the head and in the footer does not automatically blocked.<br />Split each script with <strong><em><---------SEP---------></em></strong>', 'italy-cookie-choices' ); ?>
|
971 |
+
</label>
|
972 |
+
|
973 |
+
<?php
|
974 |
+
|
975 |
+
}
|
976 |
+
|
977 |
+
/**
|
978 |
+
* Function for custom script block
|
979 |
+
* @return string
|
980 |
+
*/
|
981 |
+
public function italy_cl_option_content_message_text($args) {
|
982 |
+
|
983 |
+
$content_message_text = ( isset( $this->options['content_message_text'] ) ) ? $this->options['content_message_text'] : '' ;
|
984 |
+
|
985 |
+
?>
|
986 |
+
<textarea rows="5" cols="70" name="italy_cookie_choices[content_message_text]" id="italy_cookie_choices[content_message_text]" placeholder="<?php _e( 'Your lock message for embedded contents inside posts, pages and widgets', 'italy-cookie-choices' ) ?>" ><?php echo esc_textarea( $content_message_text ); ?></textarea>
|
987 |
+
<br>
|
988 |
+
<label for="italy_cookie_choices[content_message_text]">
|
989 |
+
<?php echo __( 'People will see this notice only the first time that they enter your site', 'italy-cookie-choices' ); ?>
|
990 |
+
</label>
|
991 |
+
|
992 |
+
<?php
|
993 |
+
|
994 |
+
}
|
995 |
+
|
996 |
+
/**
|
997 |
+
* Input for content_message_button_text
|
998 |
+
* @return string
|
999 |
+
*/
|
1000 |
+
public function italy_cl_option_content_message_button_text($args) {
|
1001 |
+
|
1002 |
+
$content_message_button_text = ( isset( $this->options['content_message_button_text'] ) ) ? $this->options['content_message_button_text'] : '' ;
|
1003 |
+
|
1004 |
+
?>
|
1005 |
+
<input type="text" id="italy_cookie_choices[content_message_button_text]" name="italy_cookie_choices[content_message_button_text]" value="<?php echo esc_attr( $content_message_button_text ); ?>" placeholder="<?php _e( 'e.g. Close', 'italy-cookie-choices' ) ?>" />
|
1006 |
+
|
1007 |
+
<label for="italy_cookie_choices[content_message_button_text]">
|
1008 |
+
<?php echo __( 'Insert here name of button (e.g. "Close") ', 'italy-cookie-choices' ); ?>
|
1009 |
+
</label>
|
1010 |
+
|
1011 |
+
<?php
|
1012 |
+
|
1013 |
+
}
|
1014 |
+
|
1015 |
+
/**
|
1016 |
+
* Sanitize data
|
1017 |
+
* @param array $input Data to sanitize
|
1018 |
+
* @return array Data sanitized
|
1019 |
+
*/
|
1020 |
+
public function sanitize_callback( $input ){
|
1021 |
+
|
1022 |
+
// require 'class-italy-cookie-choices-sanitize.php';
|
1023 |
+
|
1024 |
+
// new Italy_Cookie_Choices_Sanitize( $input );
|
1025 |
+
|
1026 |
+
$new_input = array();
|
1027 |
+
|
1028 |
+
if( isset( $input['active'] ) )
|
1029 |
+
$new_input['active'] = $input['active'];
|
1030 |
+
|
1031 |
+
if( isset( $input['banner'] ) )
|
1032 |
+
$new_input['banner'] = $input['banner'];
|
1033 |
+
|
1034 |
+
if( isset( $input['scroll'] ) )
|
1035 |
+
$new_input['scroll'] = $input['scroll'];
|
1036 |
+
|
1037 |
+
if( isset( $input['secondView'] ) )
|
1038 |
+
$new_input['secondView'] = $input['secondView'];
|
1039 |
+
|
1040 |
+
if( isset( $input['reload'] ) )
|
1041 |
+
$new_input['reload'] = $input['reload'];
|
1042 |
+
|
1043 |
+
/**
|
1044 |
+
* Multilingual for text, url, anchor_text & button_text
|
1045 |
+
*/
|
1046 |
+
if( isset( $input['text'] ) )
|
1047 |
+
$new_input['text'] = sanitize_text_field( $input['text'] );
|
1048 |
+
|
1049 |
+
register_string( 'Italy Cookie Choices', 'Banner text', $new_input['text'] );
|
1050 |
+
|
1051 |
+
if( isset( $input['url'] ) )
|
1052 |
+
$new_input['url'] = sanitize_text_field( $input['url'] );
|
1053 |
+
|
1054 |
+
register_string( 'Italy Cookie Choices', 'Banner url', $new_input['url'] );
|
1055 |
+
|
1056 |
+
if( isset( $input['anchor_text'] ) )
|
1057 |
+
$new_input['anchor_text'] = sanitize_text_field( $input['anchor_text'] );
|
1058 |
+
|
1059 |
+
register_string( 'Italy Cookie Choices', 'Banner anchor text', $new_input['anchor_text'] );
|
1060 |
+
|
1061 |
+
if( isset( $input['button_text'] ) )
|
1062 |
+
$new_input['button_text'] = sanitize_text_field( $input['button_text'] );
|
1063 |
+
|
1064 |
+
register_string( 'Italy Cookie Choices', 'Banner button text', $new_input['button_text'] );
|
1065 |
+
|
1066 |
+
/**
|
1067 |
+
* Sezione per lo stile
|
1068 |
+
*/
|
1069 |
+
if( isset( $input['html_margin'] ) )
|
1070 |
+
$new_input['html_margin'] = $input['html_margin'];
|
1071 |
+
|
1072 |
+
if( isset( $input['js_template'] ) )
|
1073 |
+
$new_input['js_template'] = $input['js_template'];
|
1074 |
+
|
1075 |
+
if( empty( $input['banner_bg'] ) )
|
1076 |
+
$new_input['banner_bg'] = '#fff';
|
1077 |
+
elseif ( isset( $input['banner_bg'] ) )
|
1078 |
+
$new_input['banner_bg'] = sanitize_text_field( $input['banner_bg'] );
|
1079 |
+
|
1080 |
+
if( empty( $input['banner_text_color'] ) )
|
1081 |
+
$new_input['banner_text_color'] = '#000';
|
1082 |
+
elseif ( isset( $input['banner_text_color'] ) )
|
1083 |
+
$new_input['banner_text_color'] = sanitize_text_field( $input['banner_text_color'] );
|
1084 |
+
|
1085 |
+
if( isset( $input['customCSS'] ) )
|
1086 |
+
$new_input['customCSS'] = sanitize_text_field( $input['customCSS'] );
|
1087 |
+
|
1088 |
+
if( empty( $input['bannerStyle'] ) )
|
1089 |
+
$new_input['bannerStyle'] = 'bannerStyle';
|
1090 |
+
elseif( isset( $input['bannerStyle'] ) )
|
1091 |
+
$new_input['bannerStyle'] = sanitize_text_field( $input['bannerStyle'] );
|
1092 |
+
|
1093 |
+
if( empty( $input['contentStyle'] ) )
|
1094 |
+
$new_input['contentStyle'] = 'contentStyle';
|
1095 |
+
elseif( isset( $input['contentStyle'] ) )
|
1096 |
+
$new_input['contentStyle'] = sanitize_text_field( $input['contentStyle'] );
|
1097 |
+
|
1098 |
+
if( empty( $input['consentText'] ) )
|
1099 |
+
$new_input['consentText'] = 'consentText';
|
1100 |
+
elseif( isset( $input['consentText'] ) )
|
1101 |
+
$new_input['consentText'] = sanitize_text_field( $input['consentText'] );
|
1102 |
+
|
1103 |
+
if( empty( $input['infoClass'] ) )
|
1104 |
+
$new_input['infoClass'] = 'italybtn';
|
1105 |
+
elseif( isset( $input['infoClass'] ) )
|
1106 |
+
$new_input['infoClass'] = sanitize_text_field( $input['infoClass'] );
|
1107 |
+
|
1108 |
+
if( empty( $input['closeClass'] ) )
|
1109 |
+
$new_input['closeClass'] = 'italybtn';
|
1110 |
+
elseif( isset( $input['closeClass'] ) )
|
1111 |
+
$new_input['closeClass'] = sanitize_text_field( $input['closeClass'] );
|
1112 |
+
|
1113 |
+
/**
|
1114 |
+
* Sezione per le opzioni avanzate
|
1115 |
+
* Esempio per add_settings_error()
|
1116 |
+
* @link https://wordpress.org/support/topic/how-to-use-add_settings_error-for-nested-options-array?replies=2
|
1117 |
+
* @link http://pastebin.com/K4kJ0DNG
|
1118 |
+
*/
|
1119 |
+
if( empty( $input['cookie_name'] ) ){
|
1120 |
+
add_settings_error( 'italy_cookie_id', 'cookie_name_ID', __('Cookie name field it can\'t be empty. Restored default name.', 'italy-cookie-choices' ), 'error');
|
1121 |
+
$new_input['cookie_name'] = $this->cookieName;
|
1122 |
+
}
|
1123 |
+
else
|
1124 |
+
$new_input['cookie_name'] = sanitize_text_field( $input['cookie_name'] );
|
1125 |
+
|
1126 |
+
if( empty( $input['cookie_value'] ) ){
|
1127 |
+
add_settings_error( 'italy_cookie_id', 'cookie_name_ID', __('Cookie value field it can\'t be empty. Restored default value.', 'italy-cookie-choices' ), 'error');
|
1128 |
+
$new_input['cookie_value'] = $this->cookieVal;
|
1129 |
+
}
|
1130 |
+
else
|
1131 |
+
$new_input['cookie_value'] = sanitize_text_field( $input['cookie_value'] );
|
1132 |
+
|
1133 |
+
if( isset( $input['slug'] ) )
|
1134 |
+
$new_input['slug'] = sanitize_text_field( $input['slug'] );
|
1135 |
+
|
1136 |
+
if( isset( $input['target'] ) )
|
1137 |
+
$new_input['target'] = $input['target'];
|
1138 |
+
|
1139 |
+
if( isset( $input['block'] ) )
|
1140 |
+
$new_input['block'] = $input['block'];
|
1141 |
+
|
1142 |
+
if( isset( $input['widget_block'] ) )
|
1143 |
+
$new_input['widget_block'] = $input['widget_block'];
|
1144 |
+
|
1145 |
+
if( isset( $input['all_block'] ) )
|
1146 |
+
$new_input['all_block'] = $input['all_block'];
|
1147 |
+
|
1148 |
+
if( isset( $input['custom_script_block_body_exclude'] ) )
|
1149 |
+
$new_input['custom_script_block_body_exclude'] = $input['custom_script_block_body_exclude'];
|
1150 |
+
|
1151 |
+
if( isset( $input['custom_script_block'] ) )
|
1152 |
+
$new_input['custom_script_block'] = $input['custom_script_block'];
|
1153 |
+
|
1154 |
+
if( isset( $input['content_message_text'] ) )
|
1155 |
+
$new_input['content_message_text'] = sanitize_text_field( $input['content_message_text'] );
|
1156 |
+
|
1157 |
+
if( isset( $input['content_message_button_text'] ) )
|
1158 |
+
$new_input['content_message_button_text'] = sanitize_text_field( $input['content_message_button_text'] );
|
1159 |
+
|
1160 |
+
return $new_input;
|
1161 |
+
|
1162 |
+
}
|
1163 |
+
|
1164 |
+
/**
|
1165 |
+
* Function for color picker in admin
|
1166 |
+
* @param string $hook_suffix Hook for script
|
1167 |
+
* @return Append script
|
1168 |
+
* @link https://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/
|
1169 |
+
* @link http://code.tutsplus.com/articles/how-to-use-wordpress-color-picker-api--wp-33067
|
1170 |
+
*/
|
1171 |
+
public function enqueue_color_picker( $hook_suffix ) {
|
1172 |
+
|
1173 |
+
// first check that $hook_suffix is appropriate for your admin page
|
1174 |
+
wp_enqueue_style( 'wp-color-picker' );
|
1175 |
+
|
1176 |
+
// wp_enqueue_script( 'jquery' );
|
1177 |
+
|
1178 |
+
wp_enqueue_script(
|
1179 |
+
'italy-cookie-choices-script',
|
1180 |
+
plugins_url('admin/js/src/script.js', ITALY_COOKIE_CHOICES_FILE ),
|
1181 |
+
array(
|
1182 |
+
// 'jquery',
|
1183 |
+
'wp-color-picker'
|
1184 |
+
),
|
1185 |
+
null,
|
1186 |
+
true
|
1187 |
+
);
|
1188 |
+
|
1189 |
+
}
|
1190 |
+
|
1191 |
+
}// class
|
1192 |
+
}//endif
|
admin/class-italy-cookie-choices-sanitize.php
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class for sanitizations
|
4 |
+
*/
|
5 |
+
if ( !class_exists( 'Italy_Cookie_Choices_Sanitize' ) ){
|
6 |
+
|
7 |
+
class Italy_Cookie_Choices_Sanitize{
|
8 |
+
|
9 |
+
public function __construct( $input ){
|
10 |
+
|
11 |
+
$this->sanitize_callback( $input );
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Sanitize data
|
17 |
+
* @param array $input Data to sanitize
|
18 |
+
* @return array Data sanitized
|
19 |
+
*/
|
20 |
+
public function sanitize_callback( $input ){
|
21 |
+
|
22 |
+
$new_input = array();
|
23 |
+
|
24 |
+
if( isset( $input['active'] ) )
|
25 |
+
$new_input['active'] = $input['active'];
|
26 |
+
|
27 |
+
if( isset( $input['banner'] ) )
|
28 |
+
$new_input['banner'] = $input['banner'];
|
29 |
+
|
30 |
+
if( isset( $input['scroll'] ) )
|
31 |
+
$new_input['scroll'] = $input['scroll'];
|
32 |
+
|
33 |
+
if( isset( $input['secondView'] ) )
|
34 |
+
$new_input['secondView'] = $input['secondView'];
|
35 |
+
|
36 |
+
if( isset( $input['reload'] ) )
|
37 |
+
$new_input['reload'] = $input['reload'];
|
38 |
+
|
39 |
+
if( isset( $input['text'] ) )
|
40 |
+
$new_input['text'] = sanitize_text_field( $input['text'] );
|
41 |
+
|
42 |
+
if( isset( $input['url'] ) )
|
43 |
+
$new_input['url'] = sanitize_text_field( $input['url'] );
|
44 |
+
|
45 |
+
if( isset( $input['anchor_text'] ) )
|
46 |
+
$new_input['anchor_text'] = sanitize_text_field( $input['anchor_text'] );
|
47 |
+
|
48 |
+
if( isset( $input['button_text'] ) )
|
49 |
+
$new_input['button_text'] = sanitize_text_field( $input['button_text'] );
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Sezione per lo stile
|
53 |
+
*/
|
54 |
+
if( isset( $input['html_margin'] ) )
|
55 |
+
$new_input['html_margin'] = $input['html_margin'];
|
56 |
+
|
57 |
+
if( isset( $input['js_template'] ) )
|
58 |
+
$new_input['js_template'] = $input['js_template'];
|
59 |
+
|
60 |
+
if( empty( $input['banner_bg'] ) )
|
61 |
+
$new_input['banner_bg'] = '#fff';
|
62 |
+
elseif ( isset( $input['banner_bg'] ) )
|
63 |
+
$new_input['banner_bg'] = sanitize_text_field( $input['banner_bg'] );
|
64 |
+
|
65 |
+
if( empty( $input['banner_text_color'] ) )
|
66 |
+
$new_input['banner_text_color'] = '#000';
|
67 |
+
elseif ( isset( $input['banner_text_color'] ) )
|
68 |
+
$new_input['banner_text_color'] = sanitize_text_field( $input['banner_text_color'] );
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Sezione per le opzioni avanzate
|
72 |
+
* Esempio per add_settings_error()
|
73 |
+
* @link https://wordpress.org/support/topic/how-to-use-add_settings_error-for-nested-options-array?replies=2
|
74 |
+
* @link http://pastebin.com/K4kJ0DNG
|
75 |
+
*/
|
76 |
+
if( empty( $input['cookie_name'] ) ){
|
77 |
+
add_settings_error( 'italy_cookie_id', 'cookie_name_ID', __('Cookie name field it can\'t be empty. Restored default name.', 'italy-cookie-choices' ), 'error');
|
78 |
+
$new_input['cookie_name'] = $this->cookieName;
|
79 |
+
}
|
80 |
+
else
|
81 |
+
$new_input['cookie_name'] = sanitize_text_field( $input['cookie_name'] );
|
82 |
+
|
83 |
+
if( empty( $input['cookie_value'] ) ){
|
84 |
+
add_settings_error( 'italy_cookie_id', 'cookie_name_ID', __('Cookie value field it can\'t be empty. Restored default value.', 'italy-cookie-choices' ), 'error');
|
85 |
+
$new_input['cookie_value'] = $this->cookieVal;
|
86 |
+
}
|
87 |
+
else
|
88 |
+
$new_input['cookie_value'] = sanitize_text_field( $input['cookie_value'] );
|
89 |
+
|
90 |
+
if( isset( $input['slug'] ) )
|
91 |
+
$new_input['slug'] = sanitize_text_field( $input['slug'] );
|
92 |
+
|
93 |
+
if( isset( $input['target'] ) )
|
94 |
+
$new_input['target'] = $input['target'];
|
95 |
+
|
96 |
+
if( isset( $input['block'] ) )
|
97 |
+
$new_input['block'] = $input['block'];
|
98 |
+
|
99 |
+
if( isset( $input['widget_block'] ) )
|
100 |
+
$new_input['widget_block'] = $input['widget_block'];
|
101 |
+
|
102 |
+
if( isset( $input['all_block'] ) )
|
103 |
+
$new_input['all_block'] = $input['all_block'];
|
104 |
+
|
105 |
+
if( isset( $input['custom_script_block_body_exclude'] ) )
|
106 |
+
$new_input['custom_script_block_body_exclude'] = $input['custom_script_block_body_exclude'];
|
107 |
+
|
108 |
+
if( isset( $input['custom_script_block'] ) )
|
109 |
+
$new_input['custom_script_block'] = $input['custom_script_block'];
|
110 |
+
|
111 |
+
if( isset( $input['content_message_text'] ) )
|
112 |
+
$new_input['content_message_text'] = sanitize_text_field( $input['content_message_text'] );
|
113 |
+
|
114 |
+
if( isset( $input['content_message_button_text'] ) )
|
115 |
+
$new_input['content_message_button_text'] = sanitize_text_field( $input['content_message_button_text'] );
|
116 |
+
|
117 |
+
return $new_input;
|
118 |
+
|
119 |
+
}
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
}
|
admin/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Italy Cookie Choices
|
admin/js/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Italy Cookie Choices
|
admin/js/src/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Italy Cookie Choices
|
classes/class-italy-cookie-choices-front-end.php
ADDED
@@ -0,0 +1,694 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class for Italy Cookie Choices Admin
|
4 |
+
*/
|
5 |
+
if ( !class_exists( 'Italy_Cookie_Choices_Front_End' ) ){
|
6 |
+
|
7 |
+
class Italy_Cookie_Choices_Front_End{
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Option
|
11 |
+
* @var array
|
12 |
+
*/
|
13 |
+
private $options = array();
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Default Cookie name
|
17 |
+
* @var string
|
18 |
+
*/
|
19 |
+
private $cookieName = 'displayCookieConsent';
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Default cookie value
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
+
private $cookieVal = 'y';
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Pattern for searching embed code in content and widget
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
private $pattern = '#<iframe.*?\/iframe>|<embed.*?>|<script.*?\/script>#is';
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Snippet for replacements
|
35 |
+
* @var string
|
36 |
+
*/
|
37 |
+
private $valore = '';
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Inizialize banner template to default
|
41 |
+
* @var string
|
42 |
+
*/
|
43 |
+
private $js_template = 'default';
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Array with embed found
|
47 |
+
* @var array
|
48 |
+
*/
|
49 |
+
public $js_array = array();
|
50 |
+
|
51 |
+
/**
|
52 |
+
* If exist set a page slug
|
53 |
+
* @var string
|
54 |
+
*/
|
55 |
+
private $slug = '';
|
56 |
+
|
57 |
+
/**
|
58 |
+
* [__construct description]
|
59 |
+
*/
|
60 |
+
public function __construct(){
|
61 |
+
|
62 |
+
$this->options = get_option( 'italy_cookie_choices' );
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Check for second view option
|
66 |
+
* @var bol
|
67 |
+
*/
|
68 |
+
$secondViewOpt = ( isset( $this->options['secondView'] ) ) ? $this->options['secondView'] : '' ;
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Asseggno il valore allo slug nel costruttore
|
72 |
+
* @var bolean
|
73 |
+
*/
|
74 |
+
$this->slug = ( isset( $this->options['slug'] ) ) ? esc_attr( $this->options['slug'] ) : '' ;
|
75 |
+
|
76 |
+
/*
|
77 |
+
* Set cookie if the user agree navigating through the pages of the site
|
78 |
+
*/
|
79 |
+
$secondView = false;
|
80 |
+
|
81 |
+
if(
|
82 |
+
// if is an HTML request (alternative methods???)
|
83 |
+
(strpos($_SERVER["HTTP_ACCEPT"],'html') !== false) &&
|
84 |
+
//if the page isn't privacy page
|
85 |
+
($_SERVER['REQUEST_URI']!=$this->slug) &&
|
86 |
+
//if HTTP_REFERER is set
|
87 |
+
(isset($_SERVER['HTTP_REFERER'])) &&
|
88 |
+
//if isn't refresh
|
89 |
+
(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_PATH)!=$_SERVER['REQUEST_URI']) &&
|
90 |
+
//if referrer is not privacy page (to be evaluated)
|
91 |
+
(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_PATH)!=$this->slug) &&
|
92 |
+
//if the cookie is not already set
|
93 |
+
(!isset( $_COOKIE[ $this->options['cookie_name'] ] )) &&
|
94 |
+
//if the referer is in the same domain
|
95 |
+
(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST)==$_SERVER['HTTP_HOST']) &&
|
96 |
+
// If the secondView options is checked
|
97 |
+
( $secondViewOpt )
|
98 |
+
) {
|
99 |
+
setcookie($this->options['cookie_name'], $this->options['cookie_value'], time()+(3600*24*365), '/');
|
100 |
+
$secondView = true;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Shortcode to put a button in policy page
|
105 |
+
*/
|
106 |
+
add_shortcode( 'accept_button', array( $this, 'accept_button' ) );
|
107 |
+
|
108 |
+
if ( !isset( $_COOKIE[ $this->options['cookie_name'] ] ) && !$secondView ){
|
109 |
+
|
110 |
+
// W3TC Disable Caching
|
111 |
+
if ( !defined( 'DONOTCACHEPAGE' ) )
|
112 |
+
define('DONOTCACHEPAGE', true);
|
113 |
+
if ( !defined( 'SID' ) )
|
114 |
+
define('SID', true);
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Background color for banner
|
118 |
+
* @var string
|
119 |
+
*/
|
120 |
+
$banner_bg = ( isset( $this->options['banner_bg'] ) ) ? $this->options['banner_bg'] : '#ffffff' ;
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Color for text
|
124 |
+
* @var string
|
125 |
+
*/
|
126 |
+
$banner_text_color = ( isset( $this->options['banner_text_color'] ) ) ? $this->options['banner_text_color'] : '#000000' ;
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Text for banner
|
130 |
+
* @var string
|
131 |
+
*/
|
132 |
+
$text = ( isset( $this->options['text'] ) ) ? $this->options['text'] : '' ;
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Text for buttom
|
136 |
+
* @var [type]
|
137 |
+
*/
|
138 |
+
$button_text = ( isset( $this->options['button_text'] ) ) ? $this->options['button_text'] : '' ;
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Checkbox for third part cookie in content
|
142 |
+
* @var bol
|
143 |
+
*/
|
144 |
+
$block = ( isset( $this->options['block'] ) ) ? $this->options['block'] : '' ;
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Checkbox for third part cookie in widget
|
148 |
+
* @var bol
|
149 |
+
*/
|
150 |
+
$widget_block = ( isset( $this->options['widget_block'] ) ) ? $this->options['widget_block'] : '' ;
|
151 |
+
|
152 |
+
/**
|
153 |
+
* Checkbox for third part cookie in all page (except head and footer)
|
154 |
+
* @var bol
|
155 |
+
*/
|
156 |
+
$all_block = ( isset( $this->options['all_block'] ) ) ? $this->options['all_block'] : '' ;
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Checkbox custom scripts block in BODY
|
160 |
+
* @var string
|
161 |
+
*/
|
162 |
+
$custom_script_block_body_exclude = ( isset( $this->options['custom_script_block_body_exclude'] ) ) ? $this->options['custom_script_block_body_exclude'] : '' ;
|
163 |
+
|
164 |
+
/**
|
165 |
+
* Checkbox custom scripts block in HEAD and FOOTER
|
166 |
+
* @var string
|
167 |
+
*/
|
168 |
+
$custom_script_block = ( isset( $this->options['custom_script_block'] ) ) ? $this->options['custom_script_block'] : '' ;
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Text to put inside locked post and widget contents
|
172 |
+
* including the button text
|
173 |
+
* @var string
|
174 |
+
*/
|
175 |
+
$content_message_text = ( isset( $this->options['content_message_text'] ) ) ? $this->options['content_message_text'] : '' ;
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Text for button in locked content and widget
|
179 |
+
* @var string
|
180 |
+
*/
|
181 |
+
$content_message_button_text = ( isset( $this->options['content_message_button_text'] ) ) ? $this->options['content_message_button_text'] : '' ;
|
182 |
+
|
183 |
+
/**
|
184 |
+
* Replacement for regex
|
185 |
+
* @var string
|
186 |
+
*/
|
187 |
+
// $this->valore = '<div class="el"><div style="padding:10px;margin-bottom: 18px;color: #b94a48;background-color: #f2dede;border: 1px solid #eed3d7; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);-webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;">' . esc_attr( $this->options['text'] ) . '<button onclick="cookieChoices.removeCookieConsent()">Try it</button></div><!-- $0 --></div>';
|
188 |
+
//
|
189 |
+
$this->valore = '<div class="el"><div style="padding:10px;margin-bottom: 18px;color:' . esc_attr( $banner_text_color ) . ';background-color:' . esc_attr( $banner_bg ) . ';text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);">' . esc_attr( $content_message_text ) . ' <button onclick="cookieChoices.removeCookieConsent()" style="color: '.esc_attr( $banner_text_color ).';padding: 3px;font-size: 12px;line-height: 12px;text-decoration: none;text-transform: uppercase;margin:0;display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid ' . esc_attr( $banner_text_color ) . ';background: rgba(255, 255, 255, 0.03);">' . esc_attr( $content_message_button_text ) . '</button></div><cookie></div>';
|
190 |
+
|
191 |
+
if ($block)
|
192 |
+
add_filter( 'the_content', array( $this, 'AutoErase' ), 11);
|
193 |
+
|
194 |
+
if ( $widget_block )
|
195 |
+
add_filter( 'widget_display_callback', array( $this, 'WidgetErase' ), 11, 3 );
|
196 |
+
|
197 |
+
if ( $all_block ) {
|
198 |
+
//add_action('wp_footer', array( $this, 'catchBody' ), -1000000);
|
199 |
+
add_action('wp_head', array( $this, 'bufferBodyStart' ), 1000000);
|
200 |
+
add_action('wp_footer', array( $this, 'bufferBodyEnd' ), -1000000);
|
201 |
+
}
|
202 |
+
if( $custom_script_block !== '' ) {
|
203 |
+
add_action('template_redirect', array( $this, 'bufferHeadStart' ), 2);
|
204 |
+
add_action('wp_head', array( $this, 'bufferHeadEnd' ), 99999);
|
205 |
+
add_action('wp_footer', array( $this, 'bufferFooterStart' ), -99998);
|
206 |
+
add_action('shutdown', array( $this, 'bufferFooterEnd' ), -1000000);
|
207 |
+
} else {
|
208 |
+
/**
|
209 |
+
* Function for print cookiechoiches inline
|
210 |
+
*/
|
211 |
+
add_action( 'wp_footer', array( $this, 'print_script_inline'), -99999 );
|
212 |
+
}
|
213 |
+
|
214 |
+
/**
|
215 |
+
* Only for debug
|
216 |
+
*/
|
217 |
+
// var_dump($_COOKIE);
|
218 |
+
// var_dump(headers_list());
|
219 |
+
|
220 |
+
}
|
221 |
+
|
222 |
+
}//__construct
|
223 |
+
|
224 |
+
private function in_array_match($value, $array) {
|
225 |
+
foreach($array as $k=>$v) {
|
226 |
+
if(preg_match('/'.str_replace(preg_quote("<---------SOMETHING--------->"), ".*", preg_quote(preg_replace( "/([\r|\n]*)/is", "", trim($v)), '/')).'/is', preg_replace( "/([\r|\n]*)/is", "", $value))) {
|
227 |
+
return true;
|
228 |
+
}
|
229 |
+
}
|
230 |
+
return false;
|
231 |
+
}
|
232 |
+
|
233 |
+
public function removeCustomScript($buffer) {
|
234 |
+
$custom_script_block = ( isset( $this->options['custom_script_block'] ) ) ? $this->options['custom_script_block'] : '' ;
|
235 |
+
if($custom_script_block=='') {
|
236 |
+
return $buffer;
|
237 |
+
} else {
|
238 |
+
$custom_script_block = preg_replace( "/([\r|\n]*)<---------SEP--------->([\r|\n]*)/is", "<---------SEP--------->", $custom_script_block );
|
239 |
+
$custom_script_block_array = explode("<---------SEP--------->", $custom_script_block);
|
240 |
+
foreach($custom_script_block_array AS $single_script) {
|
241 |
+
preg_match_all('/'.str_replace(preg_quote("<---------SOMETHING--------->"), ".*", preg_quote(trim($single_script), '/')).'/is', $buffer, $matches);
|
242 |
+
if(!empty($matches[0])) {
|
243 |
+
foreach($matches[0] AS $v) {
|
244 |
+
$buffer = str_replace(trim($v), "<!-- removed head from Italy Cookie Choices PHP Class -->", $buffer);
|
245 |
+
$this->js_array[] = trim($v);
|
246 |
+
}
|
247 |
+
}
|
248 |
+
}
|
249 |
+
return $buffer;
|
250 |
+
}
|
251 |
+
}
|
252 |
+
|
253 |
+
public function bufferBodyStart() {
|
254 |
+
if (ob_get_contents())
|
255 |
+
ob_end_flush();
|
256 |
+
ob_start();
|
257 |
+
|
258 |
+
}
|
259 |
+
|
260 |
+
public function bufferBodyEnd() {
|
261 |
+
$custom_script_block_body_exclude = ( isset( $this->options['custom_script_block_body_exclude'] ) ) ? $this->options['custom_script_block_body_exclude'] : '' ;
|
262 |
+
$custom_script_block_body_exclude = preg_replace( "/([\r|\n]*)<---------SEP--------->([\r|\n]*)/is", "<---------SEP--------->", $custom_script_block_body_exclude );
|
263 |
+
$custom_script_block_body_exclude_array = explode("<---------SEP--------->", $custom_script_block_body_exclude);
|
264 |
+
|
265 |
+
if(!is_array($custom_script_block_body_exclude_array) || empty($custom_script_block_body_exclude_array[0]))
|
266 |
+
$custom_script_block_body_exclude_array = array();
|
267 |
+
|
268 |
+
$buffer = ob_get_contents();
|
269 |
+
if (ob_get_contents())
|
270 |
+
ob_end_clean();
|
271 |
+
preg_match("/(.*)(<body.*)/s", $buffer, $matches);
|
272 |
+
$head = $matches[1];
|
273 |
+
$body = $matches[2];
|
274 |
+
preg_match_all( $this->pattern, $body, $body_matches);
|
275 |
+
if ( !empty( $body_matches[0] ) ) {
|
276 |
+
foreach($body_matches[0] AS $k => $v) {
|
277 |
+
if(!$this->in_array_match(trim($v), $custom_script_block_body_exclude_array)) {
|
278 |
+
$body = preg_replace('/'.str_replace(preg_quote("<---------SOMETHING--------->"), ".*", preg_quote(trim($v), '/')).'/is', $this->valore, $body);
|
279 |
+
$this->js_array[] = trim($v);
|
280 |
+
}
|
281 |
+
}
|
282 |
+
}
|
283 |
+
$buffer_new = $head.$body;
|
284 |
+
echo '<!-- ICCStartBody -->'.$buffer_new.'<!-- ICCEndBody -->';
|
285 |
+
}
|
286 |
+
|
287 |
+
public function bufferFooterStart() {
|
288 |
+
if (ob_get_contents())
|
289 |
+
ob_end_flush();
|
290 |
+
ob_start();
|
291 |
+
}
|
292 |
+
|
293 |
+
public function bufferFooterEnd() {
|
294 |
+
$buffer = ob_get_contents();
|
295 |
+
if (ob_get_contents())
|
296 |
+
ob_end_clean();
|
297 |
+
// if is an HTML request (alternative methods???)
|
298 |
+
if(strpos($_SERVER["HTTP_ACCEPT"],'html') !== false) {
|
299 |
+
$buffer_new = $this->removeCustomScript($buffer);
|
300 |
+
/**
|
301 |
+
* Function for print cookiechoiches inline
|
302 |
+
*/
|
303 |
+
$this->print_script_inline();
|
304 |
+
echo '<!-- ICCStartFooter -->'.$buffer_new.'<!-- ICCEndFooter -->';
|
305 |
+
} else {
|
306 |
+
echo $buffer;
|
307 |
+
}
|
308 |
+
}
|
309 |
+
|
310 |
+
public function bufferHeadStart() {
|
311 |
+
if (ob_get_contents())
|
312 |
+
ob_end_flush();
|
313 |
+
ob_start();
|
314 |
+
}
|
315 |
+
|
316 |
+
public function bufferHeadEnd() {
|
317 |
+
$buffer = ob_get_contents();
|
318 |
+
if (ob_get_contents())
|
319 |
+
ob_end_clean();
|
320 |
+
$buffer_new = $this->removeCustomScript($buffer);
|
321 |
+
echo '<!-- ICCStartHead -->'.$buffer_new.'<!-- ICCEndHead -->';
|
322 |
+
}
|
323 |
+
|
324 |
+
/**
|
325 |
+
* Function for matching embed
|
326 |
+
* @param string $pattern Pattern
|
327 |
+
* @param string $content Content
|
328 |
+
* @return array Array with embed found
|
329 |
+
*/
|
330 |
+
public function matches( $pattern, $content ){
|
331 |
+
|
332 |
+
preg_match_all( $this->pattern, $content, $matches );
|
333 |
+
|
334 |
+
/**
|
335 |
+
* Memorizzo gli embed trovati e li appendo all'array $js_array
|
336 |
+
* @var [type]
|
337 |
+
*/
|
338 |
+
if ( !empty( $matches[0] ) )
|
339 |
+
$this->js_array = array_merge( $this->js_array, $matches[0] );
|
340 |
+
|
341 |
+
}
|
342 |
+
|
343 |
+
/**
|
344 |
+
* Erase third part embed
|
345 |
+
* @param string $content Article content
|
346 |
+
*/
|
347 |
+
public function AutoErase( $content ) {
|
348 |
+
|
349 |
+
$this->matches( $this->pattern, $content );
|
350 |
+
|
351 |
+
$content = preg_replace( $this->pattern, $this->valore , $content);
|
352 |
+
|
353 |
+
|
354 |
+
return $content;
|
355 |
+
}
|
356 |
+
|
357 |
+
private function fnFixArray($v) {
|
358 |
+
if(is_array($v) or is_object($v)){
|
359 |
+
foreach($v as $k1=>$v1){
|
360 |
+
$v[$k1] = $this->fnFixArray($v1);
|
361 |
+
}
|
362 |
+
return $v;
|
363 |
+
}
|
364 |
+
|
365 |
+
if(!is_string($v) or empty($v)) return $v;
|
366 |
+
|
367 |
+
$this->matches( $this->pattern, $v );
|
368 |
+
|
369 |
+
return preg_replace( $this->pattern, $this->valore , $v);
|
370 |
+
}
|
371 |
+
|
372 |
+
/**
|
373 |
+
* Erase third part in widget area
|
374 |
+
* @param [type] $instance [description]
|
375 |
+
* @param [type] $widget [description]
|
376 |
+
* @param [type] $args [description]
|
377 |
+
*/
|
378 |
+
public function WidgetErase($instance, $widget, $args){
|
379 |
+
return $this->fnFixArray($instance);
|
380 |
+
}
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Encode a variable into JSON, with some sanity checks.
|
384 |
+
*
|
385 |
+
* @since 4.1.0
|
386 |
+
*
|
387 |
+
* @param mixed $data Variable (usually an array or object) to encode as JSON.
|
388 |
+
* @param int $options Optional. Options to be passed to json_encode(). Default 0.
|
389 |
+
* @param int $depth Optional. Maximum depth to walk through $data. Must be
|
390 |
+
* greater than 0. Default 512.
|
391 |
+
* @return bool|string The JSON encoded string, or false if it cannot be encoded.
|
392 |
+
*/
|
393 |
+
public function wp_json_encode( $data, $options = 0, $depth = 512 ) {
|
394 |
+
|
395 |
+
/*
|
396 |
+
* json_encode() has had extra params added over the years.
|
397 |
+
* $options was added in 5.3, and $depth in 5.5.
|
398 |
+
* We need to make sure we call it with the correct arguments.
|
399 |
+
*/
|
400 |
+
if ( version_compare( PHP_VERSION, '5.5', '>=' ) )
|
401 |
+
$args = array( $data, $options, $depth );
|
402 |
+
elseif ( version_compare( PHP_VERSION, '5.3', '>=' ) )
|
403 |
+
$args = array( $data, $options );
|
404 |
+
else
|
405 |
+
$args = array( $data );
|
406 |
+
|
407 |
+
$json = call_user_func_array( 'json_encode', $args );
|
408 |
+
|
409 |
+
// If json_encode() was successful, no need to do more sanity checking.
|
410 |
+
// ... unless we're in an old version of PHP, and json_encode() returned
|
411 |
+
// a string containing 'null'. Then we need to do more sanity checking.
|
412 |
+
if ( false !== $json && ( version_compare( PHP_VERSION, '5.5', '>=' ) || false === strpos( $json, 'null' ) ) )
|
413 |
+
return $json;
|
414 |
+
|
415 |
+
return call_user_func_array( 'json_encode', $args );
|
416 |
+
}
|
417 |
+
|
418 |
+
/**
|
419 |
+
* Print script inline before </body>
|
420 |
+
* @return string Print script inline
|
421 |
+
* @link https://www.cookiechoices.org/
|
422 |
+
*/
|
423 |
+
public function print_script_inline(){
|
424 |
+
|
425 |
+
// $this->options = get_option( 'italy_cookie_choices' );
|
426 |
+
|
427 |
+
/**
|
428 |
+
* If is not active exit
|
429 |
+
*/
|
430 |
+
if ( !isset( $this->options['active'] ) )
|
431 |
+
return;
|
432 |
+
|
433 |
+
/**
|
434 |
+
* Accept on scroll
|
435 |
+
* @var bol
|
436 |
+
*/
|
437 |
+
$scroll = ( isset( $this->options['scroll'] ) && !( is_page( $this->slug ) || is_single( $this->slug ) ) ) ? $this->options['scroll'] : '' ;
|
438 |
+
|
439 |
+
/**
|
440 |
+
* Reload on accept
|
441 |
+
* @var bol
|
442 |
+
*/
|
443 |
+
$reload = ( isset( $this->options['reload'] ) ) ? $this->options['reload'] : '' ;
|
444 |
+
|
445 |
+
/**
|
446 |
+
* ADVANCED OPTIONS
|
447 |
+
*/
|
448 |
+
/**
|
449 |
+
* Cookie name
|
450 |
+
* @var string
|
451 |
+
*/
|
452 |
+
$cookie_name = ( isset( $this->options['cookie_name'] ) ) ? $this->options['cookie_name'] : $this->cookieName ;
|
453 |
+
|
454 |
+
/**
|
455 |
+
* Cookie value
|
456 |
+
* @var string/bolean
|
457 |
+
*/
|
458 |
+
$cookie_value = ( isset( $this->options['cookie_value'] ) ) ? $this->options['cookie_value'] : $this->cookieVal ;
|
459 |
+
|
460 |
+
/**
|
461 |
+
* Js_Template value
|
462 |
+
* @var string
|
463 |
+
*/
|
464 |
+
// $js_template = ( isset( $this->options['js_template'] ) && $this->options['js_template'] !== 'custom') ? $this->options['js_template'] : $this->js_template ;
|
465 |
+
$js_template = ( isset( $this->options['js_template'] ) ) ? $this->options['js_template'] : $this->js_template ;
|
466 |
+
|
467 |
+
/**
|
468 |
+
* If is set html_margin checkbox in admin panel then add margin-top to HTML tag
|
469 |
+
* @var bol
|
470 |
+
*/
|
471 |
+
$htmlM = '' ;
|
472 |
+
|
473 |
+
/**
|
474 |
+
* If set open policy page in new browser tab
|
475 |
+
* @var bol
|
476 |
+
*/
|
477 |
+
$target = ( isset( $this->options['target'] ) ) ? $this->options['target'] : '' ;
|
478 |
+
|
479 |
+
/**
|
480 |
+
* Colore dello sfondo della dialog/topbar
|
481 |
+
* @var string
|
482 |
+
*/
|
483 |
+
$banner_bg = ( isset( $this->options['banner_bg'] ) && !empty( $this->options['banner_bg'] ) ) ? esc_attr( $this->options['banner_bg'] ) : '#fff' ;
|
484 |
+
|
485 |
+
/**
|
486 |
+
* Colore del font della dialog/topbar
|
487 |
+
* @var string
|
488 |
+
*/
|
489 |
+
$banner_text_color = ( isset( $this->options['banner_text_color'] ) && !empty( $this->options['banner_text_color'] ) ) ? esc_attr( $this->options['banner_text_color'] ) : '#000' ;
|
490 |
+
|
491 |
+
/**
|
492 |
+
* Custom CSS
|
493 |
+
* @var string
|
494 |
+
*/
|
495 |
+
$customCSS = ( isset( $this->options['customCSS'] ) ) ? esc_attr( $this->options['customCSS'] ) : '' ;
|
496 |
+
|
497 |
+
/**
|
498 |
+
* CSS class for div bannerStyle
|
499 |
+
* @var string
|
500 |
+
*/
|
501 |
+
$bannerStyle = ( isset( $this->options['bannerStyle'] ) && !empty( $this->options['bannerStyle'] ) ) ? esc_attr( $this->options['bannerStyle'] ) : 'bannerStyle' ;
|
502 |
+
|
503 |
+
/**
|
504 |
+
* CSS class for div content
|
505 |
+
* @var string
|
506 |
+
*/
|
507 |
+
$contStyle = ( isset( $this->options['contentStyle'] ) && !empty( $this->options['contentStyle'] ) ) ? esc_attr( $this->options['contentStyle'] ) : 'contentStyle' ;
|
508 |
+
|
509 |
+
/**
|
510 |
+
* CSS class for text in span
|
511 |
+
* @var string
|
512 |
+
*/
|
513 |
+
$consentText = ( isset( $this->options['consentText'] ) && !empty( $this->options['consentText'] ) ) ? esc_attr( $this->options['consentText'] ) : 'consentText' ;
|
514 |
+
|
515 |
+
/**
|
516 |
+
* CSS class for info link
|
517 |
+
* @var string
|
518 |
+
*/
|
519 |
+
$infoClass = ( isset( $this->options['infoClass'] ) && !empty( $this->options['infoClass'] ) ) ? esc_attr( $this->options['infoClass'] ) : 'italybtn' ;
|
520 |
+
|
521 |
+
/**
|
522 |
+
* CSS class for close link
|
523 |
+
* @var string
|
524 |
+
*/
|
525 |
+
$closeClass = ( isset( $this->options['closeClass'] ) && !empty( $this->options['closeClass'] ) ) ? esc_attr( $this->options['closeClass'] ) : 'italybtn' ;
|
526 |
+
|
527 |
+
/**
|
528 |
+
* If $infoClass and $closeClass are exactly alike print only first var
|
529 |
+
* @var [type]
|
530 |
+
*/
|
531 |
+
$buttonClass = ( $infoClass === $closeClass ) ? $infoClass : $infoClass . ',.' . $closeClass;
|
532 |
+
|
533 |
+
/**
|
534 |
+
* CSS for content style
|
535 |
+
* @var string
|
536 |
+
*/
|
537 |
+
$contentStyle = '';
|
538 |
+
|
539 |
+
/**
|
540 |
+
* Button style
|
541 |
+
* @var string
|
542 |
+
*/
|
543 |
+
$buttonStyle = '.' . $buttonClass . '{margin-left:10px;}';
|
544 |
+
|
545 |
+
/**
|
546 |
+
* Conditional button style for bigbutton or smallbutton
|
547 |
+
* Default margin
|
548 |
+
*/
|
549 |
+
if ( $js_template === 'bigbutton' )
|
550 |
+
$buttonStyle = '.' . $buttonClass . '{color:' . $banner_text_color . ';padding:7px 12px;font-size:18px;line-height:18px;text-decoration:none;text-transform:uppercase;margin:10px 20px 2px 0;letter-spacing: 0.125em;display:inline-block;font-weight:normal;text-align:center; vertical-align:middle;cursor:pointer;border:1px solid ' . $banner_text_color . ';background:rgba(255, 255, 255, 0.03);}.' . $consentText . '{display:block}';
|
551 |
+
elseif ( $js_template === 'smallbutton' )
|
552 |
+
$buttonStyle = '.' . $buttonClass . '{color:' . $banner_text_color . ';padding:3px 7px;font-size:14px;line-height:14px;text-decoration:none;text-transform:uppercase;margin:10px 20px 2px 0;letter-spacing: 0.115em;display:inline-block;font-weight:normal;text-align:center; vertical-align:middle;cursor:pointer;border:1px solid ' . $banner_text_color . ';background:rgba(255, 255, 255, 0.03);}.' . $consentText . '{display:block}';
|
553 |
+
|
554 |
+
/**
|
555 |
+
* Select what kind of banner to display
|
556 |
+
* @var $banner Bar/Dialog
|
557 |
+
* @var $contentStyle Style for content div
|
558 |
+
* @var $style Style for banner
|
559 |
+
* @var $bPos Deprecated
|
560 |
+
* @var $htmlM Bolean for margin top
|
561 |
+
*/
|
562 |
+
if ( $this->options['banner'] === '1' ) {
|
563 |
+
|
564 |
+
$banner = 'Bar';
|
565 |
+
|
566 |
+
$contentStyle = ( $js_template === 'bigbutton' || $js_template === 'smallbutton' ) ? '.contentStyle{max-width:980px;margin-right:auto;margin-left:auto;padding:15px;}' : '' ;
|
567 |
+
|
568 |
+
$style = ( $js_template === 'custom' ) ? $customCSS : '#cookieChoiceInfo{background-color: ' . $banner_bg . ';color: ' . $banner_text_color . ';left:0;margin:0;padding:4px;position:fixed;text-align:left;top:0;width:100%;z-index:9999;}' . $contentStyle . $buttonStyle;
|
569 |
+
|
570 |
+
$bPos = 'top:0'; // Deprecato
|
571 |
+
|
572 |
+
$htmlM = ( isset( $this->options['html_margin'] ) ) ? $this->options['html_margin'] : '' ;
|
573 |
+
|
574 |
+
} elseif ( $this->options['banner'] === '2' && !( is_page( $this->slug ) || is_single( $this->slug ) ) ) {
|
575 |
+
|
576 |
+
$banner = 'Dialog';
|
577 |
+
|
578 |
+
$style = ( $js_template === 'custom' ) ? $customCSS : '.glassStyle{position:fixed;width:100%;height:100%;z-index:999;top:0;left:0;opacity:0.5;filter:alpha(opacity=50);background-color:#ccc;}.' . $bannerStyle . '{min-width:100%;z-index:9999;position:fixed;top:25%;}.contentStyle{position:relative;background-color:' . $banner_bg . ';padding:20px;box-shadow:4px 4px 25px #888;max-width:80%;margin:0 auto;}' . $buttonStyle;
|
579 |
+
|
580 |
+
$bPos = 'top:0'; // Deprecato
|
581 |
+
|
582 |
+
} elseif ( $this->options['banner'] === '3' ) {
|
583 |
+
|
584 |
+
$banner = 'Bar';
|
585 |
+
|
586 |
+
$contentStyle = ( $js_template === 'bigbutton' || $js_template === 'smallbutton' ) ? '.contentStyle{max-width:980px;margin-right:auto;margin-left:auto;padding:15px;}' : '' ;
|
587 |
+
|
588 |
+
$style = ( $js_template === 'custom' ) ? $customCSS : '#cookieChoiceInfo{background-color: ' . $banner_bg . ';color: ' . $banner_text_color . ';left:0;margin:0;padding:4px;position:fixed;text-align:left;bottom:0;width:100%;z-index:9999;}' . $contentStyle . $buttonStyle;
|
589 |
+
|
590 |
+
$bPos = 'bottom:0'; // Deprecato
|
591 |
+
|
592 |
+
} else {
|
593 |
+
|
594 |
+
$banner = 'Bar';
|
595 |
+
|
596 |
+
$style = ( $js_template === 'custom' ) ? $customCSS : '#cookieChoiceInfo{background-color: ' . $banner_bg . ';color: ' . $banner_text_color . ';left:0;margin:0;padding:4px;position:fixed;text-align:left;top:0;width:100%;z-index:9999;}' . $contentStyle . $buttonStyle;
|
597 |
+
|
598 |
+
$bPos = 'top:0'; // Deprecato
|
599 |
+
|
600 |
+
}
|
601 |
+
|
602 |
+
/**
|
603 |
+
* Declarations of JS variables and set parameters
|
604 |
+
* var elPos = Gestisce la Posizione banner nella funzione _createHeaderElement
|
605 |
+
* var infoClass = aggiunge una classe personalizzata per il link info
|
606 |
+
* var closeClass = aggiunge una classe personalizzata per il link di accettazione
|
607 |
+
* var htmlM = Aggiunge un margine a HTML per la top bar
|
608 |
+
* var coNA = cookie name
|
609 |
+
* var coVA = cookie val
|
610 |
+
* var rel = Setto il reload per la pagina all'accettazione
|
611 |
+
* var tar = Target -blank
|
612 |
+
* var bgB = Colore del background della topbar/dialog
|
613 |
+
* var btcB = Colore del font della topbar/dialog
|
614 |
+
* var bannerStyle = Variabile per le classe del contenitore
|
615 |
+
* var contentStyle = Variabile per le classe del contenitore del contenuto
|
616 |
+
* var consText = Variabile per le classe dello span per il testo
|
617 |
+
* @var string
|
618 |
+
*/
|
619 |
+
$jsVariables = 'var coNA="' . $cookie_name . '",coVA="' . $cookie_value . '";scroll="' . $scroll . '",elPos="fixed",infoClass="' . $infoClass . '",closeClass="' . $closeClass . '",htmlM="' . $htmlM . '",rel="' . $reload . '",tar="' . $target . '",bgB="' . $banner_bg . '",btcB="' . $banner_text_color . '",bPos="' . $bPos . '",bannerStyle="' . $bannerStyle . '",contentStyle="' . $contStyle . '",consText="' . $consentText . '",jsArr = ' . $this->wp_json_encode( $this->js_array ) . ';';
|
620 |
+
|
621 |
+
/**
|
622 |
+
* Snippet per il multilingua
|
623 |
+
* function get_string return multilanguage $value
|
624 |
+
* if isn't installed any language plugin return $value
|
625 |
+
*/
|
626 |
+
$text = $this->wp_json_encode( get_string( 'Italy Cookie Choices', 'Banner text', $this->options['text'] ) );
|
627 |
+
|
628 |
+
$url = esc_url( get_string( 'Italy Cookie Choices', 'Banner url', $this->options['url'] ) );
|
629 |
+
|
630 |
+
$anchor_text = esc_js( get_string( 'Italy Cookie Choices', 'Banner anchor text', $this->options['anchor_text'] ) );
|
631 |
+
|
632 |
+
$button_text = esc_js( get_string( 'Italy Cookie Choices', 'Banner button text', $this->options['button_text'] ) );
|
633 |
+
|
634 |
+
/**
|
635 |
+
* Snippet for display banner
|
636 |
+
* @uses json_encode Funzione usate per il testo del messaggio.
|
637 |
+
* Ricordarsi che aggiunge già
|
638 |
+
* le doppie virgolette "" alla stringa
|
639 |
+
* @var string
|
640 |
+
*/
|
641 |
+
$banner = 'document.addEventListener("DOMContentLoaded", function(event) {cookieChoices.showCookieConsent' . $banner . '(' . $text . ', "' . $button_text . '", "' . $anchor_text . '", "' . $url . '");});';
|
642 |
+
|
643 |
+
/**
|
644 |
+
* Noscript snippet in case browser has JavaScript disabled
|
645 |
+
* @var string
|
646 |
+
*/
|
647 |
+
$noscript = '<noscript><style>html{margin-top:35px}</style><div id="cookieChoiceInfo"><span>' . $text . '</span><a href="' . $url . '" class="' . $infoClass . '" target="_blank">' . $anchor_text . '</a></div></noscript>';
|
648 |
+
|
649 |
+
/**
|
650 |
+
* Select wich file to use in debug mode
|
651 |
+
* @var string
|
652 |
+
*/
|
653 |
+
// $fileJS = ( WP_DEBUG ) ? '/js/' . $js_template . '/cookiechoices.js' : '/js/' . $js_template . '/cookiechoices.php' ;
|
654 |
+
$fileJS = ( WP_DEBUG ) ? '/js/default/cookiechoices.js' : '/js/default/cookiechoices.php' ;
|
655 |
+
|
656 |
+
$output_html = '<!-- Italy Cookie Choices -->' . '<style>' . $style . '</style><script>' . $jsVariables . file_get_contents( ITALY_COOKIE_CHOICES_DIRNAME . $fileJS ) . $banner . '</script>' . $noscript;
|
657 |
+
|
658 |
+
echo apply_filters( 'icc_output_html', $output_html );
|
659 |
+
|
660 |
+
}
|
661 |
+
|
662 |
+
/**
|
663 |
+
* Shortcode per stampare il bottone nella pagina della policy
|
664 |
+
* @param array $atts Array con gli attributi dello shortcode
|
665 |
+
* @param string $content content of shortcode
|
666 |
+
* @return string Button per l'accettazione
|
667 |
+
*/
|
668 |
+
public function accept_button( $atts, $content = null ) {
|
669 |
+
|
670 |
+
$button_text = ( isset( $this->options['button_text'] ) ) ? $this->options['button_text'] : '' ;
|
671 |
+
|
672 |
+
return '<span class="el"><button onclick="cookieChoices.removeCookieConsent()">' . esc_attr( $button_text ) . '</button></span>';
|
673 |
+
|
674 |
+
}
|
675 |
+
|
676 |
+
/**
|
677 |
+
* Display cookie, only for internal use
|
678 |
+
* @return string
|
679 |
+
*/
|
680 |
+
private function _display_cookie(){
|
681 |
+
|
682 |
+
$cookie_list = '<ul>';
|
683 |
+
|
684 |
+
foreach ( $_COOKIE as $key => $val )
|
685 |
+
$cookie_list .= '<li>Cooke name: ' . $key . ' - val: ' . $val . '</li>';
|
686 |
+
|
687 |
+
$cookie_list .= '</ul>';
|
688 |
+
|
689 |
+
return $cookie_list;
|
690 |
+
|
691 |
+
}
|
692 |
+
|
693 |
+
}// class
|
694 |
+
}//endif
|
includes/functions-italy-cookie-choices-lang.php
ADDED
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* By Mte90 - www.mte90.net
|
4 |
+
* Functions for multilingual support
|
5 |
+
* @link https://github.com/Mte90/WordPress-Plugin-Boilerplate-Powered/blob/master/plugin-name/includes/language.php
|
6 |
+
* @link https://gist.github.com/Mte90/fe687ceed408ab743238
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Return the language 2 letters code
|
11 |
+
*
|
12 |
+
* @since 1.0.0
|
13 |
+
*
|
14 |
+
* @var string
|
15 |
+
*/
|
16 |
+
function get_language() {
|
17 |
+
|
18 |
+
if ( defined( 'ICL_LANGUAGE_CODE' ) )
|
19 |
+
return ICL_LANGUAGE_CODE;
|
20 |
+
|
21 |
+
elseif ( function_exists( 'cml_get_browser_lang' ) )
|
22 |
+
return cml_get_browser_lang();
|
23 |
+
|
24 |
+
elseif ( function_exists( 'pll_current_language' ) )
|
25 |
+
return pll_current_language();
|
26 |
+
|
27 |
+
else
|
28 |
+
return get_locale();//return a 4 letters code
|
29 |
+
|
30 |
+
}
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Add registration for string (contain hook)
|
34 |
+
*
|
35 |
+
* @since 1.0.0
|
36 |
+
*
|
37 |
+
* @var string
|
38 |
+
*/
|
39 |
+
function register_string( $plugin_name_human_format, $string_name, $value ) {
|
40 |
+
|
41 |
+
if ( function_exists( 'icl_register_string' ) )
|
42 |
+
icl_register_string( $plugin_name_human_format, $string_name, $value );
|
43 |
+
|
44 |
+
elseif ( has_filter( 'cml_my_translations' ) ) {
|
45 |
+
|
46 |
+
add_filter( 'cml_my_translations', create_function( "$groups, $plugin_name_human_format","
|
47 |
+
$plugin_name_human_format_replaced = str_replace( ' ', '-', $plugin_name_human_format );
|
48 |
+
CMLTranslations:add( $string_name, $value, $plugin_name_human_format );
|
49 |
+
$groups[$plugin_name_human_format_replaced] = $plugin_name_human_format;
|
50 |
+
return $groups;"
|
51 |
+
) );
|
52 |
+
|
53 |
+
} elseif ( function_exists( 'pll_register_string' ) ) {
|
54 |
+
|
55 |
+
$plugin_name_human_format_replaced = str_replace( ' ', '-', $plugin_name_human_format );
|
56 |
+
pll_register_string( $plugin_name_human_format_replaced, $string_name );
|
57 |
+
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Unregister string, Polylang not have this feature
|
63 |
+
*
|
64 |
+
* @since 1.0.0
|
65 |
+
*
|
66 |
+
* @var string
|
67 |
+
*/
|
68 |
+
function deregister_string( $plugin_name_human_format, $string_name ) {
|
69 |
+
|
70 |
+
if ( function_exists( 'icl_unregister_string' ) )
|
71 |
+
icl_unregister_string( $plugin_name_human_format, $string_name );
|
72 |
+
|
73 |
+
elseif ( has_filter( 'cml_my_translations' ) ) {
|
74 |
+
|
75 |
+
$plugin_name_human_format_replaced = str_replace( ' ', '-', $plugin_name_human_format );
|
76 |
+
CMLTranslations::delete( $plugin_name_human_format_replaced );
|
77 |
+
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* Get string
|
83 |
+
*
|
84 |
+
* @since 1.0.0
|
85 |
+
*
|
86 |
+
* @var string
|
87 |
+
*/
|
88 |
+
function get_string( $plugin_name_human_format, $string_name, $value ) {
|
89 |
+
|
90 |
+
if ( function_exists( 'icl_t' ) )
|
91 |
+
return icl_t( $plugin_name_human_format, $string_name, $value );
|
92 |
+
|
93 |
+
elseif ( has_filter( 'cml_my_translations' ) )
|
94 |
+
return CMLTranslations::get( CMLLanguage::get_current_id(), $string_name, str_replace( ' ', '-', $plugin_name_human_format ) );
|
95 |
+
|
96 |
+
elseif ( function_exists( 'pll__' ) )
|
97 |
+
return pll__( $string_name );
|
98 |
+
|
99 |
+
else
|
100 |
+
return $value;
|
101 |
+
|
102 |
+
}
|
index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Italy Cookie Choices
|
italy-cookie-choices.php
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
/**
|
3 |
* Plugin Name: Italy Cookie Choices
|
4 |
* Plugin URI: https://plus.google.com/u/0/communities/109254048492234113886
|
5 |
-
* Description:
|
6 |
-
* Version: 2.
|
7 |
-
* Author: Enea Overclokk
|
8 |
-
* Author URI: https://
|
9 |
* Text Domain: italy-cookie-choices
|
10 |
* License: GPLv2 or later
|
11 |
*
|
@@ -49,1504 +49,206 @@ if ( !defined( 'ITALY_COOKIE_CHOICES_FILE' ) )
|
|
49 |
* Example = F:\xampp\htdocs\italystrap\wp-content\plugins\italystrap-extended/
|
50 |
*/
|
51 |
if ( !defined( 'ITALY_COOKIE_CHOICES_PLUGIN_PATH' ) )
|
52 |
-
define('ITALY_COOKIE_CHOICES_PLUGIN_PATH', plugin_dir_path( ITALY_COOKIE_CHOICES_FILE ));
|
53 |
/**
|
54 |
* Example = italystrap-extended/italystrap.php
|
55 |
*/
|
56 |
if ( !defined( 'ITALY_COOKIE_CHOICES_BASENAME' ) )
|
57 |
-
define('ITALY_COOKIE_CHOICES_BASENAME', plugin_basename( ITALY_COOKIE_CHOICES_FILE ));
|
58 |
|
59 |
/**
|
60 |
* Example = F:\xampp\htdocs\italystrap\wp-content\plugins\italy-cookie-choices
|
61 |
*/
|
62 |
if ( !defined( 'ITALY_COOKIE_CHOICES_DIRNAME' ) )
|
63 |
-
define('ITALY_COOKIE_CHOICES_DIRNAME', dirname( ITALY_COOKIE_CHOICES_FILE ));
|
64 |
-
|
65 |
|
66 |
/**
|
67 |
-
*
|
68 |
*/
|
69 |
-
|
70 |
-
|
71 |
-
class Italy_Cookie_Choices{
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Definition of variables containing the configuration
|
75 |
-
* to be applied to the various function calls wordpress
|
76 |
-
*/
|
77 |
-
protected $capability = 'manage_options';
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Global variables and default values
|
81 |
-
* @var array
|
82 |
-
*/
|
83 |
-
protected $default_options = array();
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
private $cookieName = 'displayCookieConsent';
|
96 |
|
97 |
-
|
98 |
-
* Default cookie value
|
99 |
-
* @var string
|
100 |
-
*/
|
101 |
-
private $cookieVal = 'y';
|
102 |
|
103 |
-
|
104 |
-
* Pattern for searching embed code in content and widget
|
105 |
-
* @var string
|
106 |
-
*/
|
107 |
-
private $pattern = '#<iframe.*?\/iframe>|<embed.*?>|<script.*?\/script>#is';
|
108 |
|
109 |
/**
|
110 |
-
*
|
111 |
* @var string
|
112 |
*/
|
113 |
-
private $
|
114 |
|
115 |
/**
|
116 |
-
*
|
117 |
* @var string
|
118 |
*/
|
119 |
-
private $
|
120 |
-
|
121 |
-
/**
|
122 |
-
* Array with embed found
|
123 |
-
* @var array
|
124 |
-
*/
|
125 |
-
public $js_array = array();
|
126 |
-
|
127 |
/**
|
128 |
-
*
|
129 |
*/
|
130 |
public function __construct(){
|
131 |
|
132 |
/**
|
133 |
-
*
|
134 |
*/
|
135 |
-
|
136 |
-
|
137 |
-
/**
|
138 |
-
* Init settings
|
139 |
-
*/
|
140 |
-
add_action( 'admin_init', array( $this, 'italy_cl_settings_init') );
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Add color picker in admin menù
|
144 |
-
*/
|
145 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_color_picker') );
|
146 |
-
|
147 |
-
if ( !is_admin() ) {
|
148 |
-
|
149 |
-
$this->options = get_option( 'italy_cookie_choices' );
|
150 |
-
|
151 |
-
/**
|
152 |
-
* Check for second view option
|
153 |
-
* @var bol
|
154 |
-
*/
|
155 |
-
$secondViewOpt = ( isset( $this->options['secondView'] ) ) ? $this->options['secondView'] : '' ;
|
156 |
-
|
157 |
-
/*
|
158 |
-
* Set cookie if the user agree navigating through the pages of the site
|
159 |
-
*/
|
160 |
-
$secondView = false;
|
161 |
-
|
162 |
-
if(
|
163 |
-
// if is an HTML request (alternative methods???)
|
164 |
-
(strpos($_SERVER["HTTP_ACCEPT"],'html') !== false) &&
|
165 |
-
//if the page isn't privacy page
|
166 |
-
($_SERVER['REQUEST_URI']!=$this->options['slug']) &&
|
167 |
-
//if HTTP_REFERER is set
|
168 |
-
(isset($_SERVER['HTTP_REFERER'])) &&
|
169 |
-
//if isn't refresh
|
170 |
-
(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_PATH)!=$_SERVER['REQUEST_URI']) &&
|
171 |
-
//if referrer is not privacy page (to be evaluated)
|
172 |
-
(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_PATH)!=$this->options['slug']) &&
|
173 |
-
//if the cookie is not already set
|
174 |
-
(!isset( $_COOKIE[ $this->options['cookie_name'] ] )) &&
|
175 |
-
//if the referer is in the same domain
|
176 |
-
(parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST)==$_SERVER['HTTP_HOST']) &&
|
177 |
-
// If the secondView options is checked
|
178 |
-
( $secondViewOpt )
|
179 |
-
) {
|
180 |
-
setcookie($this->options['cookie_name'], $this->options['cookie_value'], time()+(3600*24*365), '/');
|
181 |
-
$secondView = true;
|
182 |
-
}
|
183 |
-
|
184 |
-
/**
|
185 |
-
* Shortcode to put a button in policy page
|
186 |
-
*/
|
187 |
-
add_shortcode( 'accept_button', array( $this, 'accept_button' ) );
|
188 |
-
|
189 |
-
if ( !isset( $_COOKIE[ $this->options['cookie_name'] ] ) && !$secondView ){
|
190 |
-
|
191 |
-
// W3TC Disable Caching
|
192 |
-
if ( !defined( 'DONOTCACHEPAGE' ) )
|
193 |
-
define('DONOTCACHEPAGE', true);
|
194 |
-
if ( !defined( 'SID' ) )
|
195 |
-
define('SID', true);
|
196 |
-
|
197 |
-
/**
|
198 |
-
* Background color for banner
|
199 |
-
* @var string
|
200 |
-
*/
|
201 |
-
$banner_bg = ( isset( $this->options['banner_bg'] ) ) ? $this->options['banner_bg'] : '' ;
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Color for text
|
205 |
-
* @var string
|
206 |
-
*/
|
207 |
-
$banner_text_color = ( isset( $this->options['banner_text_color'] ) ) ? $this->options['banner_text_color'] : '' ;
|
208 |
-
|
209 |
-
/**
|
210 |
-
* Text for banner
|
211 |
-
* @var string
|
212 |
-
*/
|
213 |
-
$text = ( isset( $this->options['text'] ) ) ? $this->options['text'] : '' ;
|
214 |
-
|
215 |
-
/**
|
216 |
-
* Text for buttom
|
217 |
-
* @var [type]
|
218 |
-
*/
|
219 |
-
$button_text = ( isset( $this->options['button_text'] ) ) ? $this->options['button_text'] : '' ;
|
220 |
-
|
221 |
-
/**
|
222 |
-
* Checkbox for third part cookie in content
|
223 |
-
* @var bol
|
224 |
-
*/
|
225 |
-
$block = ( isset( $this->options['block'] ) ) ? $this->options['block'] : '' ;
|
226 |
-
|
227 |
-
/**
|
228 |
-
* Checkbox for third part cookie in widget
|
229 |
-
* @var bol
|
230 |
-
*/
|
231 |
-
$widget_block = ( isset( $this->options['widget_block'] ) ) ? $this->options['widget_block'] : '' ;
|
232 |
-
|
233 |
-
/**
|
234 |
-
* Checkbox for third part cookie in all page (except head and footer)
|
235 |
-
* @var bol
|
236 |
-
*/
|
237 |
-
$all_block = ( isset( $this->options['all_block'] ) ) ? $this->options['all_block'] : '' ;
|
238 |
-
|
239 |
-
/**
|
240 |
-
* Checkbox custom scripts block
|
241 |
-
* @var bol
|
242 |
-
*/
|
243 |
-
$custom_script_block = ( isset( $this->options['custom_script_block'] ) ) ? $this->options['custom_script_block'] : '' ;
|
244 |
-
|
245 |
-
/**
|
246 |
-
* Text to put inside locked post and widget contents
|
247 |
-
* including the button text
|
248 |
-
* @var string
|
249 |
-
*/
|
250 |
-
$content_message_text = ( isset( $this->options['content_message_text'] ) ) ? $this->options['content_message_text'] : '' ;
|
251 |
-
|
252 |
-
/**
|
253 |
-
* Text for button in locked content and widget
|
254 |
-
* @var string
|
255 |
-
*/
|
256 |
-
$content_message_button_text = ( isset( $this->options['content_message_button_text'] ) ) ? $this->options['content_message_button_text'] : '' ;
|
257 |
-
|
258 |
-
/**
|
259 |
-
* Replacement for regex
|
260 |
-
* @var string
|
261 |
-
*/
|
262 |
-
// $this->valore = '<div class="el"><div style="padding:10px;margin-bottom: 18px;color: #b94a48;background-color: #f2dede;border: 1px solid #eed3d7; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);-webkit-border-radius: 4px;-moz-border-radius: 4px;border-radius: 4px;">' . esc_attr( $this->options['text'] ) . '<button onclick="cookieChoices.removeCookieConsent()">Try it</button></div><!-- $0 --></div>';
|
263 |
-
//
|
264 |
-
$this->valore = '<div class="el"><div style="padding:10px;margin-bottom: 18px;color:'.esc_attr( $banner_text_color ).';background-color:' . esc_attr( $banner_bg ) . ';text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);">' . esc_attr( $content_message_text ) . ' <button onclick="cookieChoices.removeCookieConsent()" style="color: '.esc_attr( $banner_text_color ).';padding: 3px;font-size: 12px;line-height: 12px;text-decoration: none;text-transform: uppercase;margin:0;display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid ' . esc_attr( $banner_text_color ) . ';background: rgba(255, 255, 255, 0.03);">' . esc_attr( $content_message_button_text ) . '</button></div><cookie></div>';
|
265 |
-
|
266 |
-
if ($block)
|
267 |
-
add_filter( 'the_content', array( $this, 'AutoErase' ), 11);
|
268 |
-
|
269 |
-
if ( $widget_block )
|
270 |
-
add_filter( 'widget_display_callback', array( $this, 'WidgetErase' ), 11, 3 );
|
271 |
-
|
272 |
-
if ( $all_block ) {
|
273 |
-
//add_action('wp_footer', array( $this, 'catchBody' ), -1000000);
|
274 |
-
add_action('wp_head', array( $this, 'bufferBodyStart' ), 1000000);
|
275 |
-
add_action('wp_footer', array( $this, 'bufferBodyEnd' ), -1000000);
|
276 |
-
}
|
277 |
-
if( $custom_script_block !== '' ) {
|
278 |
-
add_action('template_redirect', array( $this, 'bufferHeadStart' ), 2);
|
279 |
-
add_action('wp_head', array( $this, 'bufferHeadEnd' ), 99999);
|
280 |
-
add_action('wp_footer', array( $this, 'bufferFooterStart' ), -99998);
|
281 |
-
add_action('shutdown', array( $this, 'bufferFooterEnd' ), -1000000);
|
282 |
-
} else {
|
283 |
-
/**
|
284 |
-
* Function for print cookiechoiches inline
|
285 |
-
*/
|
286 |
-
add_action( 'wp_footer', array( $this, 'print_script_inline'), -99999 );
|
287 |
-
}
|
288 |
-
|
289 |
-
/**
|
290 |
-
* Only for debug
|
291 |
-
*/
|
292 |
-
// var_dump($_COOKIE);
|
293 |
-
// var_dump(headers_list());
|
294 |
-
|
295 |
-
}
|
296 |
-
}
|
297 |
-
}
|
298 |
|
|
|
|
|
299 |
|
300 |
-
|
301 |
-
|
302 |
-
if($custom_script_block=='') {
|
303 |
-
return $buffer;
|
304 |
-
} else {
|
305 |
-
$custom_script_block = preg_replace( "/([\r|\n]*)<---------SEP--------->([\r|\n]*)/is", "<---------SEP--------->", $custom_script_block );
|
306 |
-
$custom_script_block_array = explode("<---------SEP--------->", $custom_script_block);
|
307 |
-
foreach($custom_script_block_array AS $single_script) {
|
308 |
-
$count_replace = 0;
|
309 |
-
$buffer = str_replace(trim($single_script), "<!-- removed from Italy Cookie Choices Plugin -->", $buffer, $count_replace);
|
310 |
-
if($count_replace>0)
|
311 |
-
$this->js_array[] = trim($single_script);
|
312 |
-
}
|
313 |
-
return $buffer;
|
314 |
-
}
|
315 |
-
}
|
316 |
-
|
317 |
-
public function bufferBodyStart() {
|
318 |
-
if (ob_get_contents())
|
319 |
-
ob_end_flush();
|
320 |
-
ob_start();
|
321 |
-
|
322 |
-
}
|
323 |
-
|
324 |
-
public function bufferBodyEnd() {
|
325 |
-
$buffer = ob_get_contents();
|
326 |
-
if (ob_get_contents())
|
327 |
-
ob_end_clean();
|
328 |
-
preg_match("/(.*)(<body.*)/s", $buffer, $matches);
|
329 |
-
$head = $matches[1];
|
330 |
-
$body = $matches[2];
|
331 |
-
$this->matches( $this->pattern, $body );
|
332 |
-
$body = preg_replace( $this->pattern, $this->valore , $body);
|
333 |
-
$buffer_new = $head.$body;
|
334 |
-
echo '<!-- ICCStartBody -->'.$buffer_new.'<!-- ICCEndBody -->';
|
335 |
-
}
|
336 |
-
|
337 |
-
public function bufferFooterStart() {
|
338 |
-
if (ob_get_contents())
|
339 |
-
ob_end_flush();
|
340 |
-
ob_start();
|
341 |
-
}
|
342 |
-
|
343 |
-
public function bufferFooterEnd() {
|
344 |
-
$buffer = ob_get_contents();
|
345 |
-
if (ob_get_contents())
|
346 |
-
ob_end_clean();
|
347 |
-
// if is an HTML request (alternative methods???)
|
348 |
-
if(strpos($_SERVER["HTTP_ACCEPT"],'html') !== false) {
|
349 |
-
$buffer_new = $this->removeCustomScript($buffer);
|
350 |
-
/**
|
351 |
-
* Function for print cookiechoiches inline
|
352 |
-
*/
|
353 |
-
$this->print_script_inline();
|
354 |
-
echo '<!-- ICCStartFooter -->'.$buffer_new.'<!-- ICCEndFooter -->';
|
355 |
-
} else {
|
356 |
-
echo $buffer;
|
357 |
-
}
|
358 |
-
}
|
359 |
-
|
360 |
-
public function bufferHeadStart() {
|
361 |
-
if (ob_get_contents())
|
362 |
-
ob_end_flush();
|
363 |
-
ob_start();
|
364 |
-
}
|
365 |
-
|
366 |
-
public function bufferHeadEnd() {
|
367 |
-
$buffer = ob_get_contents();
|
368 |
-
if (ob_get_contents())
|
369 |
-
ob_end_clean();
|
370 |
-
$buffer_new = $this->removeCustomScript($buffer);
|
371 |
-
echo '<!-- ICCStartHead -->'.$buffer_new.'<!-- ICCEndHead -->';
|
372 |
-
}
|
373 |
-
|
374 |
-
/**
|
375 |
-
* Add page for italy-cookie-choices admin page
|
376 |
-
*/
|
377 |
-
public function addMenuPage(){
|
378 |
-
|
379 |
-
add_options_page(
|
380 |
-
__('Italy Cookie Choices Dashboard', 'italy-cookie-choices'),
|
381 |
-
'Italy Cookie Choices',
|
382 |
-
$this->capability,
|
383 |
-
'italy-cookie-choices',
|
384 |
-
array( $this, 'dashboard')
|
385 |
-
);
|
386 |
-
}
|
387 |
-
|
388 |
-
/**
|
389 |
-
* The dashboard callback
|
390 |
-
*/
|
391 |
-
public function dashboard(){
|
392 |
-
|
393 |
-
if ( !current_user_can( $this->capability ) )
|
394 |
-
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
395 |
-
|
396 |
-
?>
|
397 |
-
<div class="wrap">
|
398 |
-
|
399 |
-
<?php //settings_errors('italy_cookie_id'); ?>
|
400 |
-
|
401 |
-
<form action='options.php' method='post'>
|
402 |
-
|
403 |
-
<?php
|
404 |
-
settings_fields( 'italy_cl_options_group' );
|
405 |
-
do_settings_sections( 'italy_cl_options_group' );
|
406 |
-
submit_button();
|
407 |
-
?>
|
408 |
-
|
409 |
-
</form>
|
410 |
-
</div>
|
411 |
-
<?php
|
412 |
-
|
413 |
-
}
|
414 |
-
|
415 |
-
/**
|
416 |
-
* [italy_cl_settings_init description]
|
417 |
-
* @return [type] [description]
|
418 |
-
*/
|
419 |
-
public function italy_cl_settings_init() {
|
420 |
-
|
421 |
-
/**
|
422 |
-
* Load Plugin Textdomain
|
423 |
-
*/
|
424 |
-
// load_plugin_textdomain('italy-cookie-choices', false, ITALY_COOKIE_CHOICES_PLUGIN_PATH . 'lang/' );
|
425 |
-
load_plugin_textdomain('italy-cookie-choices', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
|
426 |
-
|
427 |
-
/**
|
428 |
-
* Create default options
|
429 |
-
* @var array
|
430 |
-
*/
|
431 |
-
$this->default_options = array(
|
432 |
-
|
433 |
-
'text' => '',
|
434 |
-
'url' => '',
|
435 |
-
'anchor_text' => '',
|
436 |
-
'button_text' => '',
|
437 |
-
'cookie_name' => $this->cookieName,
|
438 |
-
'cookie_value' => $this->cookieVal,
|
439 |
-
'content_message_text' => '',
|
440 |
-
'content_message_button_text' => ''
|
441 |
-
|
442 |
-
);
|
443 |
-
|
444 |
-
/**
|
445 |
-
* All options in array
|
446 |
-
* @var array
|
447 |
-
*/
|
448 |
-
$this->options = get_option( 'italy_cookie_choices' );
|
449 |
-
|
450 |
-
/**
|
451 |
-
* If the theme options don't exist, create them.
|
452 |
-
*/
|
453 |
-
if( false === $this->options )
|
454 |
-
add_option( 'italy_cookie_choices', $this->default_options );
|
455 |
-
|
456 |
-
/**
|
457 |
-
* Section options page
|
458 |
-
*/
|
459 |
-
add_settings_section(
|
460 |
-
'setting_section',
|
461 |
-
__( 'Italy Cookie Choices options page', 'italy-cookie-choices' ),
|
462 |
-
array( $this, 'italy_cl_settings_section_callback'),
|
463 |
-
'italy_cl_options_group'
|
464 |
-
);
|
465 |
-
|
466 |
-
/**
|
467 |
-
* Checkbox for activation
|
468 |
-
*/
|
469 |
-
add_settings_field(
|
470 |
-
'active',
|
471 |
-
__( 'Activate', 'italy-cookie-choices' ),
|
472 |
-
array( $this, 'italy_cl_option_active'),
|
473 |
-
'italy_cl_options_group',
|
474 |
-
'setting_section'
|
475 |
-
);
|
476 |
-
|
477 |
-
/**
|
478 |
-
* How to display banner
|
479 |
-
* Default Bar
|
480 |
-
*/
|
481 |
-
add_settings_field(
|
482 |
-
'banner',
|
483 |
-
__( 'Where display the banner', 'italy-cookie-choices' ),
|
484 |
-
array( $this, 'italy_cl_option_banner'),
|
485 |
-
'italy_cl_options_group',
|
486 |
-
'setting_section'
|
487 |
-
);
|
488 |
-
|
489 |
-
/**
|
490 |
-
* Checkbox for scroll event
|
491 |
-
*/
|
492 |
-
add_settings_field(
|
493 |
-
'scroll',
|
494 |
-
__( 'Mouse scroll event', 'italy-cookie-choices' ),
|
495 |
-
array( $this, 'italy_cl_option_scroll'),
|
496 |
-
'italy_cl_options_group',
|
497 |
-
'setting_section'
|
498 |
-
);
|
499 |
-
|
500 |
-
/**
|
501 |
-
* Checkbox for open in new page
|
502 |
-
*/
|
503 |
-
add_settings_field(
|
504 |
-
'secondView',
|
505 |
-
__( 'Accept on second view', 'italy-cookie-choices' ),
|
506 |
-
array( $this, 'italy_cl_option_secondView'),
|
507 |
-
'italy_cl_options_group',
|
508 |
-
'setting_section'
|
509 |
-
);
|
510 |
-
|
511 |
-
/**
|
512 |
-
* Checkbox for reload page
|
513 |
-
*/
|
514 |
-
add_settings_field(
|
515 |
-
'reload',
|
516 |
-
__( 'Refresh page', 'italy-cookie-choices' ),
|
517 |
-
array( $this, 'italy_cl_option_reload'),
|
518 |
-
'italy_cl_options_group',
|
519 |
-
'setting_section'
|
520 |
-
);
|
521 |
-
|
522 |
-
/**
|
523 |
-
* Input for short policy text
|
524 |
-
*/
|
525 |
-
add_settings_field(
|
526 |
-
'text',
|
527 |
-
__( 'Text to display', 'italy-cookie-choices' ),
|
528 |
-
array( $this, 'italy_cl_option_text'),
|
529 |
-
'italy_cl_options_group',
|
530 |
-
'setting_section'
|
531 |
-
);
|
532 |
-
|
533 |
-
/**
|
534 |
-
* Input for url policy page
|
535 |
-
*/
|
536 |
-
add_settings_field(
|
537 |
-
'url',
|
538 |
-
__( 'URL for cookie policy', 'italy-cookie-choices' ),
|
539 |
-
array( $this, 'italy_cl_option_url'),
|
540 |
-
'italy_cl_options_group',
|
541 |
-
'setting_section'
|
542 |
-
);
|
543 |
-
|
544 |
-
/**
|
545 |
-
* Input for anchor text
|
546 |
-
*/
|
547 |
-
add_settings_field(
|
548 |
-
'anchor_text',
|
549 |
-
__( 'Anchor text for URL', 'italy-cookie-choices' ),
|
550 |
-
array( $this, 'italy_cl_option_anchor_text'),
|
551 |
-
'italy_cl_options_group',
|
552 |
-
'setting_section'
|
553 |
-
);
|
554 |
-
|
555 |
-
/**
|
556 |
-
* Input for button text
|
557 |
-
*/
|
558 |
-
add_settings_field(
|
559 |
-
'button_text',
|
560 |
-
__( 'Button text', 'italy-cookie-choices' ),
|
561 |
-
array( $this, 'italy_cl_option_button_text'),
|
562 |
-
'italy_cl_options_group',
|
563 |
-
'setting_section'
|
564 |
-
);
|
565 |
-
|
566 |
-
/**
|
567 |
-
* Settings sections for Style
|
568 |
-
*/
|
569 |
-
add_settings_section(
|
570 |
-
'style_setting_section',
|
571 |
-
__( 'Style settings', 'italy-cookie-choices' ),
|
572 |
-
array( $this, 'italy_cl_style_settings_section_callback'),
|
573 |
-
'italy_cl_options_group'
|
574 |
-
);
|
575 |
-
|
576 |
-
/**
|
577 |
-
* Select box for js_template selection
|
578 |
-
*/
|
579 |
-
add_settings_field(
|
580 |
-
'js_template',
|
581 |
-
__( 'CookieChoices Template', 'italy-cookie-choices' ),
|
582 |
-
array( $this, 'italy_cl_option_js_template'),
|
583 |
-
'italy_cl_options_group',
|
584 |
-
'style_setting_section'
|
585 |
-
);
|
586 |
-
|
587 |
-
/**
|
588 |
-
* Checkbox for activation
|
589 |
-
*/
|
590 |
-
add_settings_field(
|
591 |
-
'html_margin',
|
592 |
-
__( 'HTML top margin', 'italy-cookie-choices' ),
|
593 |
-
array( $this, 'italy_cl_option_html_margin'),
|
594 |
-
'italy_cl_options_group',
|
595 |
-
'style_setting_section'
|
596 |
-
);
|
597 |
-
|
598 |
-
/**
|
599 |
-
* Background color for banner
|
600 |
-
*/
|
601 |
-
add_settings_field(
|
602 |
-
'banner_bg',
|
603 |
-
__( 'Banner Background color', 'italy-cookie-choices' ),
|
604 |
-
array( $this, 'italy_cl_option_banner_bg'),
|
605 |
-
'italy_cl_options_group',
|
606 |
-
'style_setting_section'
|
607 |
-
);
|
608 |
-
|
609 |
-
/**
|
610 |
-
* Color for text in banner
|
611 |
-
*/
|
612 |
-
add_settings_field(
|
613 |
-
'banner_text_color',
|
614 |
-
__( 'Banner text color', 'italy-cookie-choices' ),
|
615 |
-
array( $this, 'italy_cl_option_banner_text_color'),
|
616 |
-
'italy_cl_options_group',
|
617 |
-
'style_setting_section'
|
618 |
-
);
|
619 |
-
|
620 |
-
/**
|
621 |
-
* Settings sections for Advanced options
|
622 |
-
*/
|
623 |
-
add_settings_section(
|
624 |
-
'advanced_setting_section',
|
625 |
-
__( 'Advanced settings', 'italy-cookie-choices' ),
|
626 |
-
array( $this, 'italy_cl_advanced_settings_section_callback'),
|
627 |
-
'italy_cl_options_group'
|
628 |
-
);
|
629 |
-
|
630 |
-
/**
|
631 |
-
* cookie name
|
632 |
-
*/
|
633 |
-
add_settings_field(
|
634 |
-
'cookie_name',
|
635 |
-
__( 'Cookie name', 'italy-cookie-choices' ),
|
636 |
-
array( $this, 'italy_cl_option_cookie_name'),
|
637 |
-
'italy_cl_options_group',
|
638 |
-
'advanced_setting_section'
|
639 |
-
);
|
640 |
-
|
641 |
-
/**
|
642 |
-
* cookie value
|
643 |
-
*/
|
644 |
-
add_settings_field(
|
645 |
-
'cookie_value',
|
646 |
-
__( 'Cookie value', 'italy-cookie-choices' ),
|
647 |
-
array( $this, 'italy_cl_option_cookie_value'),
|
648 |
-
'italy_cl_options_group',
|
649 |
-
'advanced_setting_section'
|
650 |
-
);
|
651 |
-
|
652 |
-
/**
|
653 |
-
* Cookie policy page slug
|
654 |
-
*/
|
655 |
-
add_settings_field(
|
656 |
-
'slug',
|
657 |
-
__( 'Cookie policy page slug', 'italy-cookie-choices' ),
|
658 |
-
array( $this, 'italy_cl_option_slug'),
|
659 |
-
'italy_cl_options_group',
|
660 |
-
'advanced_setting_section'
|
661 |
-
);
|
662 |
-
|
663 |
-
/**
|
664 |
-
* Checkbox for open in new page
|
665 |
-
*/
|
666 |
-
add_settings_field(
|
667 |
-
'target',
|
668 |
-
__( 'Open policy in new page', 'italy-cookie-choices' ),
|
669 |
-
array( $this, 'italy_cl_option_target'),
|
670 |
-
'italy_cl_options_group',
|
671 |
-
'advanced_setting_section'
|
672 |
-
);
|
673 |
-
|
674 |
-
/**
|
675 |
-
* Checkbox for activation third part cookie eraser
|
676 |
-
*/
|
677 |
-
add_settings_field(
|
678 |
-
'block',
|
679 |
-
__( 'Third part cookie block (beta)', 'italy-cookie-choices' ),
|
680 |
-
array( $this, 'italy_cl_option_block'),
|
681 |
-
'italy_cl_options_group',
|
682 |
-
'advanced_setting_section'
|
683 |
-
);
|
684 |
-
|
685 |
-
/**
|
686 |
-
* Function for custom script block
|
687 |
-
*/
|
688 |
-
add_settings_field(
|
689 |
-
'custom_script_block',
|
690 |
-
__( 'Function for custom script block', 'italy-cookie-choices' ),
|
691 |
-
array( $this, 'italy_cl_option_custom_script_block'),
|
692 |
-
'italy_cl_options_group',
|
693 |
-
'advanced_setting_section'
|
694 |
-
);
|
695 |
-
|
696 |
-
/**
|
697 |
-
* Function for content message text
|
698 |
-
*/
|
699 |
-
add_settings_field(
|
700 |
-
'content_message_text',
|
701 |
-
__( 'Text message for locked embedded content', 'italy-cookie-choices' ),
|
702 |
-
array( $this, 'italy_cl_option_content_message_text'),
|
703 |
-
'italy_cl_options_group',
|
704 |
-
'advanced_setting_section'
|
705 |
-
);
|
706 |
|
707 |
/**
|
708 |
-
*
|
709 |
*/
|
710 |
-
|
711 |
-
'content_message_button_text',
|
712 |
-
__( 'Button text to activate locked embedded content', 'italy-cookie-choices' ),
|
713 |
-
array( $this, 'italy_cl_option_content_message_button_text'),
|
714 |
-
'italy_cl_options_group',
|
715 |
-
'advanced_setting_section'
|
716 |
-
);
|
717 |
|
718 |
/**
|
719 |
-
*
|
720 |
*/
|
721 |
-
|
722 |
-
'italy_cl_options_group',
|
723 |
-
'italy_cookie_choices',
|
724 |
-
array( $this, 'sanitize_callback')
|
725 |
-
);
|
726 |
-
|
727 |
-
|
728 |
-
}
|
729 |
-
|
730 |
-
|
731 |
-
/**
|
732 |
-
* Display message in plugin control panel
|
733 |
-
* @return string Return message
|
734 |
-
*/
|
735 |
-
public function italy_cl_settings_section_callback() {
|
736 |
-
|
737 |
-
_e( 'Customize your banner for cookie law', 'italy-cookie-choices' );
|
738 |
-
|
739 |
-
}
|
740 |
-
|
741 |
-
/**
|
742 |
-
* Snippet for checkbox
|
743 |
-
* @return strimg Activate banner in front-end Default doesn't display
|
744 |
-
*/
|
745 |
-
public function italy_cl_option_active($args) {
|
746 |
-
|
747 |
-
$active = ( isset( $this->options['active'] ) ) ? $this->options['active'] : '' ;
|
748 |
-
?>
|
749 |
-
|
750 |
-
<input type='checkbox' name='italy_cookie_choices[active]' <?php checked( $active, 1 ); ?> value='1'>
|
751 |
-
<label for="italy_cookie_choices[active]">
|
752 |
-
<?php _e( 'Display banner for Cookie Law in front-end', 'italy-cookie-choices' ); ?>
|
753 |
-
</label>
|
754 |
-
|
755 |
-
<?php
|
756 |
-
|
757 |
-
}
|
758 |
-
|
759 |
-
/**
|
760 |
-
* Choose how to display banner in page
|
761 |
-
* @return string Display input and labels in plugin options page
|
762 |
-
*/
|
763 |
-
public function italy_cl_option_banner($args) {
|
764 |
-
|
765 |
-
$banner = ( isset( $this->options['banner'] ) ) ? $this->options['banner'] : '1' ;
|
766 |
-
|
767 |
-
?>
|
768 |
-
|
769 |
-
<input name="italy_cookie_choices[banner]" type="radio" value="1" id="radio_1" <?php checked( '1', $banner ); ?> />
|
770 |
-
|
771 |
-
<label for="radio_1">
|
772 |
-
<?php _e( 'Top Bar (Default, Display a top bar with your message)', 'italy-cookie-choices' ); ?>
|
773 |
-
</label>
|
774 |
-
|
775 |
-
<br>
|
776 |
-
|
777 |
-
<input name="italy_cookie_choices[banner]" type="radio" value="2" id="radio_2" <?php checked( '2', $banner ); ?> />
|
778 |
-
|
779 |
-
<label for="radio_2">
|
780 |
-
<?php _e( 'Dialog (Display an overlay with your message)', 'italy-cookie-choices' ); ?>
|
781 |
-
</label>
|
782 |
-
|
783 |
-
<br>
|
784 |
-
|
785 |
-
<input name="italy_cookie_choices[banner]" type="radio" value="3" id="radio_3" <?php checked( '3', $banner ); ?> />
|
786 |
-
|
787 |
-
<label for="radio_3">
|
788 |
-
<?php _e( 'Bottom Bar (Display a bar in the footer with your message)', 'italy-cookie-choices' ); ?>
|
789 |
-
</label>
|
790 |
|
791 |
|
792 |
-
|
793 |
-
<?php
|
794 |
-
|
795 |
-
}
|
796 |
-
|
797 |
-
/**
|
798 |
-
* Snippet for checkbox
|
799 |
-
* @return strimg Activate banner in front-end Default doesn't display
|
800 |
-
*/
|
801 |
-
public function italy_cl_option_scroll($args) {
|
802 |
-
|
803 |
-
$scroll = ( isset( $this->options['scroll'] ) ) ? $this->options['scroll'] : '' ;
|
804 |
-
?>
|
805 |
-
|
806 |
-
<input type='checkbox' name='italy_cookie_choices[scroll]' <?php checked( $scroll, 1 ); ?> value='1'>
|
807 |
-
<label for="italy_cookie_choices[scroll]">
|
808 |
-
<?php _e( 'Accepts disclosures on mouse scroll event', 'italy-cookie-choices' ); ?>
|
809 |
-
</label>
|
810 |
-
|
811 |
-
<?php
|
812 |
-
|
813 |
-
}
|
814 |
-
|
815 |
-
/**
|
816 |
-
* Snippet for second view checkbox $secondView
|
817 |
-
* @return strimg Activate for accept on second view
|
818 |
-
* Default do nothing
|
819 |
-
*/
|
820 |
-
public function italy_cl_option_secondView($args) {
|
821 |
-
|
822 |
-
$secondView = ( isset( $this->options['secondView'] ) ) ? $this->options['secondView'] : '' ;
|
823 |
-
|
824 |
-
?>
|
825 |
-
|
826 |
-
<input type='checkbox' name='italy_cookie_choices[secondView]' <?php checked( $secondView, 1 ); ?> value='1'>
|
827 |
-
<label for="italy_cookie_choices[secondView]">
|
828 |
-
<?php _e( 'Activate accept on second view', 'italy-cookie-choices' ); ?>
|
829 |
-
</label>
|
830 |
-
|
831 |
-
<?php
|
832 |
-
|
833 |
-
}
|
834 |
-
|
835 |
-
/**
|
836 |
-
* Snippet for reload
|
837 |
-
* @return strimg Reload page after click
|
838 |
-
*/
|
839 |
-
public function italy_cl_option_reload($args) {
|
840 |
-
|
841 |
-
$reload = ( isset( $this->options['reload'] ) ) ? $this->options['reload'] : '' ;
|
842 |
-
?>
|
843 |
-
|
844 |
-
<input type='checkbox' name='italy_cookie_choices[reload]' <?php checked( $reload, 1 ); ?> value='1'>
|
845 |
-
<label for="italy_cookie_choices[reload]">
|
846 |
-
<?php _e( 'Refresh page after button click (DEPRECATED)', 'italy-cookie-choices' ); ?>
|
847 |
-
</label>
|
848 |
-
|
849 |
-
<?php
|
850 |
-
|
851 |
}
|
852 |
|
853 |
/**
|
854 |
-
*
|
855 |
-
* @return string
|
856 |
*/
|
857 |
-
|
858 |
|
859 |
-
|
860 |
|
861 |
-
|
862 |
-
<br>
|
863 |
-
<label for="italy_cookie_choices[text]">
|
864 |
-
<?php echo __( 'People will see this notice only the first time that they enter your site', 'italy-cookie-choices' ); ?>
|
865 |
-
</label>
|
866 |
|
867 |
-
|
|
|
868 |
|
869 |
-
|
|
|
870 |
|
871 |
-
|
872 |
-
* Input for url policy page
|
873 |
-
* @return string
|
874 |
-
*/
|
875 |
-
public function italy_cl_option_url($args) {
|
876 |
-
|
877 |
-
?>
|
878 |
-
<input type="text" id="italy_cookie_choices[url]" name="italy_cookie_choices[url]" value="<?php echo esc_url( $this->options['url'] ); ?>" placeholder="<?php _e( 'e.g. http://www.aboutcookies.org/', 'italy-cookie-choices' ) ?>" size="70" />
|
879 |
-
<br>
|
880 |
-
<label for="italy_cookie_choices[url]">
|
881 |
-
<?php echo __( 'Insert here the link to your policy page', 'italy-cookie-choices' ); ?>
|
882 |
-
</label>
|
883 |
-
|
884 |
-
<?php
|
885 |
|
|
|
|
|
886 |
}
|
887 |
|
888 |
/**
|
889 |
-
*
|
890 |
-
* @return string
|
891 |
*/
|
892 |
-
public function
|
893 |
-
|
894 |
-
?>
|
895 |
-
<input type="text" id="italy_cookie_choices[anchor_text]" name="italy_cookie_choices[anchor_text]" value="<?php echo esc_attr( $this->options['anchor_text'] ); ?>" placeholder="<?php _e( 'e.g. More Info', 'italy-cookie-choices' ) ?>" />
|
896 |
-
|
897 |
-
<label for="italy_cookie_choices[anchor_text]">
|
898 |
-
<?php echo __( 'Insert here anchor text for the link', 'italy-cookie-choices'); ?>
|
899 |
-
</label>
|
900 |
-
|
901 |
-
<?php
|
902 |
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
* @return string
|
908 |
-
*/
|
909 |
-
public function italy_cl_option_button_text($args) {
|
910 |
-
|
911 |
-
?>
|
912 |
-
<input type="text" id="italy_cookie_choices[button_text]" name="italy_cookie_choices[button_text]" value="<?php echo esc_attr( $this->options['button_text'] ); ?>" placeholder="<?php _e( 'e.g. Close', 'italy-cookie-choices' ) ?>" />
|
913 |
-
|
914 |
-
<label for="italy_cookie_choices[button_text]">
|
915 |
-
<?php echo __( 'Insert here name of button (e.g. "Close") ', 'italy-cookie-choices' ); ?>
|
916 |
-
</label>
|
917 |
-
|
918 |
-
<?php
|
919 |
-
|
920 |
-
}
|
921 |
-
|
922 |
-
/**
|
923 |
-
* NUOVA SETTINGS SECTIONS PER LO STILE
|
924 |
-
*/
|
925 |
-
|
926 |
-
/**
|
927 |
-
* Display message in stile plugin panel
|
928 |
-
* @return string
|
929 |
-
*/
|
930 |
-
public function italy_cl_style_settings_section_callback() {
|
931 |
-
|
932 |
-
_e( 'Customize your style settings', 'italy-cookie-choices' );
|
933 |
-
|
934 |
-
}
|
935 |
-
|
936 |
-
/**
|
937 |
-
* Snippet for checkbox
|
938 |
-
* @return strimg Activate banner in front-end Default doesn't display
|
939 |
-
*/
|
940 |
-
public function italy_cl_option_html_margin($args) {
|
941 |
-
|
942 |
-
$html_margin = ( isset( $this->options['html_margin'] ) ) ? $this->options['html_margin'] : '' ;
|
943 |
-
|
944 |
-
?>
|
945 |
-
|
946 |
-
<input type='checkbox' name='italy_cookie_choices[html_margin]' <?php checked( $html_margin, 1 ); ?> value='1'>
|
947 |
-
<label for="italy_cookie_choices[html_margin]">
|
948 |
-
<?php _e( 'Add a page top margin for info top bar, only for default topbar stile', 'italy-cookie-choices' ); ?>
|
949 |
-
</label>
|
950 |
-
|
951 |
-
<?php
|
952 |
-
|
953 |
-
}
|
954 |
-
|
955 |
-
/**
|
956 |
-
* Snippet for select
|
957 |
-
* @return strimg Chose the JS_Template to use.
|
958 |
-
*/
|
959 |
-
public function italy_cl_option_js_template($args) {
|
960 |
-
|
961 |
-
$js_template = ( isset( $this->options['js_template'] ) ) ? $this->options['js_template'] : $this->js_template ;
|
962 |
-
|
963 |
-
?>
|
964 |
-
<select name='italy_cookie_choices[js_template]'>
|
965 |
-
<option value="default" <?php if ($js_template === 'default') echo 'selected';?>>Default cookiechoices template (centered with text links)</option>
|
966 |
-
<option value="bigbutton" <?php if ($js_template === 'bigbutton') echo 'selected';?>>Centered container with left aligned text and big buttons</option>
|
967 |
-
<option value="smallbutton" <?php if ($js_template === 'smallbutton') echo 'selected';?>>Centered container with left aligned text and small buttons</option>
|
968 |
-
<!--<option value="custom" <?php if ($js_template === 'default') echo 'selected';?>>Custom CSS</option>-->
|
969 |
-
</select>
|
970 |
-
<label for="italy_cookie_choices[js_template]">
|
971 |
-
<?php _e( 'Select the template to use', 'italy-cookie-choices' ); ?>
|
972 |
-
</label>
|
973 |
-
|
974 |
-
<?php
|
975 |
-
|
976 |
-
}
|
977 |
-
|
978 |
-
/**
|
979 |
-
* Snippet for checkbox
|
980 |
-
* @return strimg Activate banner in front-end Default doesn't display
|
981 |
-
*/
|
982 |
-
public function italy_cl_option_banner_bg($args) {
|
983 |
-
|
984 |
-
$banner_bg = ( isset( $this->options['banner_bg'] ) ) ? $this->options['banner_bg'] : '' ;
|
985 |
-
|
986 |
-
?>
|
987 |
-
|
988 |
-
<input type="text" id="italy_cookie_choices[banner_bg]" name="italy_cookie_choices[banner_bg]" value="<?php echo esc_attr( $banner_bg ); ?>" placeholder="<?php echo esc_attr( $banner_bg ); ?>" class="color-field" data-default-color="#fff"/>
|
989 |
-
|
990 |
-
|
991 |
-
<label for="italy_cookie_choices[banner_bg]">
|
992 |
-
<?php _e( 'Custom Background color for banner', 'italy-cookie-choices' ); ?>
|
993 |
-
</label>
|
994 |
-
|
995 |
-
<?php
|
996 |
-
|
997 |
-
}
|
998 |
-
|
999 |
-
/**
|
1000 |
-
* Snippet for banner text color
|
1001 |
-
* @return strimg Activate banner in front-end Default doesn't display
|
1002 |
-
*/
|
1003 |
-
public function italy_cl_option_banner_text_color($args) {
|
1004 |
-
|
1005 |
-
$banner_text_color = ( isset( $this->options['banner_text_color'] ) ) ? $this->options['banner_text_color'] : '' ;
|
1006 |
-
|
1007 |
-
?>
|
1008 |
-
|
1009 |
-
<input type="text" id="italy_cookie_choices[banner_text_color]" name="italy_cookie_choices[banner_text_color]" value="<?php echo esc_attr( $banner_text_color ); ?>" placeholder="<?php echo esc_attr( $banner_text_color ); ?>" class="color-field" data-default-color="#000"/>
|
1010 |
-
|
1011 |
-
<label for="italy_cookie_choices[banner_text_color]">
|
1012 |
-
<?php _e( 'Custom text color for banner', 'italy-cookie-choices' ); ?>
|
1013 |
-
</label>
|
1014 |
-
|
1015 |
-
<?php
|
1016 |
-
|
1017 |
-
}
|
1018 |
-
|
1019 |
-
/**
|
1020 |
-
* NUOVA SETTINGS SECTIONS PER LE OPZIONI AVANZATE
|
1021 |
-
*/
|
1022 |
-
|
1023 |
-
/**
|
1024 |
-
* Display message in plugin advanced setting section
|
1025 |
-
* @return string
|
1026 |
-
*/
|
1027 |
-
public function italy_cl_advanced_settings_section_callback() {
|
1028 |
-
|
1029 |
-
_e( 'Customize your advanced settings', 'italy-cookie-choices' );
|
1030 |
-
|
1031 |
-
}
|
1032 |
-
|
1033 |
-
/**
|
1034 |
-
* Snippet for cookie name
|
1035 |
-
* @return strimg Activate banner in front-end Default doesn't display
|
1036 |
-
*/
|
1037 |
-
public function italy_cl_option_cookie_name($args) {
|
1038 |
-
|
1039 |
-
$cookie_name = ( isset( $this->options['cookie_name'] ) ) ? $this->options['cookie_name'] : $this->cookieName ;
|
1040 |
-
|
1041 |
-
?>
|
1042 |
-
<input type="text" id="italy_cookie_choices[cookie_name]" name="italy_cookie_choices[cookie_name]" value="<?php echo esc_attr( $cookie_name ); ?>" placeholder="<?php echo esc_attr( $this->cookieName ); ?>" />
|
1043 |
-
|
1044 |
-
<label for="italy_cookie_choices[cookie_name]">
|
1045 |
-
<?php _e( 'Insert your cookie name (Default: displayCookieConsent)', 'italy-cookie-choices' ); ?>
|
1046 |
-
</label>
|
1047 |
-
|
1048 |
-
<?php
|
1049 |
-
|
1050 |
-
}
|
1051 |
-
|
1052 |
-
/**
|
1053 |
-
* Snippet for cookie value
|
1054 |
-
* @return strimg Activate banner in front-end Default doesn't display
|
1055 |
-
*/
|
1056 |
-
public function italy_cl_option_cookie_value($args) {
|
1057 |
-
|
1058 |
-
$cookie_value = ( isset( $this->options['cookie_value'] ) ) ? $this->options['cookie_value'] : $this->cookieVal ;
|
1059 |
-
|
1060 |
-
?>
|
1061 |
-
<input type="text" id="italy_cookie_choices[cookie_value]" name="italy_cookie_choices[cookie_value]" value="<?php echo esc_attr( $cookie_value ); ?>" placeholder="<?php echo esc_attr( $this->cookieVal ); ?>" />
|
1062 |
-
|
1063 |
-
<label for="italy_cookie_choices[cookie_value]">
|
1064 |
-
<?php _e( 'Insert your cookie value (Default: y)', 'italy-cookie-choices' ); ?>
|
1065 |
-
</label>
|
1066 |
-
|
1067 |
-
<?php
|
1068 |
-
|
1069 |
-
}
|
1070 |
-
|
1071 |
-
/**
|
1072 |
-
* Slug for cookie policy page
|
1073 |
-
* @return strimg Slug for cookie policy page Default null
|
1074 |
-
*/
|
1075 |
-
public function italy_cl_option_slug($args) {
|
1076 |
-
|
1077 |
-
$slug = ( isset( $this->options['slug'] ) ) ? $this->options['slug'] : '' ;
|
1078 |
-
|
1079 |
-
?>
|
1080 |
-
<input type="text" id="italy_cookie_choices[slug]" name="italy_cookie_choices[slug]" value="<?php echo esc_attr( $slug ); ?>" placeholder="<?php _e( 'e.g. your-policy-url.html', 'italy-cookie-choices' ); ?>" />
|
1081 |
-
|
1082 |
-
<label for="italy_cookie_choices[slug]">
|
1083 |
-
<?php _e( 'Insert your cookie policy page slug (e.g. your-policy-url), it will display only topbar in your cookie policy page', 'italy-cookie-choices' ); ?>
|
1084 |
-
</label>
|
1085 |
-
|
1086 |
-
<?php
|
1087 |
-
|
1088 |
-
}
|
1089 |
-
|
1090 |
-
/**
|
1091 |
-
* Snippet for target checkbox
|
1092 |
-
* @return strimg Activate for open policy page in new tab
|
1093 |
-
* Default open in same tab
|
1094 |
-
*/
|
1095 |
-
public function italy_cl_option_target($args) {
|
1096 |
-
|
1097 |
-
$target = ( isset( $this->options['target'] ) ) ? $this->options['target'] : '' ;
|
1098 |
-
|
1099 |
-
?>
|
1100 |
-
|
1101 |
-
<input type='checkbox' name='italy_cookie_choices[target]' <?php checked( $target, 1 ); ?> value='1'>
|
1102 |
-
<label for="italy_cookie_choices[target]">
|
1103 |
-
<?php _e( 'Open your cookie policy page in new one', 'italy-cookie-choices' ); ?>
|
1104 |
-
</label>
|
1105 |
-
|
1106 |
-
<?php
|
1107 |
-
|
1108 |
-
}
|
1109 |
-
|
1110 |
-
/**
|
1111 |
-
* Snippet for target checkbox
|
1112 |
-
* @return strimg Activate for open policy page in new tab
|
1113 |
-
* Default open in same tab
|
1114 |
-
*/
|
1115 |
-
public function italy_cl_option_block($args) {
|
1116 |
-
|
1117 |
-
$all_block = ( isset( $this->options['all_block'] ) ) ? $this->options['all_block'] : '' ;
|
1118 |
-
|
1119 |
-
$block = ( isset( $this->options['block'] ) && $all_block === '' ) ? $this->options['block'] : '' ;
|
1120 |
-
|
1121 |
-
$widget_block = ( isset( $this->options['widget_block'] ) && $all_block === '' ) ? $this->options['widget_block'] : '' ;
|
1122 |
-
|
1123 |
-
?>
|
1124 |
-
|
1125 |
-
<input type='checkbox' name='italy_cookie_choices[block]' <?php checked( $block, 1 ); ?> value='1'>
|
1126 |
-
<label for="italy_cookie_choices[block]">
|
1127 |
-
<?php _e( 'Cookie from any embed in your content (Beta) (DEPRECATED)', 'italy-cookie-choices' ); ?>
|
1128 |
-
</label>
|
1129 |
-
<br>
|
1130 |
-
<input type='checkbox' name='italy_cookie_choices[widget_block]' <?php checked( $widget_block, 1 ); ?> value='1'>
|
1131 |
-
<label for="italy_cookie_choices[widget_block]">
|
1132 |
-
<?php _e( 'Cookie from any embed in your widget area (Beta) (DEPRECATED)', 'italy-cookie-choices' ); ?>
|
1133 |
-
</label>
|
1134 |
-
<br>
|
1135 |
-
<input type='checkbox' name='italy_cookie_choices[all_block]' <?php checked( $all_block, 1 ); ?> value='1'>
|
1136 |
-
<label for="italy_cookie_choices[all_block]">
|
1137 |
-
<?php _e( 'Cookie from any embed in all body, except head and footer (Beta)', 'italy-cookie-choices' ); ?>
|
1138 |
-
</label>
|
1139 |
-
|
1140 |
-
<?php
|
1141 |
-
|
1142 |
-
}
|
1143 |
-
|
1144 |
-
/**
|
1145 |
-
* Textarea for content_message_text
|
1146 |
-
* @return string
|
1147 |
-
*/
|
1148 |
-
public function italy_cl_option_custom_script_block($args) {
|
1149 |
-
|
1150 |
-
$custom_script_block = ( isset( $this->options['custom_script_block'] ) ) ? $this->options['custom_script_block'] : '' ;
|
1151 |
-
|
1152 |
-
?>
|
1153 |
-
<textarea rows="5" cols="70" name="italy_cookie_choices[custom_script_block]" id="italy_cookie_choices[custom_script_block]" placeholder="<?php _e( '<script src="http://domain.com/widget-example.js"></script>'."\n".'<---------SEP--------->'."\n".'<script src="http://otherdomain.com/script-example.js"></script>'."\n".'<---------SEP--------->'."\n".'<script src="http://lastdomain.com/gadget-example.js"></script>', 'italy-cookie-choices' ) ?>" ><?php echo esc_textarea( $custom_script_block ); ?></textarea>
|
1154 |
-
<br>
|
1155 |
-
<label for="italy_cookie_choices[custom_script_block]">
|
1156 |
-
<?php echo __( 'Scripts shown in the head and in the footer does not automatically blocked.<br />Split each script with <strong><em><---------SEP---------></em></strong>', 'italy-cookie-choices' ); ?>
|
1157 |
-
</label>
|
1158 |
-
|
1159 |
-
<?php
|
1160 |
-
|
1161 |
-
}
|
1162 |
-
|
1163 |
-
/**
|
1164 |
-
* Function for custom script block
|
1165 |
-
* @return string
|
1166 |
-
*/
|
1167 |
-
public function italy_cl_option_content_message_text($args) {
|
1168 |
-
|
1169 |
-
$content_message_text = ( isset( $this->options['content_message_text'] ) ) ? $this->options['content_message_text'] : '' ;
|
1170 |
-
|
1171 |
-
?>
|
1172 |
-
<textarea rows="5" cols="70" name="italy_cookie_choices[content_message_text]" id="italy_cookie_choices[content_message_text]" placeholder="<?php _e( 'Your lock message for embedded contents inside posts, pages and widgets', 'italy-cookie-choices' ) ?>" ><?php echo esc_textarea( $content_message_text ); ?></textarea>
|
1173 |
-
<br>
|
1174 |
-
<label for="italy_cookie_choices[content_message_text]">
|
1175 |
-
<?php echo __( 'People will see this notice only the first time that they enter your site', 'italy-cookie-choices' ); ?>
|
1176 |
-
</label>
|
1177 |
-
|
1178 |
-
<?php
|
1179 |
|
1180 |
}
|
1181 |
|
1182 |
/**
|
1183 |
-
*
|
1184 |
-
*
|
|
|
1185 |
*/
|
1186 |
-
|
1187 |
-
|
1188 |
-
$content_message_button_text = ( isset( $this->options['content_message_button_text'] ) ) ? $this->options['content_message_button_text'] : '' ;
|
1189 |
-
|
1190 |
-
?>
|
1191 |
-
<input type="text" id="italy_cookie_choices[content_message_button_text]" name="italy_cookie_choices[content_message_button_text]" value="<?php echo esc_attr( $content_message_button_text ); ?>" placeholder="<?php _e( 'e.g. Close', 'italy-cookie-choices' ) ?>" />
|
1192 |
-
|
1193 |
-
<label for="italy_cookie_choices[content_message_button_text]">
|
1194 |
-
<?php echo __( 'Insert here name of button (e.g. "Close") ', 'italy-cookie-choices' ); ?>
|
1195 |
-
</label>
|
1196 |
-
|
1197 |
-
<?php
|
1198 |
|
|
|
|
|
|
|
|
|
1199 |
}
|
1200 |
|
1201 |
/**
|
1202 |
-
*
|
1203 |
-
*
|
1204 |
-
* @return
|
1205 |
*/
|
1206 |
-
|
1207 |
-
|
1208 |
-
$new_input = array();
|
1209 |
-
|
1210 |
-
if( isset( $input['active'] ) )
|
1211 |
-
$new_input['active'] = $input['active'];
|
1212 |
-
|
1213 |
-
if( isset( $input['banner'] ) )
|
1214 |
-
$new_input['banner'] = $input['banner'];
|
1215 |
-
|
1216 |
-
if( isset( $input['scroll'] ) )
|
1217 |
-
$new_input['scroll'] = $input['scroll'];
|
1218 |
-
|
1219 |
-
if( isset( $input['secondView'] ) )
|
1220 |
-
$new_input['secondView'] = $input['secondView'];
|
1221 |
-
|
1222 |
-
if( isset( $input['reload'] ) )
|
1223 |
-
$new_input['reload'] = $input['reload'];
|
1224 |
-
|
1225 |
-
if( isset( $input['text'] ) )
|
1226 |
-
$new_input['text'] = sanitize_text_field( $input['text'] );
|
1227 |
-
|
1228 |
-
if( isset( $input['url'] ) )
|
1229 |
-
$new_input['url'] = sanitize_text_field( $input['url'] );
|
1230 |
-
|
1231 |
-
if( isset( $input['anchor_text'] ) )
|
1232 |
-
$new_input['anchor_text'] = sanitize_text_field( $input['anchor_text'] );
|
1233 |
-
|
1234 |
-
if( isset( $input['button_text'] ) )
|
1235 |
-
$new_input['button_text'] = sanitize_text_field( $input['button_text'] );
|
1236 |
-
|
1237 |
-
/**
|
1238 |
-
* Sezione per lo stile
|
1239 |
-
*/
|
1240 |
-
if( isset( $input['html_margin'] ) )
|
1241 |
-
$new_input['html_margin'] = $input['html_margin'];
|
1242 |
-
|
1243 |
-
if( isset( $input['js_template'] ) )
|
1244 |
-
$new_input['js_template'] = $input['js_template'];
|
1245 |
-
|
1246 |
-
if( empty( $input['banner_bg'] ) )
|
1247 |
-
$new_input['banner_bg'] = '#fff';
|
1248 |
-
elseif ( isset( $input['banner_bg'] ) )
|
1249 |
-
$new_input['banner_bg'] = sanitize_text_field( $input['banner_bg'] );
|
1250 |
-
|
1251 |
-
if( empty( $input['banner_text_color'] ) )
|
1252 |
-
$new_input['banner_text_color'] = '#000';
|
1253 |
-
elseif ( isset( $input['banner_text_color'] ) )
|
1254 |
-
$new_input['banner_text_color'] = sanitize_text_field( $input['banner_text_color'] );
|
1255 |
-
|
1256 |
-
/**
|
1257 |
-
* Sezione per le opzioni avanzate
|
1258 |
-
* Esempio per add_settings_error()
|
1259 |
-
* @link https://wordpress.org/support/topic/how-to-use-add_settings_error-for-nested-options-array?replies=2
|
1260 |
-
* @link http://pastebin.com/K4kJ0DNG
|
1261 |
-
*/
|
1262 |
-
if( empty( $input['cookie_name'] ) ){
|
1263 |
-
add_settings_error( 'italy_cookie_id', 'cookie_name_ID', __('Cookie name field it can\'t be empty. Restored default name.', 'italy-cookie-choices' ), 'error');
|
1264 |
-
$new_input['cookie_name'] = $this->cookieName;
|
1265 |
-
}
|
1266 |
-
else
|
1267 |
-
$new_input['cookie_name'] = sanitize_text_field( $input['cookie_name'] );
|
1268 |
|
1269 |
-
if(
|
1270 |
-
|
1271 |
-
$new_input['cookie_value'] = $this->cookieVal;
|
1272 |
-
}
|
1273 |
else
|
1274 |
-
|
1275 |
-
|
1276 |
-
if( isset( $input['slug'] ) )
|
1277 |
-
$new_input['slug'] = sanitize_text_field( $input['slug'] );
|
1278 |
-
|
1279 |
-
if( isset( $input['target'] ) )
|
1280 |
-
$new_input['target'] = $input['target'];
|
1281 |
-
|
1282 |
-
if( isset( $input['block'] ) )
|
1283 |
-
$new_input['block'] = $input['block'];
|
1284 |
-
|
1285 |
-
if( isset( $input['widget_block'] ) )
|
1286 |
-
$new_input['widget_block'] = $input['widget_block'];
|
1287 |
-
|
1288 |
-
if( isset( $input['all_block'] ) )
|
1289 |
-
$new_input['all_block'] = $input['all_block'];
|
1290 |
-
|
1291 |
-
if( isset( $input['custom_script_block'] ) )
|
1292 |
-
$new_input['custom_script_block'] = $input['custom_script_block'];
|
1293 |
-
|
1294 |
-
if( isset( $input['content_message_text'] ) )
|
1295 |
-
$new_input['content_message_text'] = sanitize_text_field( $input['content_message_text'] );
|
1296 |
-
|
1297 |
-
if( isset( $input['content_message_button_text'] ) )
|
1298 |
-
$new_input['content_message_button_text'] = sanitize_text_field( $input['content_message_button_text'] );
|
1299 |
-
|
1300 |
-
return $new_input;
|
1301 |
|
1302 |
}
|
1303 |
|
1304 |
/**
|
1305 |
-
*
|
1306 |
-
*
|
1307 |
-
* @return
|
1308 |
-
* @link https://make.wordpress.org/core/2012/11/30/new-color-picker-in-wp-3-5/
|
1309 |
-
* @link http://code.tutsplus.com/articles/how-to-use-wordpress-color-picker-api--wp-33067
|
1310 |
*/
|
1311 |
-
|
1312 |
-
|
1313 |
-
// first check that $hook_suffix is appropriate for your admin page
|
1314 |
-
wp_enqueue_style( 'wp-color-picker' );
|
1315 |
-
|
1316 |
-
// wp_enqueue_script( 'jquery' );
|
1317 |
-
|
1318 |
-
wp_enqueue_script(
|
1319 |
-
'italy-cookie-choices-script',
|
1320 |
-
plugins_url('admin/js/src/script.js', ITALY_COOKIE_CHOICES_FILE ),
|
1321 |
-
array(
|
1322 |
-
// 'jquery',
|
1323 |
-
'wp-color-picker'
|
1324 |
-
),
|
1325 |
-
null,
|
1326 |
-
true
|
1327 |
-
);
|
1328 |
|
|
|
|
|
|
|
|
|
1329 |
}
|
1330 |
|
1331 |
/**
|
1332 |
-
*
|
1333 |
-
*
|
1334 |
-
* @
|
1335 |
-
* @return array Array with embed found
|
1336 |
*/
|
1337 |
-
|
1338 |
-
|
1339 |
-
preg_match_all( $this->pattern, $content, $matches );
|
1340 |
|
1341 |
-
|
1342 |
-
|
1343 |
-
* @var [type]
|
1344 |
-
*/
|
1345 |
-
if ( !empty( $matches[0] ) )
|
1346 |
-
$this->js_array = array_merge( $this->js_array, $matches[0] );
|
1347 |
|
|
|
|
|
1348 |
}
|
1349 |
|
1350 |
-
|
1351 |
-
* Erase third part embed
|
1352 |
-
* @param string $content Article content
|
1353 |
-
*/
|
1354 |
-
public function AutoErase( $content ) {
|
1355 |
-
|
1356 |
-
$this->matches( $this->pattern, $content );
|
1357 |
-
|
1358 |
-
$content = preg_replace( $this->pattern, $this->valore , $content);
|
1359 |
|
1360 |
-
|
1361 |
-
return $content;
|
1362 |
}
|
1363 |
|
1364 |
-
|
1365 |
-
if(is_array($v) or is_object($v)){
|
1366 |
-
foreach($v as $k1=>$v1){
|
1367 |
-
$v[$k1] = $this->fnFixArray($v1);
|
1368 |
-
}
|
1369 |
-
return $v;
|
1370 |
-
}
|
1371 |
-
|
1372 |
-
if(!is_string($v) or empty($v)) return $v;
|
1373 |
|
1374 |
-
$this->
|
1375 |
-
|
1376 |
-
return preg_replace( $this->pattern, $this->valore , $v);
|
1377 |
}
|
1378 |
|
1379 |
/**
|
1380 |
-
*
|
1381 |
-
*
|
1382 |
-
* @param
|
1383 |
-
* @param
|
|
|
|
|
|
|
1384 |
*/
|
1385 |
-
|
1386 |
-
return $this->fnFixArray($instance);
|
1387 |
-
}
|
1388 |
-
|
1389 |
-
/**
|
1390 |
-
* Print script inline before </body>
|
1391 |
-
* @return string Print script inline
|
1392 |
-
* @link https://www.cookiechoices.org/
|
1393 |
-
*/
|
1394 |
-
public function print_script_inline(){
|
1395 |
-
|
1396 |
-
// $this->options = get_option( 'italy_cookie_choices' );
|
1397 |
-
|
1398 |
-
/**
|
1399 |
-
* If is not active exit
|
1400 |
-
*/
|
1401 |
-
if ( !isset( $this->options['active'] ) )
|
1402 |
-
return;
|
1403 |
-
|
1404 |
-
/**
|
1405 |
-
* Select what kind of banner to display
|
1406 |
-
*/
|
1407 |
-
if ( $this->options['banner'] === '1' || !empty( $this->options['slug'] ) && ( is_page( $this->options['slug'] ) || is_single( $this->options['slug'] ) ) ){
|
1408 |
-
|
1409 |
-
$banner = 'Bar';
|
1410 |
-
$bPos = 'top:0';
|
1411 |
-
|
1412 |
-
} elseif ( $this->options['banner'] === '2' ) {
|
1413 |
-
|
1414 |
-
$banner = 'Dialog';
|
1415 |
-
$bPos = 'top:0';
|
1416 |
-
|
1417 |
-
} elseif ( $this->options['banner'] === '3' ) {
|
1418 |
-
|
1419 |
-
$banner = 'Bar';
|
1420 |
-
$bPos = 'bottom:0';
|
1421 |
-
|
1422 |
-
} else {
|
1423 |
-
|
1424 |
-
$banner = '';
|
1425 |
-
$bPos = 'top:0';
|
1426 |
-
|
1427 |
-
}
|
1428 |
-
|
1429 |
-
/**
|
1430 |
-
* Accept on scroll
|
1431 |
-
* @var bol
|
1432 |
-
*/
|
1433 |
-
$scroll = ( isset( $this->options['scroll'] ) ) ? $this->options['scroll'] : '' ;
|
1434 |
-
|
1435 |
-
/**
|
1436 |
-
* Reload on accept
|
1437 |
-
* @var bol
|
1438 |
-
*/
|
1439 |
-
$reload = ( isset( $this->options['reload'] ) ) ? $this->options['reload'] : '' ;
|
1440 |
-
|
1441 |
-
/**
|
1442 |
-
* Snippet for display banner
|
1443 |
-
* @uses json_encode Funzione usate per il testo del messaggio.
|
1444 |
-
* Ricordarsi che aggiunge già
|
1445 |
-
* le doppie virgolette "" alla stringa
|
1446 |
-
* @var string
|
1447 |
-
*/
|
1448 |
-
$banner = 'document.addEventListener("DOMContentLoaded", function(event) {cookieChoices.showCookieConsent' . $banner . '(' . wp_json_encode( $this->options['text'] ) . ', "' . esc_js( $this->options['button_text'] ) . '", "' . esc_js( $this->options['anchor_text'] ) . '", "' . esc_url( $this->options['url'] ) . '");});';
|
1449 |
-
|
1450 |
-
/**
|
1451 |
-
* ADVANCED OPTIONS
|
1452 |
-
*/
|
1453 |
-
/**
|
1454 |
-
* Cookie name
|
1455 |
-
* @var string
|
1456 |
-
*/
|
1457 |
-
$cookie_name = ( isset( $this->options['cookie_name'] ) ) ? $this->options['cookie_name'] : $this->cookieName ;
|
1458 |
-
|
1459 |
-
/**
|
1460 |
-
* Cookie value
|
1461 |
-
* @var string/bolean
|
1462 |
-
*/
|
1463 |
-
$cookie_value = ( isset( $this->options['cookie_value'] ) ) ? $this->options['cookie_value'] : $this->cookieVal ;
|
1464 |
|
1465 |
-
|
1466 |
-
* Se l'optione è selezionata aggiunge un margine per non nascondere il contenuto dalla top bar
|
1467 |
-
* @var string
|
1468 |
-
*/
|
1469 |
-
$style = '<style>.icc{margin-top:36px}</style>';
|
1470 |
-
|
1471 |
-
/**
|
1472 |
-
* Js_Template vlue
|
1473 |
-
* @var string
|
1474 |
-
*/
|
1475 |
-
$js_template = ( isset( $this->options['js_template'] ) ) ? $this->options['js_template'] : $this->js_template ;
|
1476 |
-
|
1477 |
-
/**
|
1478 |
-
* If is set html_margin checkbox in admin panel then add margin-top to HTML tag
|
1479 |
-
* @var bol
|
1480 |
-
*/
|
1481 |
-
$htmlM = ( isset( $this->options['html_margin'] ) ) ? $this->options['html_margin'] : '' ;
|
1482 |
-
|
1483 |
-
/**
|
1484 |
-
* If set open policy page in new browser tab
|
1485 |
-
* @var bol
|
1486 |
-
*/
|
1487 |
-
$target = ( isset( $this->options['target'] ) ) ? $this->options['target'] : '' ;
|
1488 |
-
|
1489 |
-
/**
|
1490 |
-
* Colore dello sfondo della dialog/topbar
|
1491 |
-
* @var string
|
1492 |
-
*/
|
1493 |
-
$banner_bg = ( isset( $this->options['banner_bg'] ) ) ? esc_attr( $this->options['banner_bg'] ) : '' ;
|
1494 |
-
|
1495 |
-
/**
|
1496 |
-
* Colore del font della dialog/topbar
|
1497 |
-
* @var string
|
1498 |
-
*/
|
1499 |
-
$banner_text_color = ( isset( $this->options['banner_text_color'] ) ) ? esc_attr( $this->options['banner_text_color'] ) : '' ;
|
1500 |
-
|
1501 |
-
/**
|
1502 |
-
* Declarations of JS variables and set parameters
|
1503 |
-
* var elPos = Gestisce la Posizione banner nella funzione _createHeaderElement
|
1504 |
-
* var infoClass = aggiunge una classe personalizzata per il link info
|
1505 |
-
* var closeClass = aggiunge una classe personalizzata per il link di accettazione
|
1506 |
-
* var htmlM = Aggiunge un margine a HTML per la top bar
|
1507 |
-
* var coNA = cookie name
|
1508 |
-
* var coVA = cookie val
|
1509 |
-
* var rel = Setto il reload per la pagina all'accettazione
|
1510 |
-
* var tar = Target -blank
|
1511 |
-
* var bgB = Colore del background della topbar/dialog
|
1512 |
-
* var btcB = Colore del font della topbar/dialog
|
1513 |
-
* @var string
|
1514 |
-
*/
|
1515 |
-
$jsVariables = 'var coNA="' . $cookie_name . '",coVA="' . $cookie_value . '";scroll="' . $scroll . '",elPos="fixed",infoClass="",closeClass="",htmlM="' . $htmlM . '",rel="' . $reload . '",tar="' . $target . '",bgB="' . $banner_bg . '",btcB="' . $banner_text_color . '",bPos="' . $bPos . '",jsArr = ' . wp_json_encode( $this->js_array ) . ';';
|
1516 |
|
1517 |
-
|
1518 |
-
|
1519 |
-
* @var string
|
1520 |
-
*/
|
1521 |
-
$noscript = '<noscript><style>html{margin-top:35px}</style><div id="cookieChoiceInfo" style="position:absolute;width:100%;margin:0px;left:0px;top:0px;padding:4px;z-index:9999;text-align:center;background-color:rgb(238, 238, 238);"><span>' . wp_json_encode( $this->options['text'] ) . '</span><a href="' . esc_url( $this->options['url'] ) . '" target="_blank" style="margin-left:8px;">' . esc_js( $this->options['anchor_text'] ) . '</a><a id="cookieChoiceDismiss" href="#" style="margin-left:24px;display:none;">' . esc_js( $this->options['button_text'] ) . '</a></div></div></noscript>';
|
1522 |
|
1523 |
-
|
1524 |
-
|
1525 |
-
* @var string
|
1526 |
-
*/
|
1527 |
-
$fileJS = ( WP_DEBUG ) ? '/js/'.$js_template.'/cookiechoices.js' : '/js/'.$js_template.'/cookiechoices.php' ;
|
1528 |
-
|
1529 |
-
$output_html = '<!-- Italy Cookie Choices -->' . $style . '<script>' . $jsVariables . file_get_contents( ITALY_COOKIE_CHOICES_DIRNAME . $fileJS ) . $banner . '</script>' . $noscript;
|
1530 |
-
|
1531 |
-
echo $output_html;
|
1532 |
|
|
|
1533 |
}
|
1534 |
|
1535 |
-
/**
|
1536 |
-
* Shortcode per stampare il bottone nella pagina della policy
|
1537 |
-
* @param array $atts Array con gli attributi dello shortcode
|
1538 |
-
* @param string $content content of shortcode
|
1539 |
-
* @return string Button per l'accettazione
|
1540 |
-
*/
|
1541 |
-
public function accept_button( $atts, $content = null ) {
|
1542 |
|
1543 |
-
$button_text = ( isset( $this->options['button_text'] ) ) ? $this->options['button_text'] : '' ;
|
1544 |
|
1545 |
-
return '<span class="el"><button onclick="cookieChoices.removeCookieConsent()">' . esc_attr( $button_text ) . '</button></span>';
|
1546 |
|
1547 |
-
}
|
1548 |
|
1549 |
-
}//
|
1550 |
-
}//endif
|
1551 |
|
1552 |
-
new Italy_Cookie_Choices;
|
|
2 |
/**
|
3 |
* Plugin Name: Italy Cookie Choices
|
4 |
* Plugin URI: https://plus.google.com/u/0/communities/109254048492234113886
|
5 |
+
* Description: Italy Cookie Choices allows you to easily comply with the european cookie law and block third part cookie in your page.
|
6 |
+
* Version: 2.2.0
|
7 |
+
* Author: Enea Overclokk, Andrea Pernici, Andrea Cardinale
|
8 |
+
* Author URI: https://github.com/ItalyCookieChoices/italy-cookie-choices
|
9 |
* Text Domain: italy-cookie-choices
|
10 |
* License: GPLv2 or later
|
11 |
*
|
49 |
* Example = F:\xampp\htdocs\italystrap\wp-content\plugins\italystrap-extended/
|
50 |
*/
|
51 |
if ( !defined( 'ITALY_COOKIE_CHOICES_PLUGIN_PATH' ) )
|
52 |
+
define('ITALY_COOKIE_CHOICES_PLUGIN_PATH', plugin_dir_path( ITALY_COOKIE_CHOICES_FILE ) );
|
53 |
/**
|
54 |
* Example = italystrap-extended/italystrap.php
|
55 |
*/
|
56 |
if ( !defined( 'ITALY_COOKIE_CHOICES_BASENAME' ) )
|
57 |
+
define('ITALY_COOKIE_CHOICES_BASENAME', plugin_basename( ITALY_COOKIE_CHOICES_FILE ) );
|
58 |
|
59 |
/**
|
60 |
* Example = F:\xampp\htdocs\italystrap\wp-content\plugins\italy-cookie-choices
|
61 |
*/
|
62 |
if ( !defined( 'ITALY_COOKIE_CHOICES_DIRNAME' ) )
|
63 |
+
define('ITALY_COOKIE_CHOICES_DIRNAME', dirname( ITALY_COOKIE_CHOICES_FILE ) );
|
|
|
64 |
|
65 |
/**
|
66 |
+
* Require PHP files
|
67 |
*/
|
68 |
+
require(ITALY_COOKIE_CHOICES_PLUGIN_PATH . 'admin/class-italy-cookie-choices-admin.php');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
+
require(ITALY_COOKIE_CHOICES_PLUGIN_PATH . 'classes/class-italy-cookie-choices-front-end.php');
|
71 |
+
/**
|
72 |
+
* Requier multilingual functions
|
73 |
+
*/
|
74 |
+
require(ITALY_COOKIE_CHOICES_PLUGIN_PATH . 'includes/functions-italy-cookie-choices-lang.php');
|
75 |
|
76 |
+
/**
|
77 |
+
* Initialize plugin
|
78 |
+
* Functions for check version come from sz-google
|
79 |
+
*/
|
|
|
80 |
|
81 |
+
if ( ! class_exists( 'Italy_Cookie_Choices' ) ) {
|
|
|
|
|
|
|
|
|
82 |
|
83 |
+
class Italy_Cookie_Choices{
|
|
|
|
|
|
|
|
|
84 |
|
85 |
/**
|
86 |
+
* Minimum requirement PHP
|
87 |
* @var string
|
88 |
*/
|
89 |
+
private $PHP_ver = '5.3';
|
90 |
|
91 |
/**
|
92 |
+
* Minimum requirement WordPress
|
93 |
* @var string
|
94 |
*/
|
95 |
+
private $WP_ver = '3.5';
|
96 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
/**
|
98 |
+
* Make some magics
|
99 |
*/
|
100 |
public function __construct(){
|
101 |
|
102 |
/**
|
103 |
+
* Check if is compatible and then instantiate it
|
104 |
*/
|
105 |
+
if ( $this->is_compatible_version() && is_admin() )
|
106 |
+
new Italy_Cookie_Choices_Admin;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
|
108 |
+
else if ( $this->is_compatible_version() && !is_admin() )
|
109 |
+
new Italy_Cookie_Choices_Front_End;
|
110 |
|
111 |
+
else
|
112 |
+
add_action( 'admin_notices', array( $this, 'load_plugin_admin_notices' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
|
114 |
/**
|
115 |
+
* Check compatibility on install
|
116 |
*/
|
117 |
+
register_activation_hook(__FILE__,array($this,'check_compatibility_on_install'));
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
/**
|
120 |
+
* adjust priority to make sure this runs
|
121 |
*/
|
122 |
+
add_action( 'init', array( $this, 'init'), 100 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
}
|
126 |
|
127 |
/**
|
128 |
+
* Check if plugin is compatible, if it is not then it wont activate
|
129 |
+
* @return string Return error message in case plugin is not compatible
|
130 |
*/
|
131 |
+
function check_compatibility_on_install(){
|
132 |
|
133 |
+
if ( !$this->is_compatible_version() ) {
|
134 |
|
135 |
+
$HTML = '<div>' . __( 'Activation of Italy Cookie Choices in not possible', 'italy-cookie-choices' ) . ':</div><ul>';
|
|
|
|
|
|
|
|
|
136 |
|
137 |
+
if ( !$this->is_compatible_PHP() )
|
138 |
+
$HTML .= '<li>' . $this->get_admin_notices_PHP( false ) . '</li>';
|
139 |
|
140 |
+
if ( !$this->is_compatible_WORDPRESS() )
|
141 |
+
$HTML .= '<li>' . $this->get_admin_notices_WORDPRESS( false ) . '</li>';
|
142 |
|
143 |
+
$HTML .= '</ul>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
|
145 |
+
wp_die( $HTML, __( 'Activation of Italy Cookie Choices in not possible', 'italy-cookie-choices' ), array( 'back_link' => true ) );
|
146 |
+
};
|
147 |
}
|
148 |
|
149 |
/**
|
150 |
+
* Init functions
|
|
|
151 |
*/
|
152 |
+
public function init() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
+
/**
|
155 |
+
* Load Lang file
|
156 |
+
*/
|
157 |
+
load_plugin_textdomain( 'italy-cookie-choices', false, dirname( ITALY_COOKIE_CHOICES_BASENAME ) . '/lang' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
|
159 |
}
|
160 |
|
161 |
/**
|
162 |
+
* Checking compatibility with installed versions of the plugin
|
163 |
+
* In case of incompatibility still fully loaded plugin (return)
|
164 |
+
* @return boolean Check if plugin is compatible
|
165 |
*/
|
166 |
+
function is_compatible_version() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
|
168 |
+
if ( $this->is_compatible_PHP() && $this->is_compatible_WORDPRESS() )
|
169 |
+
return true;
|
170 |
+
else
|
171 |
+
return false;
|
172 |
}
|
173 |
|
174 |
/**
|
175 |
+
* Checking the compatibility of the plugin with the version of PHP
|
176 |
+
* In case of incompatibility still fully loaded plugin (return)
|
177 |
+
* @return boolean Check PHP compatibility
|
178 |
*/
|
179 |
+
function is_compatible_PHP() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
+
if ( version_compare( phpversion(), $this->PHP_ver, '<') )
|
182 |
+
return false;
|
|
|
|
|
183 |
else
|
184 |
+
return true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
|
186 |
}
|
187 |
|
188 |
/**
|
189 |
+
* Checking the compatibility of the plugin with the version of Wordpress
|
190 |
+
* In case of incompatibility still fully loaded plugin (return)
|
191 |
+
* @return boolean Check WordPress compatibility
|
|
|
|
|
192 |
*/
|
193 |
+
function is_compatible_WORDPRESS() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
|
195 |
+
if ( version_compare( $GLOBALS['wp_version'], $this->WP_ver, '<') )
|
196 |
+
return false;
|
197 |
+
else
|
198 |
+
return true;
|
199 |
}
|
200 |
|
201 |
/**
|
202 |
+
* If the plugin is active, but the minimum requirements are not met
|
203 |
+
* the function is called to add the details on the notice board error
|
204 |
+
* @return string Print error message
|
|
|
205 |
*/
|
206 |
+
function load_plugin_admin_notices() {
|
|
|
|
|
207 |
|
208 |
+
if ( !$this->is_compatible_PHP() )
|
209 |
+
echo $this->get_admin_notices_PHP( true );
|
|
|
|
|
|
|
|
|
210 |
|
211 |
+
if ( !$this->is_compatible_WORDPRESS() )
|
212 |
+
echo $this->get_admin_notices_WORDPRESS( true );
|
213 |
}
|
214 |
|
215 |
+
function get_admin_notices_PHP( $wrap ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
|
217 |
+
return $this->get_admin_notices_TEXT( $wrap, 'PHP', phpversion(), $this->PHP_ver );
|
|
|
218 |
}
|
219 |
|
220 |
+
function get_admin_notices_WORDPRESS( $wrap ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
|
222 |
+
return $this->get_admin_notices_TEXT( $wrap, 'WordPress', $GLOBALS['wp_version'], $this->WP_ver);
|
|
|
|
|
223 |
}
|
224 |
|
225 |
/**
|
226 |
+
* A function that creates a generic error to be displayed during
|
227 |
+
* the activation function or on the bulletin board of directors.
|
228 |
+
* @param bolean $wrap [description]
|
229 |
+
* @param string $s1 PHP or WordPress
|
230 |
+
* @param string $s2 Current version
|
231 |
+
* @param string $s3 Required version
|
232 |
+
* @return string Display errors
|
233 |
*/
|
234 |
+
function get_admin_notices_TEXT( $wrap, $s1, $s2, $s3 ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
|
236 |
+
$HTML = __( 'Your server is running %s version %s but this plugin requires at least %s', 'italy-cookie-choices' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
|
238 |
+
if ( $wrap === false )
|
239 |
+
$HTML = '<div>' . $HTML . '</div>';
|
|
|
|
|
|
|
240 |
|
241 |
+
else
|
242 |
+
$HTML = '<div class="error"><p><b>Italy Cookie Choices</b> - ' . $HTML . '</p></div>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
|
244 |
+
return sprintf( $HTML, $s1, $s2, $s3 );
|
245 |
}
|
246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
|
|
248 |
|
|
|
249 |
|
|
|
250 |
|
251 |
+
} // End Italy_Cookie_Choices
|
|
|
252 |
|
253 |
+
new Italy_Cookie_Choices;
|
254 |
+
}
|
js/bigbutton/cookiechoices.js
CHANGED
@@ -53,7 +53,7 @@ function allowCookie() {
|
|
53 |
|
54 |
var str = x[i].innerHTML;
|
55 |
// var res = str.replace(/<!--(.*?)-->/g, "$1");
|
56 |
-
// Prendo l\'array creato e all\'accettazione ogni valore
|
57 |
res = str.replace(/<cookie>/g, jsArr[i]);
|
58 |
x[i].innerHTML = res;
|
59 |
}
|
@@ -108,25 +108,33 @@ function appendJS(script){
|
|
108 |
var cookieName = coNA;
|
109 |
var cookieConsentId = 'cookieChoiceInfo';
|
110 |
var dismissLinkId = 'cookieChoiceDismiss';
|
|
|
111 |
|
112 |
-
function
|
|
|
|
|
113 |
|
114 |
-
|
|
|
|
|
115 |
|
116 |
-
|
117 |
-
|
|
|
118 |
|
119 |
-
|
120 |
var contenitore = document.createElement('div');
|
121 |
-
var contenutoContenitoreStyle = 'max-width:980px;margin-right:auto;margin-left:auto;padding:15px;';
|
122 |
contenitore.id = cookieConsentId;
|
123 |
-
contenitore.
|
|
|
124 |
|
125 |
var cookieConsentElement = document.createElement('div');
|
126 |
//cookieConsentElement.id = cookieConsentId;
|
127 |
-
cookieConsentElement.
|
|
|
128 |
cookieConsentElement.appendChild(_createConsentText(cookieText));
|
129 |
-
|
130 |
|
131 |
if (!!linkText && !!linkHref) {
|
132 |
cookieConsentElement.appendChild(_createInformationLink(linkText, linkHref));
|
@@ -141,32 +149,32 @@ function appendJS(script){
|
|
141 |
}
|
142 |
|
143 |
function _createDialogElement(cookieText, dismissText, linkText, linkHref) {
|
144 |
-
var glassStyle = 'position:fixed;width:100%;height:100%;z-index:999;' +
|
145 |
-
'top:0;left:0;opacity:0.5;filter:alpha(opacity=50);' +
|
146 |
-
'background-color:#ccc;';
|
147 |
-
var dialogStyle = 'z-index:9999;position:fixed;
|
148 |
-
var contentStyle = 'position:relative;
|
149 |
-
'background-color:' + bgB + ';padding:20px;box-shadow:4px 4px 25px #888;';
|
150 |
|
151 |
var cookieConsentElement = document.createElement('div');
|
152 |
cookieConsentElement.id = cookieConsentId;
|
153 |
|
154 |
var glassPanel = document.createElement('div');
|
155 |
-
glassPanel.style.cssText = glassStyle;
|
|
|
156 |
|
157 |
var content = document.createElement('div');
|
158 |
-
content.style.cssText = contentStyle;
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
var dialog = document.createElement('div');
|
164 |
-
dialog.style.cssText = dialogStyle;
|
|
|
165 |
|
166 |
var dismissLink = _createDismissLink(dismissText);
|
167 |
-
//dismissLink.style.display = 'block';
|
168 |
-
//dismissLink.style.textAlign = 'right';
|
169 |
-
//dismissLink.style.marginTop = '8px';
|
170 |
|
171 |
content.appendChild(_createConsentText(cookieText));
|
172 |
|
@@ -192,9 +200,9 @@ function appendJS(script){
|
|
192 |
|
193 |
function _createSpace(){
|
194 |
var hrStyle='clear:both;border-color:transparent;margin-top:5px;margin-bottom:5px';
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
}
|
199 |
|
200 |
function _createConsentText(cookieText) {
|
@@ -204,7 +212,7 @@ function appendJS(script){
|
|
204 |
}
|
205 |
|
206 |
function _createDismissLink(dismissText) {
|
207 |
-
var buttonStyle='color: '+ btcB +';padding: 7px 12px;font-size: 18px;line-height: 18px;text-decoration: none;text-transform: uppercase;margin:0;margin-bottom:2px;letter-spacing: 0.125em;display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid '+ btcB +';background: rgba(255, 255, 255, 0.03);';
|
208 |
|
209 |
var dismissLink = document.createElement('a');
|
210 |
_setElementText(dismissLink, dismissText);
|
@@ -212,26 +220,27 @@ function appendJS(script){
|
|
212 |
dismissLink.className = closeClass;
|
213 |
dismissLink.href = '#';
|
214 |
//dismissLink.style.marginLeft = '24px';
|
215 |
-
dismissLink.style.cssText = buttonStyle;
|
216 |
return dismissLink;
|
217 |
}
|
218 |
|
219 |
function _createInformationLink(linkText, linkHref) {
|
220 |
-
var buttonStyle='color: '+ btcB +';padding: 7px 12px;font-size: 18px;line-height: 18px;text-decoration: none;text-transform: uppercase;margin-right: 20px;margin-bottom:2px;letter-spacing: 0.125em;' +
|
221 |
-
'display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid '+ btcB +';background: rgba(255, 255, 255, 0.03);';
|
222 |
|
223 |
var infoLink = document.createElement('a');
|
224 |
_setElementText(infoLink, linkText);
|
225 |
infoLink.className = infoClass;
|
226 |
infoLink.href = linkHref;
|
|
|
227 |
if (tar) infoLink.target = '_blank';
|
228 |
-
infoLink.style.cssText = buttonStyle;
|
229 |
return infoLink;
|
230 |
}
|
231 |
|
232 |
function _dismissLinkClick() {
|
233 |
if (_shouldDisplayConsent()) {
|
234 |
-
if ( htmlM )
|
235 |
allowCookie();
|
236 |
_saveUserPreference();
|
237 |
_removeCookieConsent();
|
@@ -249,6 +258,7 @@ function appendJS(script){
|
|
249 |
var fragment = document.createDocumentFragment();
|
250 |
fragment.appendChild(consentElement);
|
251 |
document.body.appendChild(fragment.cloneNode(true));
|
|
|
252 |
document.getElementById(dismissLinkId).onclick = _dismissLinkClick;
|
253 |
// document.onclick = _dismissLinkClick;
|
254 |
if (scroll) document.onscroll = _dismissLinkClick;
|
53 |
|
54 |
var str = x[i].innerHTML;
|
55 |
// var res = str.replace(/<!--(.*?)-->/g, "$1");
|
56 |
+
// Prendo l\'array creato e all\'accettazione ogni valore e' messo al suo posto
|
57 |
res = str.replace(/<cookie>/g, jsArr[i]);
|
58 |
x[i].innerHTML = res;
|
59 |
}
|
108 |
var cookieName = coNA;
|
109 |
var cookieConsentId = 'cookieChoiceInfo';
|
110 |
var dismissLinkId = 'cookieChoiceDismiss';
|
111 |
+
var htmlMarginOld = document.getElementsByTagName("html")[0].style.marginTop;
|
112 |
|
113 |
+
function ICC_outerHeight(el) {
|
114 |
+
var height = el.offsetHeight;
|
115 |
+
var style = getComputedStyle(el);
|
116 |
|
117 |
+
height += parseInt(style.marginTop) + parseInt(style.marginBottom);
|
118 |
+
return height;
|
119 |
+
}
|
120 |
|
121 |
+
function _createHeaderElement(cookieText, dismissText, linkText, linkHref) {
|
122 |
+
|
123 |
+
// var butterBarStyles = 'color:'+ btcB +';position:' + elPos + ';width:100%;background-color:' + bgB + ';' + 'margin:0; left:0;'+bPos+';padding:4px;z-index:9999;text-align:left;';
|
124 |
|
125 |
+
// Aggiungo contenitore esterno per migliorare il layout
|
126 |
var contenitore = document.createElement('div');
|
127 |
+
// var contenutoContenitoreStyle = 'max-width:980px;margin-right:auto;margin-left:auto;padding:15px;';
|
128 |
contenitore.id = cookieConsentId;
|
129 |
+
contenitore.className = container;
|
130 |
+
// contenitore.style.cssText = butterBarStyles;
|
131 |
|
132 |
var cookieConsentElement = document.createElement('div');
|
133 |
//cookieConsentElement.id = cookieConsentId;
|
134 |
+
cookieConsentElement.className = contentStyle;
|
135 |
+
// cookieConsentElement.style.cssText = contenutoContenitoreStyle;
|
136 |
cookieConsentElement.appendChild(_createConsentText(cookieText));
|
137 |
+
cookieConsentElement.appendChild(_createSpace());
|
138 |
|
139 |
if (!!linkText && !!linkHref) {
|
140 |
cookieConsentElement.appendChild(_createInformationLink(linkText, linkHref));
|
149 |
}
|
150 |
|
151 |
function _createDialogElement(cookieText, dismissText, linkText, linkHref) {
|
152 |
+
// var glassStyle = 'position:fixed;width:100%;height:100%;z-index:999;' +
|
153 |
+
// 'top:0;left:0;opacity:0.5;filter:alpha(opacity=50);' +
|
154 |
+
// 'background-color:#ccc;';
|
155 |
+
// var dialogStyle = 'z-index:9999;position:fixed;top:25%;';
|
156 |
+
// var contentStyle = 'position:relative;' +
|
157 |
+
// 'background-color:' + bgB + ';padding:20px;box-shadow:4px 4px 25px #888;max-width:80%;margin:0 auto;';
|
158 |
|
159 |
var cookieConsentElement = document.createElement('div');
|
160 |
cookieConsentElement.id = cookieConsentId;
|
161 |
|
162 |
var glassPanel = document.createElement('div');
|
163 |
+
// glassPanel.style.cssText = glassStyle;
|
164 |
+
glassPanel.className = 'glassStyle';
|
165 |
|
166 |
var content = document.createElement('div');
|
167 |
+
// content.style.cssText = contentStyle;
|
168 |
+
content.className = 'contentStyle';
|
169 |
+
|
|
|
|
|
170 |
var dialog = document.createElement('div');
|
171 |
+
// dialog.style.cssText = dialogStyle;
|
172 |
+
dialog.className = 'dialogStyle';
|
173 |
|
174 |
var dismissLink = _createDismissLink(dismissText);
|
175 |
+
// dismissLink.style.display = 'block';
|
176 |
+
// dismissLink.style.textAlign = 'right';
|
177 |
+
// dismissLink.style.marginTop = '8px';
|
178 |
|
179 |
content.appendChild(_createConsentText(cookieText));
|
180 |
|
200 |
|
201 |
function _createSpace(){
|
202 |
var hrStyle='clear:both;border-color:transparent;margin-top:5px;margin-bottom:5px';
|
203 |
+
var hr = document.createElement("hr");
|
204 |
+
hr.style.cssText = hrStyle;
|
205 |
+
return hr;
|
206 |
}
|
207 |
|
208 |
function _createConsentText(cookieText) {
|
212 |
}
|
213 |
|
214 |
function _createDismissLink(dismissText) {
|
215 |
+
// var buttonStyle='color: '+ btcB +';padding: 7px 12px;font-size: 18px;line-height: 18px;text-decoration: none;text-transform: uppercase;margin:0;margin-bottom:2px;letter-spacing: 0.125em;display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid '+ btcB +';background: rgba(255, 255, 255, 0.03);';
|
216 |
|
217 |
var dismissLink = document.createElement('a');
|
218 |
_setElementText(dismissLink, dismissText);
|
220 |
dismissLink.className = closeClass;
|
221 |
dismissLink.href = '#';
|
222 |
//dismissLink.style.marginLeft = '24px';
|
223 |
+
// dismissLink.style.cssText = buttonStyle;
|
224 |
return dismissLink;
|
225 |
}
|
226 |
|
227 |
function _createInformationLink(linkText, linkHref) {
|
228 |
+
// var buttonStyle='color: '+ btcB +';padding: 7px 12px;font-size: 18px;line-height: 18px;text-decoration: none;text-transform: uppercase;margin-right: 20px;margin-bottom:2px;letter-spacing: 0.125em;' +
|
229 |
+
// 'display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid '+ btcB +';background: rgba(255, 255, 255, 0.03);';
|
230 |
|
231 |
var infoLink = document.createElement('a');
|
232 |
_setElementText(infoLink, linkText);
|
233 |
infoLink.className = infoClass;
|
234 |
infoLink.href = linkHref;
|
235 |
+
// infoLink.style.marginLeft = '8px';
|
236 |
if (tar) infoLink.target = '_blank';
|
237 |
+
// infoLink.style.cssText = buttonStyle;
|
238 |
return infoLink;
|
239 |
}
|
240 |
|
241 |
function _dismissLinkClick() {
|
242 |
if (_shouldDisplayConsent()) {
|
243 |
+
if ( htmlM ) document.getElementsByTagName("html")[0].style.marginTop = htmlMarginOld;
|
244 |
allowCookie();
|
245 |
_saveUserPreference();
|
246 |
_removeCookieConsent();
|
258 |
var fragment = document.createDocumentFragment();
|
259 |
fragment.appendChild(consentElement);
|
260 |
document.body.appendChild(fragment.cloneNode(true));
|
261 |
+
if( htmlM ) document.getElementsByTagName("html")[0].style.marginTop = ICC_outerHeight(document.getElementById("cookieChoiceInfo"))+'px';
|
262 |
document.getElementById(dismissLinkId).onclick = _dismissLinkClick;
|
263 |
// document.onclick = _dismissLinkClick;
|
264 |
if (scroll) document.onscroll = _dismissLinkClick;
|
js/bigbutton/cookiechoices.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function allowCookie(){var a,b=document.getElementsByClassName("el"),c=new RegExp("<script.*?");for(a=0;a<b.length;a++){b[a].removeChild(b[a].childNodes[0]);var d=c.test(jsArr[a]);if(d){var e=/<script.*?src="(.*?)"/,f=e.test(jsArr[a]);f&&(f=e.exec(jsArr[a]),loadJS(f[1]));var g=/<script\b[^>]*>([\s\S]*?)<\/script>/gm,h=g.exec(jsArr[a]);h[1]&&appendJS(h[1])}else{var i=b[a].innerHTML;d=i.replace(/<cookie>/g,jsArr[a]),b[a].innerHTML=d}}}function loadJS(a){var b=document.createElement("script");b.type="application/javascript",b.src=a,document.body.appendChild(b)}function appendJS(a){var b=document.createElement("script");b.type="text/javascript";var c=a;try{b.appendChild(document.createTextNode(c)),document.body.appendChild(b)}catch(d){b.text=c,document.body.appendChild(b)}}!function(a){if(a.cookieChoices)return a.cookieChoices;var b=a.document,c=b.documentElement,
|
1 |
+
function allowCookie(){var a,b=document.getElementsByClassName("el"),c=new RegExp("<script.*?");for(a=0;a<b.length;a++){b[a].removeChild(b[a].childNodes[0]);var d=c.test(jsArr[a]);if(d){var e=/<script.*?src="(.*?)"/,f=e.test(jsArr[a]);f&&(f=e.exec(jsArr[a]),loadJS(f[1]));var g=/<script\b[^>]*>([\s\S]*?)<\/script>/gm,h=g.exec(jsArr[a]);h[1]&&appendJS(h[1])}else{var i=b[a].innerHTML;d=i.replace(/<cookie>/g,jsArr[a]),b[a].innerHTML=d}}}function loadJS(a){var b=document.createElement("script");b.type="application/javascript",b.src=a,document.body.appendChild(b)}function appendJS(a){var b=document.createElement("script");b.type="text/javascript";var c=a;try{b.appendChild(document.createTextNode(c)),document.body.appendChild(b)}catch(d){b.text=c,document.body.appendChild(b)}}!function(a){if(a.cookieChoices)return a.cookieChoices;var b=a.document,c=(b.documentElement,"textContent"in b.body),d=function(){function a(a){var b=a.offsetHeight,c=getComputedStyle(a);return b+=parseInt(c.marginTop)+parseInt(c.marginBottom)}function d(a,c,d,e){var f=b.createElement("div");f.id=t,f.className=container;var k=b.createElement("div");return k.className=contentStyle,k.appendChild(h(a)),k.appendChild(g()),d&&e&&k.appendChild(j(d,e)),k.appendChild(i(c)),f.appendChild(k),f}function e(a,c,d,e){var f=b.createElement("div");f.id=t;var k=b.createElement("div");k.className="glassStyle";var l=b.createElement("div");l.className="contentStyle";var m=b.createElement("div");m.className="dialogStyle";var n=i(c);return l.appendChild(h(a)),l.appendChild(g()),d&&e&&l.appendChild(j(d,e)),l.appendChild(n),m.appendChild(l),f.appendChild(k),f.appendChild(m),f}function f(a,b){c?a.textContent=b:a.innerText=b}function g(){var a="clear:both;border-color:transparent;margin-top:5px;margin-bottom:5px",c=b.createElement("hr");return c.style.cssText=a,c}function h(a){var c=b.createElement("span");return f(c,a),c}function i(a){var c=b.createElement("a");return f(c,a),c.id=u,c.className=closeClass,c.href="#",c}function j(a,c){var d=b.createElement("a");return f(d,a),d.className=infoClass,d.href=c,tar&&(d.target="_blank"),d}function k(){return r()&&(htmlM&&(b.getElementsByTagName("html")[0].style.marginTop=v),allowCookie(),q(),o()),rel&&b.location.reload(),!1}function l(c,f,g,h,i){if(r()){var j=i?e(c,f,g,h):d(c,f,g,h),l=b.createDocumentFragment();l.appendChild(j),b.body.appendChild(l.cloneNode(!0)),htmlM&&(b.getElementsByTagName("html")[0].style.marginTop=a(b.getElementById("cookieChoiceInfo"))+"px"),b.getElementById(u).onclick=k,scroll&&(b.onscroll=k)}}function m(a,b,c,d){l(a,b,c,d,!1)}function n(a,b,c,d){l(a,b,c,d,!0)}function o(){var a=b.getElementById(t);null!==a&&a.parentNode.removeChild(a)}function p(){k()}function q(){var a=new Date;a.setFullYear(a.getFullYear()+1),b.cookie=s+"="+coVA+"; expires="+a.toGMTString()+";path=/"}function r(){return!b.cookie.match(new RegExp(s+"=([^;]+)"))}var s=coNA,t="cookieChoiceInfo",u="cookieChoiceDismiss",v=b.getElementsByTagName("html")[0].style.marginTop,w={};return w.showCookieConsentBar=m,w.showCookieConsentDialog=n,w.removeCookieConsent=p,w}();return a.cookieChoices=d,d}(this);
|
js/bigbutton/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Italy Cookie Choices
|
js/custom/cookiechoices.js
ADDED
@@ -0,0 +1,314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
Copyright 2014 Google Inc. All rights reserved.
|
3 |
+
|
4 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
you may not use this file except in compliance with the License.
|
6 |
+
You may obtain a copy of the License at
|
7 |
+
|
8 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
|
10 |
+
Unless required by applicable law or agreed to in writing, software
|
11 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
See the License for the specific language governing permissions and
|
14 |
+
limitations under the License.
|
15 |
+
*/
|
16 |
+
|
17 |
+
function allowCookie() {
|
18 |
+
|
19 |
+
var x=document.getElementsByClassName("el");
|
20 |
+
|
21 |
+
// var patt = new RegExp("<script.*?\/script>");
|
22 |
+
var patt = new RegExp("<script.*?");
|
23 |
+
|
24 |
+
var i;
|
25 |
+
for (i = 0; i < x.length; i++) {
|
26 |
+
|
27 |
+
x[i].removeChild(x[i].childNodes[0]);
|
28 |
+
|
29 |
+
// console.log(jsArr[i]);
|
30 |
+
|
31 |
+
var res = patt.test(jsArr[i]);
|
32 |
+
// console.log(res);
|
33 |
+
|
34 |
+
if (res) {
|
35 |
+
// console.log(jsArr[i]);
|
36 |
+
|
37 |
+
var regexURL = /<script.*?src="(.*?)"/;
|
38 |
+
|
39 |
+
var URL = regexURL.test(jsArr[i]);
|
40 |
+
|
41 |
+
if (URL) {
|
42 |
+
URL = regexURL.exec(jsArr[i]);
|
43 |
+
loadJS(URL[1]);
|
44 |
+
}
|
45 |
+
|
46 |
+
var regex = /<script\b[^>]*>([\s\S]*?)<\/script>/gm;
|
47 |
+
|
48 |
+
var code = regex.exec(jsArr[i]);
|
49 |
+
|
50 |
+
if ( code[1] ) appendJS(code[1]);
|
51 |
+
|
52 |
+
} else {
|
53 |
+
|
54 |
+
var str = x[i].innerHTML;
|
55 |
+
// var res = str.replace(/<!--(.*?)-->/g, "$1");
|
56 |
+
// Prendo l'array creato e all'accettazione ogni valore e' messo al suo posto
|
57 |
+
res = str.replace(/<cookie>/g, jsArr[i]);
|
58 |
+
x[i].innerHTML = res;
|
59 |
+
}
|
60 |
+
|
61 |
+
// var cookieName=coNA;var expiryDate=new Date();expiryDate.setFullYear(expiryDate.getFullYear()+1);document.cookie=cookieName+"=; expires="+expiryDate.toGMTString()+"; path=/";
|
62 |
+
|
63 |
+
// var cookieName=coNA;var expiryDate=new Date();expiryDate.setFullYear(expiryDate.getFullYear() + 1);
|
64 |
+
// document.cookie = cookieName + '=y; expires=' + expiryDate.toGMTString();
|
65 |
+
// document.cookie = cookieName + '=' + coVA + '; expires=' + expiryDate.toGMTString() + ';path=/';
|
66 |
+
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
function loadJS(file) {
|
71 |
+
// DOM: Create the script element
|
72 |
+
var jsElm = document.createElement("script");
|
73 |
+
// set the type attribute
|
74 |
+
jsElm.type = "application/javascript";
|
75 |
+
// make the script element load file
|
76 |
+
jsElm.src = file;
|
77 |
+
// finally insert the element to the body element in order to load the script
|
78 |
+
document.body.appendChild(jsElm);
|
79 |
+
}
|
80 |
+
|
81 |
+
function appendJS(script){
|
82 |
+
var s = document.createElement("script");
|
83 |
+
s.type = "text/javascript";
|
84 |
+
var code = script;
|
85 |
+
try {
|
86 |
+
s.appendChild(document.createTextNode(code));
|
87 |
+
document.body.appendChild(s);
|
88 |
+
} catch (e) {
|
89 |
+
s.text = code;
|
90 |
+
document.body.appendChild(s);
|
91 |
+
}
|
92 |
+
}
|
93 |
+
|
94 |
+
(function(window) {
|
95 |
+
|
96 |
+
if (!!window.cookieChoices) {
|
97 |
+
return window.cookieChoices;
|
98 |
+
}
|
99 |
+
|
100 |
+
var document = window.document;
|
101 |
+
var html = document.documentElement;//Per aggiungere un margin-top al tag HTML
|
102 |
+
// IE8 does not support textContent, so we should fallback to innerText.
|
103 |
+
var supportsTextContent = 'textContent' in document.body;
|
104 |
+
|
105 |
+
var cookieChoices = (function() {
|
106 |
+
|
107 |
+
// var cookieName = 'displayCookieConsent';
|
108 |
+
var cookieName = coNA;
|
109 |
+
var cookieConsentId = 'cookieChoiceInfo';
|
110 |
+
var dismissLinkId = 'cookieChoiceDismiss';
|
111 |
+
var htmlMarginOld = document.getElementsByTagName("html")[0].style.marginTop;
|
112 |
+
|
113 |
+
function ICC_outerHeight(el) {
|
114 |
+
var height = el.offsetHeight;
|
115 |
+
var style = getComputedStyle(el);
|
116 |
+
|
117 |
+
height += parseInt(style.marginTop) + parseInt(style.marginBottom);
|
118 |
+
return height;
|
119 |
+
}
|
120 |
+
|
121 |
+
function _createHeaderElement(cookieText, dismissText, linkText, linkHref) {
|
122 |
+
|
123 |
+
// var butterBarStyles = 'color:'+ btcB +';position:' + elPos + ';width:100%;background-color:' + bgB + ';' + 'margin:0; left:0;'+bPos+';padding:4px;z-index:9999;text-align:center;';
|
124 |
+
|
125 |
+
// Aggiungo contenitore esterno per migliorare il layout
|
126 |
+
var contenitore = document.createElement('div');
|
127 |
+
// var contenutoContenitoreStyle = 'max-width:980px;margin-right:auto;margin-left:auto;padding:15px;';
|
128 |
+
contenitore.id = cookieConsentId;
|
129 |
+
contenitore.className = container;
|
130 |
+
// contenitore.style.cssText = butterBarStyles;
|
131 |
+
|
132 |
+
var cookieConsentElement = document.createElement('div');
|
133 |
+
//cookieConsentElement.id = cookieConsentId;
|
134 |
+
cookieConsentElement.className = contentStyle;
|
135 |
+
// cookieConsentElement.style.cssText = contenutoContenitoreStyle;
|
136 |
+
cookieConsentElement.appendChild(_createConsentText(cookieText));
|
137 |
+
// if ( def ) cookieConsentElement.appendChild(_createSpace());
|
138 |
+
|
139 |
+
if (!!linkText && !!linkHref) {
|
140 |
+
cookieConsentElement.appendChild(_createInformationLink(linkText, linkHref));
|
141 |
+
}
|
142 |
+
cookieConsentElement.appendChild(_createDismissLink(dismissText));
|
143 |
+
|
144 |
+
// Inglobo contenuto in contenitore.
|
145 |
+
contenitore.appendChild(cookieConsentElement);
|
146 |
+
|
147 |
+
return contenitore;
|
148 |
+
// return cookieConsentElement;
|
149 |
+
}
|
150 |
+
|
151 |
+
function _createDialogElement(cookieText, dismissText, linkText, linkHref) {
|
152 |
+
// var glassStyle = 'position:fixed;width:100%;height:100%;z-index:999;' +
|
153 |
+
// 'top:0;left:0;opacity:0.5;filter:alpha(opacity=50);' +
|
154 |
+
// 'background-color:#ccc;';
|
155 |
+
// var dialogStyle = 'z-index:9999;position:fixed;top:25%;';
|
156 |
+
// var contentStyle = 'position:relative;' +
|
157 |
+
// 'background-color:' + bgB + ';padding:20px;box-shadow:4px 4px 25px #888;max-width:80%;margin:0 auto;';
|
158 |
+
|
159 |
+
var cookieConsentElement = document.createElement('div');
|
160 |
+
cookieConsentElement.id = cookieConsentId;
|
161 |
+
|
162 |
+
var glassPanel = document.createElement('div');
|
163 |
+
// glassPanel.style.cssText = glassStyle;
|
164 |
+
glassPanel.className = 'glassStyle';
|
165 |
+
|
166 |
+
var content = document.createElement('div');
|
167 |
+
// content.style.cssText = contentStyle;
|
168 |
+
content.className = 'contentStyle';
|
169 |
+
|
170 |
+
var dialog = document.createElement('div');
|
171 |
+
// dialog.style.cssText = dialogStyle;
|
172 |
+
dialog.className = 'dialogStyle';
|
173 |
+
|
174 |
+
var dismissLink = _createDismissLink(dismissText);
|
175 |
+
dismissLink.style.display = 'block';
|
176 |
+
dismissLink.style.textAlign = 'right';
|
177 |
+
dismissLink.style.marginTop = '8px';
|
178 |
+
|
179 |
+
content.appendChild(_createConsentText(cookieText));
|
180 |
+
|
181 |
+
//content.appendChild(_createSpace());
|
182 |
+
|
183 |
+
if (!!linkText && !!linkHref) {
|
184 |
+
content.appendChild(_createInformationLink(linkText, linkHref));
|
185 |
+
}
|
186 |
+
content.appendChild(dismissLink);
|
187 |
+
dialog.appendChild(content);
|
188 |
+
cookieConsentElement.appendChild(glassPanel);
|
189 |
+
cookieConsentElement.appendChild(dialog);
|
190 |
+
return cookieConsentElement;
|
191 |
+
}
|
192 |
+
|
193 |
+
function _setElementText(element, text) {
|
194 |
+
if (supportsTextContent) {
|
195 |
+
element.textContent = text;
|
196 |
+
} else {
|
197 |
+
element.innerText = text;
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
/* function _createSpace(){
|
202 |
+
var hrStyle='clear:both;border-color:transparent;margin-top:5px;margin-bottom:5px';
|
203 |
+
var hr = document.createElement("hr");
|
204 |
+
hr.style.cssText = hrStyle;
|
205 |
+
return hr;
|
206 |
+
}*/
|
207 |
+
|
208 |
+
function _createConsentText(cookieText) {
|
209 |
+
var consentText = document.createElement('span');
|
210 |
+
_setElementText(consentText, cookieText);
|
211 |
+
return consentText;
|
212 |
+
}
|
213 |
+
|
214 |
+
function _createDismissLink(dismissText) {
|
215 |
+
//var buttonStyle='color: '+ btcB +';padding: 7px 12px;font-size: 18px;line-height: 18px;text-decoration: none;text-transform: uppercase;margin:0;margin-bottom:2px;letter-spacing: 0.125em;display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid '+ btcB +';background: rgba(255, 255, 255, 0.03);';
|
216 |
+
|
217 |
+
var dismissLink = document.createElement('a');
|
218 |
+
_setElementText(dismissLink, dismissText);
|
219 |
+
dismissLink.id = dismissLinkId;
|
220 |
+
dismissLink.className = closeClass;
|
221 |
+
dismissLink.href = '#';
|
222 |
+
// dismissLink.style.marginLeft = '24px';
|
223 |
+
//dismissLink.style.cssText = buttonStyle;
|
224 |
+
return dismissLink;
|
225 |
+
}
|
226 |
+
|
227 |
+
function _createInformationLink(linkText, linkHref) {
|
228 |
+
/*var buttonStyle='color: '+ btcB +';padding: 7px 12px;font-size: 18px;line-height: 18px;text-decoration: none;text-transform: uppercase;margin-right: 20px;margin-bottom:2px;letter-spacing: 0.125em;' +
|
229 |
+
'display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid '+ btcB +';background: rgba(255, 255, 255, 0.03);';
|
230 |
+
*/
|
231 |
+
var infoLink = document.createElement('a');
|
232 |
+
_setElementText(infoLink, linkText);
|
233 |
+
infoLink.className = infoClass;
|
234 |
+
infoLink.href = linkHref;
|
235 |
+
// infoLink.style.marginLeft = '8px';
|
236 |
+
if (tar) infoLink.target = '_blank';
|
237 |
+
//infoLink.style.cssText = buttonStyle;
|
238 |
+
return infoLink;
|
239 |
+
}
|
240 |
+
|
241 |
+
function _dismissLinkClick() {
|
242 |
+
if (_shouldDisplayConsent()) {
|
243 |
+
if ( htmlM ) document.getElementsByTagName("html")[0].style.marginTop = htmlMarginOld;
|
244 |
+
allowCookie();
|
245 |
+
_saveUserPreference();
|
246 |
+
_removeCookieConsent();
|
247 |
+
}
|
248 |
+
if ( rel ) document.location.reload();
|
249 |
+
return false;
|
250 |
+
}
|
251 |
+
|
252 |
+
function _showCookieConsent(cookieText, dismissText, linkText, linkHref, isDialog) {
|
253 |
+
if (_shouldDisplayConsent()) {
|
254 |
+
// _removeCookieConsent();
|
255 |
+
var consentElement = (isDialog) ?
|
256 |
+
_createDialogElement(cookieText, dismissText, linkText, linkHref) :
|
257 |
+
_createHeaderElement(cookieText, dismissText, linkText, linkHref);
|
258 |
+
var fragment = document.createDocumentFragment();
|
259 |
+
fragment.appendChild(consentElement);
|
260 |
+
document.body.appendChild(fragment.cloneNode(true));
|
261 |
+
if( htmlM ) document.getElementsByTagName("html")[0].style.marginTop = ICC_outerHeight(document.getElementById("cookieChoiceInfo"))+'px';
|
262 |
+
document.getElementById(dismissLinkId).onclick = _dismissLinkClick;
|
263 |
+
// document.onclick = _dismissLinkClick;
|
264 |
+
if (scroll) document.onscroll = _dismissLinkClick;
|
265 |
+
}
|
266 |
+
// if (scroll) document.onscroll = _dismissLinkClick;
|
267 |
+
}
|
268 |
+
|
269 |
+
function showCookieConsentBar(cookieText, dismissText, linkText, linkHref) {
|
270 |
+
_showCookieConsent(cookieText, dismissText, linkText, linkHref, false);
|
271 |
+
}
|
272 |
+
|
273 |
+
function showCookieConsentDialog(cookieText, dismissText, linkText, linkHref) {
|
274 |
+
_showCookieConsent(cookieText, dismissText, linkText, linkHref, true);
|
275 |
+
}
|
276 |
+
|
277 |
+
function _removeCookieConsent() {
|
278 |
+
var cookieChoiceElement = document.getElementById(cookieConsentId);
|
279 |
+
if (cookieChoiceElement !== null) {
|
280 |
+
cookieChoiceElement.parentNode.removeChild(cookieChoiceElement);
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
/**
|
285 |
+
* Funzione creata per poter essere usata onclick sul bottone
|
286 |
+
* @return {null} Elimina il banner e crea il cookie al click
|
287 |
+
*/
|
288 |
+
function removeCookieConsent(){
|
289 |
+
_dismissLinkClick();
|
290 |
+
}
|
291 |
+
|
292 |
+
function _saveUserPreference() {
|
293 |
+
// Set the cookie expiry to one year after today.
|
294 |
+
var expiryDate = new Date();
|
295 |
+
expiryDate.setFullYear(expiryDate.getFullYear() + 1);
|
296 |
+
// document.cookie = cookieName + '=y; expires=' + expiryDate.toGMTString();
|
297 |
+
document.cookie = cookieName + '=' + coVA + '; expires=' + expiryDate.toGMTString() + ';path=/';
|
298 |
+
}
|
299 |
+
|
300 |
+
function _shouldDisplayConsent() {
|
301 |
+
// Display the header only if the cookie has not been set.
|
302 |
+
return !document.cookie.match(new RegExp(cookieName + '=([^;]+)'));
|
303 |
+
}
|
304 |
+
|
305 |
+
var exports = {};
|
306 |
+
exports.showCookieConsentBar = showCookieConsentBar;
|
307 |
+
exports.showCookieConsentDialog = showCookieConsentDialog;
|
308 |
+
exports.removeCookieConsent = removeCookieConsent;
|
309 |
+
return exports;
|
310 |
+
})();
|
311 |
+
|
312 |
+
window.cookieChoices = cookieChoices;
|
313 |
+
return cookieChoices;
|
314 |
+
})(this);
|
js/custom/cookiechoices.php
ADDED
File without changes
|
js/default/cookiechoices.js
CHANGED
@@ -53,7 +53,7 @@ function allowCookie() {
|
|
53 |
|
54 |
var str = x[i].innerHTML;
|
55 |
// var res = str.replace(/<!--(.*?)-->/g, "$1");
|
56 |
-
// Prendo l
|
57 |
res = str.replace(/<cookie>/g, jsArr[i]);
|
58 |
x[i].innerHTML = res;
|
59 |
}
|
@@ -108,25 +108,33 @@ function appendJS(script){
|
|
108 |
var cookieName = coNA;
|
109 |
var cookieConsentId = 'cookieChoiceInfo';
|
110 |
var dismissLinkId = 'cookieChoiceDismiss';
|
|
|
111 |
|
112 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
|
114 |
-
|
115 |
|
116 |
-
var butterBarStyles = 'color:'+ btcB +';position:' + elPos + ';width:100%;background-color:' + bgB + ';' +
|
117 |
-
'margin:0; left:0;'+bPos+';padding:4px;z-index:9999;text-align:center;';
|
118 |
|
119 |
-
|
120 |
-
|
121 |
-
//var contenutoContenitoreStyle = 'max-width:980px;margin-right:auto;margin-left:auto;padding:15px;';
|
122 |
-
|
123 |
-
|
|
|
124 |
|
125 |
var cookieConsentElement = document.createElement('div');
|
126 |
-
cookieConsentElement.id = cookieConsentId;
|
127 |
-
cookieConsentElement.
|
|
|
128 |
cookieConsentElement.appendChild(_createConsentText(cookieText));
|
129 |
-
|
130 |
|
131 |
if (!!linkText && !!linkHref) {
|
132 |
cookieConsentElement.appendChild(_createInformationLink(linkText, linkHref));
|
@@ -134,39 +142,39 @@ function appendJS(script){
|
|
134 |
cookieConsentElement.appendChild(_createDismissLink(dismissText));
|
135 |
|
136 |
// Inglobo contenuto in contenitore.
|
137 |
-
|
138 |
|
139 |
-
|
140 |
-
return cookieConsentElement;
|
141 |
}
|
142 |
|
143 |
function _createDialogElement(cookieText, dismissText, linkText, linkHref) {
|
144 |
-
var glassStyle = 'position:fixed;width:100%;height:100%;z-index:999;' +
|
145 |
-
'top:0;left:0;opacity:0.5;filter:alpha(opacity=50);' +
|
146 |
-
'background-color:#ccc;';
|
147 |
-
var dialogStyle = 'z-index:9999;position:fixed;
|
148 |
-
var contentStyle = 'position:relative;
|
149 |
-
'background-color:' + bgB + ';padding:20px;box-shadow:4px 4px 25px #888;';
|
150 |
|
151 |
var cookieConsentElement = document.createElement('div');
|
152 |
cookieConsentElement.id = cookieConsentId;
|
153 |
|
154 |
var glassPanel = document.createElement('div');
|
155 |
-
glassPanel.style.cssText = glassStyle;
|
|
|
156 |
|
157 |
var content = document.createElement('div');
|
158 |
-
content.style.cssText = contentStyle;
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
var dialog = document.createElement('div');
|
164 |
-
dialog.style.cssText = dialogStyle;
|
|
|
165 |
|
166 |
var dismissLink = _createDismissLink(dismissText);
|
167 |
-
dismissLink.style.display = 'block';
|
168 |
-
dismissLink.style.textAlign = 'right';
|
169 |
-
dismissLink.style.marginTop = '8px';
|
170 |
|
171 |
content.appendChild(_createConsentText(cookieText));
|
172 |
|
@@ -199,6 +207,7 @@ function appendJS(script){
|
|
199 |
|
200 |
function _createConsentText(cookieText) {
|
201 |
var consentText = document.createElement('span');
|
|
|
202 |
_setElementText(consentText, cookieText);
|
203 |
return consentText;
|
204 |
}
|
@@ -211,7 +220,7 @@ function appendJS(script){
|
|
211 |
dismissLink.id = dismissLinkId;
|
212 |
dismissLink.className = closeClass;
|
213 |
dismissLink.href = '#';
|
214 |
-
dismissLink.style.marginLeft = '24px';
|
215 |
//dismissLink.style.cssText = buttonStyle;
|
216 |
return dismissLink;
|
217 |
}
|
@@ -224,6 +233,7 @@ function appendJS(script){
|
|
224 |
_setElementText(infoLink, linkText);
|
225 |
infoLink.className = infoClass;
|
226 |
infoLink.href = linkHref;
|
|
|
227 |
if (tar) infoLink.target = '_blank';
|
228 |
//infoLink.style.cssText = buttonStyle;
|
229 |
return infoLink;
|
@@ -231,7 +241,7 @@ function appendJS(script){
|
|
231 |
|
232 |
function _dismissLinkClick() {
|
233 |
if (_shouldDisplayConsent()) {
|
234 |
-
if ( htmlM )
|
235 |
allowCookie();
|
236 |
_saveUserPreference();
|
237 |
_removeCookieConsent();
|
@@ -249,6 +259,7 @@ function appendJS(script){
|
|
249 |
var fragment = document.createDocumentFragment();
|
250 |
fragment.appendChild(consentElement);
|
251 |
document.body.appendChild(fragment.cloneNode(true));
|
|
|
252 |
document.getElementById(dismissLinkId).onclick = _dismissLinkClick;
|
253 |
// document.onclick = _dismissLinkClick;
|
254 |
if (scroll) document.onscroll = _dismissLinkClick;
|
53 |
|
54 |
var str = x[i].innerHTML;
|
55 |
// var res = str.replace(/<!--(.*?)-->/g, "$1");
|
56 |
+
// Prendo l'array creato e all'accettazione ogni valore e' messo al suo posto
|
57 |
res = str.replace(/<cookie>/g, jsArr[i]);
|
58 |
x[i].innerHTML = res;
|
59 |
}
|
108 |
var cookieName = coNA;
|
109 |
var cookieConsentId = 'cookieChoiceInfo';
|
110 |
var dismissLinkId = 'cookieChoiceDismiss';
|
111 |
+
var htmlMarginOld = document.getElementsByTagName("html")[0].style.marginTop;
|
112 |
|
113 |
+
function ICC_outerHeight(el) {
|
114 |
+
var height = el.offsetHeight;
|
115 |
+
var style = getComputedStyle(el);
|
116 |
+
|
117 |
+
height += parseInt(style.marginTop) + parseInt(style.marginBottom);
|
118 |
+
return height;
|
119 |
+
}
|
120 |
|
121 |
+
function _createHeaderElement(cookieText, dismissText, linkText, linkHref) {
|
122 |
|
123 |
+
// var butterBarStyles = 'color:'+ btcB +';position:' + elPos + ';width:100%;background-color:' + bgB + ';' + 'margin:0; left:0;'+bPos+';padding:4px;z-index:9999;text-align:center;';
|
|
|
124 |
|
125 |
+
// Aggiungo contenitore esterno per migliorare il layout
|
126 |
+
var contenitore = document.createElement('div');
|
127 |
+
// var contenutoContenitoreStyle = 'max-width:980px;margin-right:auto;margin-left:auto;padding:15px;';
|
128 |
+
contenitore.id = cookieConsentId;
|
129 |
+
contenitore.className = bannerStyle;
|
130 |
+
// contenitore.style.cssText = butterBarStyles;
|
131 |
|
132 |
var cookieConsentElement = document.createElement('div');
|
133 |
+
//cookieConsentElement.id = cookieConsentId;
|
134 |
+
cookieConsentElement.className = contentStyle;
|
135 |
+
// cookieConsentElement.style.cssText = contenutoContenitoreStyle;
|
136 |
cookieConsentElement.appendChild(_createConsentText(cookieText));
|
137 |
+
// if ( def ) cookieConsentElement.appendChild(_createSpace());
|
138 |
|
139 |
if (!!linkText && !!linkHref) {
|
140 |
cookieConsentElement.appendChild(_createInformationLink(linkText, linkHref));
|
142 |
cookieConsentElement.appendChild(_createDismissLink(dismissText));
|
143 |
|
144 |
// Inglobo contenuto in contenitore.
|
145 |
+
contenitore.appendChild(cookieConsentElement);
|
146 |
|
147 |
+
return contenitore;
|
148 |
+
// return cookieConsentElement;
|
149 |
}
|
150 |
|
151 |
function _createDialogElement(cookieText, dismissText, linkText, linkHref) {
|
152 |
+
// var glassStyle = 'position:fixed;width:100%;height:100%;z-index:999;' +
|
153 |
+
// 'top:0;left:0;opacity:0.5;filter:alpha(opacity=50);' +
|
154 |
+
// 'background-color:#ccc;';
|
155 |
+
// var dialogStyle = 'z-index:9999;position:fixed;top:25%;';
|
156 |
+
// var contentStyle = 'position:relative;' +
|
157 |
+
// 'background-color:' + bgB + ';padding:20px;box-shadow:4px 4px 25px #888;max-width:80%;margin:0 auto;';
|
158 |
|
159 |
var cookieConsentElement = document.createElement('div');
|
160 |
cookieConsentElement.id = cookieConsentId;
|
161 |
|
162 |
var glassPanel = document.createElement('div');
|
163 |
+
// glassPanel.style.cssText = glassStyle;
|
164 |
+
glassPanel.className = 'glassStyle';
|
165 |
|
166 |
var content = document.createElement('div');
|
167 |
+
// content.style.cssText = contentStyle;
|
168 |
+
content.className = contentStyle;
|
169 |
+
|
|
|
|
|
170 |
var dialog = document.createElement('div');
|
171 |
+
// dialog.style.cssText = dialogStyle;
|
172 |
+
dialog.className = bannerStyle;
|
173 |
|
174 |
var dismissLink = _createDismissLink(dismissText);
|
175 |
+
// dismissLink.style.display = 'block';
|
176 |
+
// dismissLink.style.textAlign = 'right';
|
177 |
+
// dismissLink.style.marginTop = '8px';
|
178 |
|
179 |
content.appendChild(_createConsentText(cookieText));
|
180 |
|
207 |
|
208 |
function _createConsentText(cookieText) {
|
209 |
var consentText = document.createElement('span');
|
210 |
+
consentText.className = consText;
|
211 |
_setElementText(consentText, cookieText);
|
212 |
return consentText;
|
213 |
}
|
220 |
dismissLink.id = dismissLinkId;
|
221 |
dismissLink.className = closeClass;
|
222 |
dismissLink.href = '#';
|
223 |
+
// dismissLink.style.marginLeft = '24px';
|
224 |
//dismissLink.style.cssText = buttonStyle;
|
225 |
return dismissLink;
|
226 |
}
|
233 |
_setElementText(infoLink, linkText);
|
234 |
infoLink.className = infoClass;
|
235 |
infoLink.href = linkHref;
|
236 |
+
// infoLink.style.marginLeft = '8px';
|
237 |
if (tar) infoLink.target = '_blank';
|
238 |
//infoLink.style.cssText = buttonStyle;
|
239 |
return infoLink;
|
241 |
|
242 |
function _dismissLinkClick() {
|
243 |
if (_shouldDisplayConsent()) {
|
244 |
+
if ( htmlM ) document.getElementsByTagName("html")[0].style.marginTop = htmlMarginOld;
|
245 |
allowCookie();
|
246 |
_saveUserPreference();
|
247 |
_removeCookieConsent();
|
259 |
var fragment = document.createDocumentFragment();
|
260 |
fragment.appendChild(consentElement);
|
261 |
document.body.appendChild(fragment.cloneNode(true));
|
262 |
+
if( htmlM ) document.getElementsByTagName("html")[0].style.marginTop = ICC_outerHeight(document.getElementById("cookieChoiceInfo"))+'px';
|
263 |
document.getElementById(dismissLinkId).onclick = _dismissLinkClick;
|
264 |
// document.onclick = _dismissLinkClick;
|
265 |
if (scroll) document.onscroll = _dismissLinkClick;
|
js/default/cookiechoices.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function allowCookie(){var a,b=document.getElementsByClassName("el"),c=new RegExp("<script.*?");for(a=0;a<b.length;a++){b[a].removeChild(b[a].childNodes[0]);var d=c.test(jsArr[a]);if(d){var e=/<script.*?src="(.*?)"/,f=e.test(jsArr[a]);f&&(f=e.exec(jsArr[a]),loadJS(f[1]));var g=/<script\b[^>]*>([\s\S]*?)<\/script>/gm,h=g.exec(jsArr[a]);h[1]&&appendJS(h[1])}else{var i=b[a].innerHTML;d=i.replace(/<cookie>/g,jsArr[a]),b[a].innerHTML=d}}}function loadJS(a){var b=document.createElement("script");b.type="application/javascript",b.src=a,document.body.appendChild(b)}function appendJS(a){var b=document.createElement("script");b.type="text/javascript";var c=a;try{b.appendChild(document.createTextNode(c)),document.body.appendChild(b)}catch(d){b.text=c,document.body.appendChild(b)}}!function(a){if(a.cookieChoices)return a.cookieChoices;var b=a.document,c=b.documentElement,
|
1 |
+
function allowCookie(){var a,b=document.getElementsByClassName("el"),c=new RegExp("<script.*?");for(a=0;a<b.length;a++){b[a].removeChild(b[a].childNodes[0]);var d=c.test(jsArr[a]);if(d){var e=/<script.*?src="(.*?)"/,f=e.test(jsArr[a]);f&&(f=e.exec(jsArr[a]),loadJS(f[1]));var g=/<script\b[^>]*>([\s\S]*?)<\/script>/gm,h=g.exec(jsArr[a]);h[1]&&appendJS(h[1])}else{var i=b[a].innerHTML;d=i.replace(/<cookie>/g,jsArr[a]),b[a].innerHTML=d}}}function loadJS(a){var b=document.createElement("script");b.type="application/javascript",b.src=a,document.body.appendChild(b)}function appendJS(a){var b=document.createElement("script");b.type="text/javascript";var c=a;try{b.appendChild(document.createTextNode(c)),document.body.appendChild(b)}catch(d){b.text=c,document.body.appendChild(b)}}!function(a){if(a.cookieChoices)return a.cookieChoices;var b=a.document,c=(b.documentElement,"textContent"in b.body),d=function(){function a(a){var b=a.offsetHeight,c=getComputedStyle(a);return b+=parseInt(c.marginTop)+parseInt(c.marginBottom)}function d(a,c,d,e){var f=b.createElement("div");f.id=s,f.className=bannerStyle;var j=b.createElement("div");return j.className=contentStyle,j.appendChild(g(a)),d&&e&&j.appendChild(i(d,e)),j.appendChild(h(c)),f.appendChild(j),f}function e(a,c,d,e){var f=b.createElement("div");f.id=s;var j=b.createElement("div");j.className="glassStyle";var k=b.createElement("div");k.className=contentStyle;var l=b.createElement("div");l.className=bannerStyle;var m=h(c);return k.appendChild(g(a)),d&&e&&k.appendChild(i(d,e)),k.appendChild(m),l.appendChild(k),f.appendChild(j),f.appendChild(l),f}function f(a,b){c?a.textContent=b:a.innerText=b}function g(a){var c=b.createElement("span");return c.className=consText,f(c,a),c}function h(a){var c=b.createElement("a");return f(c,a),c.id=t,c.className=closeClass,c.href="#",c}function i(a,c){var d=b.createElement("a");return f(d,a),d.className=infoClass,d.href=c,tar&&(d.target="_blank"),d}function j(){return q()&&(htmlM&&(b.getElementsByTagName("html")[0].style.marginTop=u),allowCookie(),p(),n()),rel&&b.location.reload(),!1}function k(c,f,g,h,i){if(q()){var k=i?e(c,f,g,h):d(c,f,g,h),l=b.createDocumentFragment();l.appendChild(k),b.body.appendChild(l.cloneNode(!0)),htmlM&&(b.getElementsByTagName("html")[0].style.marginTop=a(b.getElementById("cookieChoiceInfo"))+"px"),b.getElementById(t).onclick=j,scroll&&(b.onscroll=j)}}function l(a,b,c,d){k(a,b,c,d,!1)}function m(a,b,c,d){k(a,b,c,d,!0)}function n(){var a=b.getElementById(s);null!==a&&a.parentNode.removeChild(a)}function o(){j()}function p(){var a=new Date;a.setFullYear(a.getFullYear()+1),b.cookie=r+"="+coVA+"; expires="+a.toGMTString()+";path=/"}function q(){return!b.cookie.match(new RegExp(r+"=([^;]+)"))}var r=coNA,s="cookieChoiceInfo",t="cookieChoiceDismiss",u=b.getElementsByTagName("html")[0].style.marginTop,v={};return v.showCookieConsentBar=l,v.showCookieConsentDialog=m,v.removeCookieConsent=o,v}();return a.cookieChoices=d,d}(this);
|
js/default/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Italy Cookie Choices
|
js/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Italy Cookie Choices
|
js/smallbutton/cookiechoices.js
CHANGED
@@ -53,7 +53,7 @@ function allowCookie() {
|
|
53 |
|
54 |
var str = x[i].innerHTML;
|
55 |
// var res = str.replace(/<!--(.*?)-->/g, "$1");
|
56 |
-
// Prendo l\'array creato e all\'accettazione ogni valore
|
57 |
res = str.replace(/<cookie>/g, jsArr[i]);
|
58 |
x[i].innerHTML = res;
|
59 |
}
|
@@ -108,25 +108,33 @@ function appendJS(script){
|
|
108 |
var cookieName = coNA;
|
109 |
var cookieConsentId = 'cookieChoiceInfo';
|
110 |
var dismissLinkId = 'cookieChoiceDismiss';
|
|
|
111 |
|
112 |
-
function
|
|
|
|
|
113 |
|
114 |
-
|
|
|
|
|
115 |
|
116 |
-
|
117 |
-
|
|
|
118 |
|
119 |
-
|
120 |
var contenitore = document.createElement('div');
|
121 |
-
var contenutoContenitoreStyle = 'max-width:980px;margin-right:auto;margin-left:auto;padding:15px;';
|
122 |
contenitore.id = cookieConsentId;
|
123 |
-
contenitore.
|
|
|
124 |
|
125 |
var cookieConsentElement = document.createElement('div');
|
126 |
//cookieConsentElement.id = cookieConsentId;
|
127 |
-
cookieConsentElement.
|
|
|
128 |
cookieConsentElement.appendChild(_createConsentText(cookieText));
|
129 |
-
|
130 |
|
131 |
if (!!linkText && !!linkHref) {
|
132 |
cookieConsentElement.appendChild(_createInformationLink(linkText, linkHref));
|
@@ -141,32 +149,32 @@ function appendJS(script){
|
|
141 |
}
|
142 |
|
143 |
function _createDialogElement(cookieText, dismissText, linkText, linkHref) {
|
144 |
-
var glassStyle = 'position:fixed;width:100%;height:100%;z-index:999;' +
|
145 |
-
'top:0;left:0;opacity:0.5;filter:alpha(opacity=50);' +
|
146 |
-
'background-color:#ccc;';
|
147 |
-
var dialogStyle = 'z-index:9999;position:fixed;
|
148 |
-
var contentStyle = 'position:relative;
|
149 |
-
'background-color:' + bgB + ';padding:20px;box-shadow:4px 4px 25px #888;';
|
150 |
|
151 |
var cookieConsentElement = document.createElement('div');
|
152 |
cookieConsentElement.id = cookieConsentId;
|
153 |
|
154 |
var glassPanel = document.createElement('div');
|
155 |
-
glassPanel.style.cssText = glassStyle;
|
|
|
156 |
|
157 |
var content = document.createElement('div');
|
158 |
-
content.style.cssText = contentStyle;
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
var dialog = document.createElement('div');
|
164 |
-
dialog.style.cssText = dialogStyle;
|
|
|
165 |
|
166 |
var dismissLink = _createDismissLink(dismissText);
|
167 |
-
//dismissLink.style.display = 'block';
|
168 |
-
//dismissLink.style.textAlign = 'right';
|
169 |
-
//dismissLink.style.marginTop = '8px';
|
170 |
|
171 |
content.appendChild(_createConsentText(cookieText));
|
172 |
|
@@ -192,9 +200,9 @@ function appendJS(script){
|
|
192 |
|
193 |
function _createSpace(){
|
194 |
var hrStyle='clear:both;border-color:transparent;margin-top:5px;margin-bottom:5px';
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
}
|
199 |
|
200 |
function _createConsentText(cookieText) {
|
@@ -204,7 +212,7 @@ function appendJS(script){
|
|
204 |
}
|
205 |
|
206 |
function _createDismissLink(dismissText) {
|
207 |
-
var buttonStyle='color: '+ btcB +';padding: 3px 7px;font-size: 14px;line-height: 14px;text-decoration: none;text-transform: uppercase;margin:0;margin-bottom:2px;letter-spacing: 0.115em;display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid '+ btcB +';background: rgba(255, 255, 255, 0.03);';
|
208 |
|
209 |
var dismissLink = document.createElement('a');
|
210 |
_setElementText(dismissLink, dismissText);
|
@@ -212,26 +220,27 @@ function appendJS(script){
|
|
212 |
dismissLink.className = closeClass;
|
213 |
dismissLink.href = '#';
|
214 |
//dismissLink.style.marginLeft = '24px';
|
215 |
-
dismissLink.style.cssText = buttonStyle;
|
216 |
return dismissLink;
|
217 |
}
|
218 |
|
219 |
function _createInformationLink(linkText, linkHref) {
|
220 |
-
var buttonStyle='color: '+ btcB +';padding: 3px 7px;font-size: 14px;line-height: 14px;text-decoration: none;text-transform: uppercase;margin-right: 20px;margin-bottom:2px;letter-spacing: 0.115em;' +
|
221 |
-
'display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid '+ btcB +';background: rgba(255, 255, 255, 0.03);';
|
222 |
|
223 |
var infoLink = document.createElement('a');
|
224 |
_setElementText(infoLink, linkText);
|
225 |
infoLink.className = infoClass;
|
226 |
infoLink.href = linkHref;
|
|
|
227 |
if (tar) infoLink.target = '_blank';
|
228 |
-
infoLink.style.cssText = buttonStyle;
|
229 |
return infoLink;
|
230 |
}
|
231 |
|
232 |
function _dismissLinkClick() {
|
233 |
if (_shouldDisplayConsent()) {
|
234 |
-
if ( htmlM )
|
235 |
allowCookie();
|
236 |
_saveUserPreference();
|
237 |
_removeCookieConsent();
|
@@ -249,6 +258,7 @@ function appendJS(script){
|
|
249 |
var fragment = document.createDocumentFragment();
|
250 |
fragment.appendChild(consentElement);
|
251 |
document.body.appendChild(fragment.cloneNode(true));
|
|
|
252 |
document.getElementById(dismissLinkId).onclick = _dismissLinkClick;
|
253 |
// document.onclick = _dismissLinkClick;
|
254 |
if (scroll) document.onscroll = _dismissLinkClick;
|
53 |
|
54 |
var str = x[i].innerHTML;
|
55 |
// var res = str.replace(/<!--(.*?)-->/g, "$1");
|
56 |
+
// Prendo l\'array creato e all\'accettazione ogni valore e' messo al suo posto
|
57 |
res = str.replace(/<cookie>/g, jsArr[i]);
|
58 |
x[i].innerHTML = res;
|
59 |
}
|
108 |
var cookieName = coNA;
|
109 |
var cookieConsentId = 'cookieChoiceInfo';
|
110 |
var dismissLinkId = 'cookieChoiceDismiss';
|
111 |
+
var htmlMarginOld = document.getElementsByTagName("html")[0].style.marginTop;
|
112 |
|
113 |
+
function ICC_outerHeight(el) {
|
114 |
+
var height = el.offsetHeight;
|
115 |
+
var style = getComputedStyle(el);
|
116 |
|
117 |
+
height += parseInt(style.marginTop) + parseInt(style.marginBottom);
|
118 |
+
return height;
|
119 |
+
}
|
120 |
|
121 |
+
function _createHeaderElement(cookieText, dismissText, linkText, linkHref) {
|
122 |
+
|
123 |
+
// var butterBarStyles = 'color:'+ btcB +';position:' + elPos + ';width:100%;background-color:' + bgB + ';' + 'margin:0; left:0;'+bPos+';padding:4px;z-index:9999;text-align:left;';
|
124 |
|
125 |
+
// Aggiungo contenitore esterno per migliorare il layout
|
126 |
var contenitore = document.createElement('div');
|
127 |
+
// var contenutoContenitoreStyle = 'max-width:980px;margin-right:auto;margin-left:auto;padding:15px;';
|
128 |
contenitore.id = cookieConsentId;
|
129 |
+
contenitore.className = container;
|
130 |
+
// contenitore.style.cssText = butterBarStyles;
|
131 |
|
132 |
var cookieConsentElement = document.createElement('div');
|
133 |
//cookieConsentElement.id = cookieConsentId;
|
134 |
+
cookieConsentElement.className = contentStyle;
|
135 |
+
// cookieConsentElement.style.cssText = contenutoContenitoreStyle;
|
136 |
cookieConsentElement.appendChild(_createConsentText(cookieText));
|
137 |
+
cookieConsentElement.appendChild(_createSpace());
|
138 |
|
139 |
if (!!linkText && !!linkHref) {
|
140 |
cookieConsentElement.appendChild(_createInformationLink(linkText, linkHref));
|
149 |
}
|
150 |
|
151 |
function _createDialogElement(cookieText, dismissText, linkText, linkHref) {
|
152 |
+
// var glassStyle = 'position:fixed;width:100%;height:100%;z-index:999;' +
|
153 |
+
// 'top:0;left:0;opacity:0.5;filter:alpha(opacity=50);' +
|
154 |
+
// 'background-color:#ccc;';
|
155 |
+
// var dialogStyle = 'z-index:9999;position:fixed;top:25%;';
|
156 |
+
// var contentStyle = 'position:relative;' +
|
157 |
+
// 'background-color:' + bgB + ';padding:20px;box-shadow:4px 4px 25px #888;max-width:80%;margin:0 auto;';
|
158 |
|
159 |
var cookieConsentElement = document.createElement('div');
|
160 |
cookieConsentElement.id = cookieConsentId;
|
161 |
|
162 |
var glassPanel = document.createElement('div');
|
163 |
+
// glassPanel.style.cssText = glassStyle;
|
164 |
+
glassPanel.className = 'glassStyle';
|
165 |
|
166 |
var content = document.createElement('div');
|
167 |
+
// content.style.cssText = contentStyle;
|
168 |
+
content.className = 'contentStyle';
|
169 |
+
|
|
|
|
|
170 |
var dialog = document.createElement('div');
|
171 |
+
// dialog.style.cssText = dialogStyle;
|
172 |
+
dialog.className = 'dialogStyle';
|
173 |
|
174 |
var dismissLink = _createDismissLink(dismissText);
|
175 |
+
// dismissLink.style.display = 'block';
|
176 |
+
// dismissLink.style.textAlign = 'right';
|
177 |
+
// dismissLink.style.marginTop = '8px';
|
178 |
|
179 |
content.appendChild(_createConsentText(cookieText));
|
180 |
|
200 |
|
201 |
function _createSpace(){
|
202 |
var hrStyle='clear:both;border-color:transparent;margin-top:5px;margin-bottom:5px';
|
203 |
+
var hr = document.createElement("hr");
|
204 |
+
hr.style.cssText = hrStyle;
|
205 |
+
return hr;
|
206 |
}
|
207 |
|
208 |
function _createConsentText(cookieText) {
|
212 |
}
|
213 |
|
214 |
function _createDismissLink(dismissText) {
|
215 |
+
// var buttonStyle='color: '+ btcB +';padding: 3px 7px;font-size: 14px;line-height: 14px;text-decoration: none;text-transform: uppercase;margin:0;margin-bottom:2px;letter-spacing: 0.115em;display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid '+ btcB +';background: rgba(255, 255, 255, 0.03);';
|
216 |
|
217 |
var dismissLink = document.createElement('a');
|
218 |
_setElementText(dismissLink, dismissText);
|
220 |
dismissLink.className = closeClass;
|
221 |
dismissLink.href = '#';
|
222 |
//dismissLink.style.marginLeft = '24px';
|
223 |
+
// dismissLink.style.cssText = buttonStyle;
|
224 |
return dismissLink;
|
225 |
}
|
226 |
|
227 |
function _createInformationLink(linkText, linkHref) {
|
228 |
+
// var buttonStyle='color: '+ btcB +';padding: 3px 7px;font-size: 14px;line-height: 14px;text-decoration: none;text-transform: uppercase;margin-right: 20px;margin-bottom:2px;letter-spacing: 0.115em;' +
|
229 |
+
// 'display: inline-block;font-weight: normal; text-align: center; vertical-align: middle; cursor: pointer; border: 1px solid '+ btcB +';background: rgba(255, 255, 255, 0.03);';
|
230 |
|
231 |
var infoLink = document.createElement('a');
|
232 |
_setElementText(infoLink, linkText);
|
233 |
infoLink.className = infoClass;
|
234 |
infoLink.href = linkHref;
|
235 |
+
// infoLink.style.marginLeft = '8px';
|
236 |
if (tar) infoLink.target = '_blank';
|
237 |
+
// infoLink.style.cssText = buttonStyle;
|
238 |
return infoLink;
|
239 |
}
|
240 |
|
241 |
function _dismissLinkClick() {
|
242 |
if (_shouldDisplayConsent()) {
|
243 |
+
if ( htmlM ) document.getElementsByTagName("html")[0].style.marginTop = htmlMarginOld;
|
244 |
allowCookie();
|
245 |
_saveUserPreference();
|
246 |
_removeCookieConsent();
|
258 |
var fragment = document.createDocumentFragment();
|
259 |
fragment.appendChild(consentElement);
|
260 |
document.body.appendChild(fragment.cloneNode(true));
|
261 |
+
if( htmlM ) document.getElementsByTagName("html")[0].style.marginTop = ICC_outerHeight(document.getElementById("cookieChoiceInfo"))+'px';
|
262 |
document.getElementById(dismissLinkId).onclick = _dismissLinkClick;
|
263 |
// document.onclick = _dismissLinkClick;
|
264 |
if (scroll) document.onscroll = _dismissLinkClick;
|
js/smallbutton/cookiechoices.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
function allowCookie(){var a,b=document.getElementsByClassName("el"),c=new RegExp("<script.*?");for(a=0;a<b.length;a++){b[a].removeChild(b[a].childNodes[0]);var d=c.test(jsArr[a]);if(d){var e=/<script.*?src="(.*?)"/,f=e.test(jsArr[a]);f&&(f=e.exec(jsArr[a]),loadJS(f[1]));var g=/<script\b[^>]*>([\s\S]*?)<\/script>/gm,h=g.exec(jsArr[a]);h[1]&&appendJS(h[1])}else{var i=b[a].innerHTML;d=i.replace(/<cookie>/g,jsArr[a]),b[a].innerHTML=d}}}function loadJS(a){var b=document.createElement("script");b.type="application/javascript",b.src=a,document.body.appendChild(b)}function appendJS(a){var b=document.createElement("script");b.type="text/javascript";var c=a;try{b.appendChild(document.createTextNode(c)),document.body.appendChild(b)}catch(d){b.text=c,document.body.appendChild(b)}}!function(a){if(a.cookieChoices)return a.cookieChoices;var b=a.document,c=b.documentElement,
|
1 |
+
function allowCookie(){var a,b=document.getElementsByClassName("el"),c=new RegExp("<script.*?");for(a=0;a<b.length;a++){b[a].removeChild(b[a].childNodes[0]);var d=c.test(jsArr[a]);if(d){var e=/<script.*?src="(.*?)"/,f=e.test(jsArr[a]);f&&(f=e.exec(jsArr[a]),loadJS(f[1]));var g=/<script\b[^>]*>([\s\S]*?)<\/script>/gm,h=g.exec(jsArr[a]);h[1]&&appendJS(h[1])}else{var i=b[a].innerHTML;d=i.replace(/<cookie>/g,jsArr[a]),b[a].innerHTML=d}}}function loadJS(a){var b=document.createElement("script");b.type="application/javascript",b.src=a,document.body.appendChild(b)}function appendJS(a){var b=document.createElement("script");b.type="text/javascript";var c=a;try{b.appendChild(document.createTextNode(c)),document.body.appendChild(b)}catch(d){b.text=c,document.body.appendChild(b)}}!function(a){if(a.cookieChoices)return a.cookieChoices;var b=a.document,c=(b.documentElement,"textContent"in b.body),d=function(){function a(a){var b=a.offsetHeight,c=getComputedStyle(a);return b+=parseInt(c.marginTop)+parseInt(c.marginBottom)}function d(a,c,d,e){var f=b.createElement("div");f.id=t,f.className=container;var k=b.createElement("div");return k.className=contentStyle,k.appendChild(h(a)),k.appendChild(g()),d&&e&&k.appendChild(j(d,e)),k.appendChild(i(c)),f.appendChild(k),f}function e(a,c,d,e){var f=b.createElement("div");f.id=t;var k=b.createElement("div");k.className="glassStyle";var l=b.createElement("div");l.className="contentStyle";var m=b.createElement("div");m.className="dialogStyle";var n=i(c);return l.appendChild(h(a)),l.appendChild(g()),d&&e&&l.appendChild(j(d,e)),l.appendChild(n),m.appendChild(l),f.appendChild(k),f.appendChild(m),f}function f(a,b){c?a.textContent=b:a.innerText=b}function g(){var a="clear:both;border-color:transparent;margin-top:5px;margin-bottom:5px",c=b.createElement("hr");return c.style.cssText=a,c}function h(a){var c=b.createElement("span");return f(c,a),c}function i(a){var c=b.createElement("a");return f(c,a),c.id=u,c.className=closeClass,c.href="#",c}function j(a,c){var d=b.createElement("a");return f(d,a),d.className=infoClass,d.href=c,tar&&(d.target="_blank"),d}function k(){return r()&&(htmlM&&(b.getElementsByTagName("html")[0].style.marginTop=v),allowCookie(),q(),o()),rel&&b.location.reload(),!1}function l(c,f,g,h,i){if(r()){var j=i?e(c,f,g,h):d(c,f,g,h),l=b.createDocumentFragment();l.appendChild(j),b.body.appendChild(l.cloneNode(!0)),htmlM&&(b.getElementsByTagName("html")[0].style.marginTop=a(b.getElementById("cookieChoiceInfo"))+"px"),b.getElementById(u).onclick=k,scroll&&(b.onscroll=k)}}function m(a,b,c,d){l(a,b,c,d,!1)}function n(a,b,c,d){l(a,b,c,d,!0)}function o(){var a=b.getElementById(t);null!==a&&a.parentNode.removeChild(a)}function p(){k()}function q(){var a=new Date;a.setFullYear(a.getFullYear()+1),b.cookie=s+"="+coVA+"; expires="+a.toGMTString()+";path=/"}function r(){return!b.cookie.match(new RegExp(s+"=([^;]+)"))}var s=coNA,t="cookieChoiceInfo",u="cookieChoiceDismiss",v=b.getElementsByTagName("html")[0].style.marginTop,w={};return w.showCookieConsentBar=m,w.showCookieConsentDialog=n,w.removeCookieConsent=p,w}();return a.cookieChoices=d,d}(this);
|
js/smallbutton/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Italy Cookie Choices
|
lang/index.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php // Italy Cookie Choices
|
lang/italy-cookie-choices-it_IT.mo
CHANGED
Binary file
|
lang/italy-cookie-choices-it_IT.po
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: italy-cookie-choices\n"
|
4 |
-
"POT-Creation-Date: 2015-06-
|
5 |
-
"PO-Revision-Date: 2015-06-
|
6 |
"Last-Translator: Enea Overclokk <info@overclokk.net>\n"
|
7 |
"Language-Team: info@overclokk.net\n"
|
8 |
"Language: it_IT\n"
|
@@ -18,216 +18,305 @@ msgstr ""
|
|
18 |
"X-Poedit-SearchPathExcluded-0: node_modules\n"
|
19 |
"X-Poedit-SearchPathExcluded-1: .git\n"
|
20 |
|
21 |
-
#: italy-cookie-choices.php:
|
22 |
msgid "Italy Cookie Choices Dashboard"
|
23 |
msgstr "Pannello di Italy Cookie Choices"
|
24 |
|
25 |
-
#: italy-cookie-choices.php:
|
26 |
msgid "You do not have sufficient permissions to access this page."
|
27 |
msgstr "Non hai abbastanza permessi per visualizzare questa pagina."
|
28 |
|
29 |
-
#: italy-cookie-choices.php:
|
30 |
msgid "Italy Cookie Choices options page"
|
31 |
msgstr "Pagina opzioni per Italy Cookie Choices"
|
32 |
|
33 |
-
#: italy-cookie-choices.php:
|
34 |
msgid "Activate"
|
35 |
msgstr "Attiva"
|
36 |
|
37 |
-
#: italy-cookie-choices.php:
|
38 |
msgid "Where display the banner"
|
39 |
msgstr "Dove mostrare il banner"
|
40 |
|
41 |
-
#: italy-cookie-choices.php:
|
42 |
msgid "Mouse scroll event"
|
43 |
msgstr "Evento scroll del mouse"
|
44 |
|
45 |
-
#: italy-cookie-choices.php:
|
46 |
msgid "Accept on second view"
|
47 |
msgstr "Accettazione continuando la navigazione"
|
48 |
|
49 |
-
#: italy-cookie-choices.php:
|
50 |
msgid "Refresh page"
|
51 |
msgstr "Aggiorna la pagina"
|
52 |
|
53 |
-
#: italy-cookie-choices.php:
|
54 |
msgid "Text to display"
|
55 |
msgstr "Testo da mostrare"
|
56 |
|
57 |
-
#: italy-cookie-choices.php:
|
58 |
msgid "URL for cookie policy"
|
59 |
msgstr "URL per la cookie policy"
|
60 |
|
61 |
-
#: italy-cookie-choices.php:
|
62 |
msgid "Anchor text for URL"
|
63 |
msgstr "Anchor text per la URL"
|
64 |
|
65 |
-
#: italy-cookie-choices.php:
|
66 |
msgid "Button text"
|
67 |
msgstr "Testo per il bottone"
|
68 |
|
69 |
-
#: italy-cookie-choices.php:
|
70 |
msgid "Style settings"
|
71 |
msgstr "Impostazioni per lo stile"
|
72 |
|
73 |
-
#: italy-cookie-choices.php:
|
74 |
msgid "CookieChoices Template"
|
75 |
msgstr "CookieChoices Template"
|
76 |
|
77 |
-
#: italy-cookie-choices.php:
|
78 |
msgid "HTML top margin"
|
79 |
msgstr "Margine alto per HTML"
|
80 |
|
81 |
-
#: italy-cookie-choices.php:
|
82 |
msgid "Banner Background color"
|
83 |
msgstr "Colore di sfondo per il banner"
|
84 |
|
85 |
-
#: italy-cookie-choices.php:
|
86 |
msgid "Banner text color"
|
87 |
msgstr "Colore per il testo del banner"
|
88 |
|
89 |
-
#: italy-cookie-choices.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
msgid "Advanced settings"
|
91 |
msgstr "Opzioni avanzate"
|
92 |
|
93 |
-
#: italy-cookie-choices.php:
|
94 |
msgid "Cookie name"
|
95 |
msgstr "Nome del Cookie"
|
96 |
|
97 |
-
#: italy-cookie-choices.php:
|
98 |
msgid "Cookie value"
|
99 |
msgstr "Valore del Cookie"
|
100 |
|
101 |
-
#: italy-cookie-choices.php:
|
102 |
msgid "Cookie policy page slug"
|
103 |
msgstr "Slug pagina Cookie policy"
|
104 |
|
105 |
-
#: italy-cookie-choices.php:
|
106 |
msgid "Open policy in new page"
|
107 |
msgstr "Apri in una nuova pagina"
|
108 |
|
109 |
-
#: italy-cookie-choices.php:
|
110 |
msgid "Third part cookie block (beta)"
|
111 |
msgstr "Blocco dei cookie di terze parti (Beta)"
|
112 |
|
113 |
-
#: italy-cookie-choices.php:
|
114 |
-
msgid "
|
115 |
-
msgstr "Script
|
|
|
|
|
|
|
|
|
116 |
|
117 |
-
#: italy-cookie-choices.php:
|
118 |
msgid "Text message for locked embedded content"
|
119 |
msgstr "Testo per gli embed bloccati"
|
120 |
|
121 |
-
#: italy-cookie-choices.php:
|
122 |
msgid "Button text to activate locked embedded content"
|
123 |
msgstr "Testo per il bottone di accettazione degli embed bloccati"
|
124 |
|
125 |
-
#: italy-cookie-choices.php:
|
126 |
msgid "Customize your banner for cookie law"
|
127 |
msgstr "Personalizza il banner per la Cookie Law"
|
128 |
|
129 |
-
#: italy-cookie-choices.php:
|
130 |
msgid "Display banner for Cookie Law in front-end"
|
131 |
msgstr ""
|
132 |
"Visualizza il banner sul tuo sito web, se non attivi non viene mostrato "
|
133 |
"nulla."
|
134 |
|
135 |
-
#: italy-cookie-choices.php:
|
136 |
msgid "Top Bar (Default, Display a top bar with your message)"
|
137 |
msgstr "Top Bar (Default, Visualizza una top bar con il tuo messaggio)"
|
138 |
|
139 |
-
#: italy-cookie-choices.php:
|
140 |
msgid "Dialog (Display an overlay with your message)"
|
141 |
msgstr "Dialog (Visualizza un popup con il tuo messaggio)"
|
142 |
|
143 |
-
#: italy-cookie-choices.php:
|
144 |
msgid "Bottom Bar (Display a bar in the footer with your message)"
|
145 |
msgstr "Bottom Bar (Visualizza una barra nel footer con il tuo messaggio)"
|
146 |
|
147 |
-
#: italy-cookie-choices.php:
|
148 |
msgid "Accepts disclosures on mouse scroll event"
|
149 |
msgstr "Accetta l'informativa sull'evento scroll del mouse"
|
150 |
|
151 |
-
#: italy-cookie-choices.php:
|
152 |
msgid "Activate accept on second view"
|
153 |
-
msgstr "Attiva l'
|
154 |
|
155 |
-
#: italy-cookie-choices.php:
|
156 |
msgid "Refresh page after button click (DEPRECATED)"
|
157 |
msgstr "Aggiorna la pagina dopo l'accettazione (DEPRECATA)"
|
158 |
|
159 |
-
#: italy-cookie-choices.php:
|
160 |
msgid "Your short cookie policy"
|
161 |
msgstr "La tua informativa breve"
|
162 |
|
163 |
-
#: italy-cookie-choices
|
|
|
164 |
msgid ""
|
165 |
"People will see this notice only the first time that they enter your site"
|
166 |
msgstr ""
|
167 |
"Le persone visualizzeranno il messaggio la prima volta che visiteranno il "
|
168 |
"tuo sito"
|
169 |
|
170 |
-
#: italy-cookie-choices.php:
|
171 |
msgid "e.g. http://www.aboutcookies.org/"
|
172 |
msgstr "es: http://www.aboutcookies.org/"
|
173 |
|
174 |
-
#: italy-cookie-choices.php:
|
175 |
msgid "Insert here the link to your policy page"
|
176 |
msgstr "Inserisci il link alla tua pagina con l'informativa estesa"
|
177 |
|
178 |
-
#: italy-cookie-choices.php:
|
179 |
msgid "e.g. More Info"
|
180 |
msgstr "es: Maggiori informazioni"
|
181 |
|
182 |
-
#: italy-cookie-choices.php:
|
183 |
msgid "Insert here anchor text for the link"
|
184 |
msgstr "Inserisci qui l'anchor text per il link"
|
185 |
|
186 |
-
#: italy-cookie-choices
|
|
|
187 |
msgid "e.g. Close"
|
188 |
msgstr "es: Chiudi"
|
189 |
|
190 |
-
#: italy-cookie-choices
|
|
|
191 |
msgid "Insert here name of button (e.g. \"Close\") "
|
192 |
msgstr "Inserisci il testo del link per chiudere il popup/banner (es: Chiudi)"
|
193 |
|
194 |
-
#: italy-cookie-choices.php:
|
195 |
msgid "Customize your style settings"
|
196 |
msgstr "Personalizza le impostazioni per lo stile"
|
197 |
|
198 |
-
#: italy-cookie-choices.php:
|
199 |
msgid "Add a page top margin for info top bar, only for default topbar stile"
|
200 |
msgstr "Aggiungi un margine in cima alla pagina, solo per la topbar di default"
|
201 |
|
202 |
-
#: italy-cookie-choices.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
203 |
msgid "Select the template to use"
|
204 |
msgstr "Seleziona il template che vuoi usare"
|
205 |
|
206 |
-
#: italy-cookie-choices.php:
|
207 |
msgid "Custom Background color for banner"
|
208 |
msgstr "Colore di sfondo per il banner"
|
209 |
|
210 |
-
#: italy-cookie-choices.php:
|
211 |
msgid "Custom text color for banner"
|
212 |
msgstr "Colore del testo per il banner"
|
213 |
|
214 |
-
#: italy-cookie-choices.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
msgid "Customize your advanced settings"
|
216 |
msgstr "Personalizza le impostazioni avanzate"
|
217 |
|
218 |
-
#: italy-cookie-choices.php:
|
219 |
msgid "Insert your cookie name (Default: displayCookieConsent)"
|
220 |
msgstr "Inserisci il nome del tuo Cookie (Default: displayCookieConsent)"
|
221 |
|
222 |
-
#: italy-cookie-choices.php:
|
223 |
msgid "Insert your cookie value (Default: y)"
|
224 |
msgstr "Inserisci il valore del tuo Cookie (Default: y)"
|
225 |
|
226 |
-
#: italy-cookie-choices.php:
|
227 |
msgid "e.g. your-policy-url.html"
|
228 |
msgstr "es: la-tua-pagina-per-la-cookie-policy"
|
229 |
|
230 |
-
#: italy-cookie-choices.php:
|
231 |
msgid ""
|
232 |
"Insert your cookie policy page slug (e.g. your-policy-url), it will display "
|
233 |
"only topbar in your cookie policy page"
|
@@ -235,24 +324,25 @@ msgstr ""
|
|
235 |
"Inserisci lo slug della tua pagina per la Cookie policy, in questa pagina "
|
236 |
"verrà mostrata soltanto la topbar"
|
237 |
|
238 |
-
#: italy-cookie-choices.php:
|
239 |
msgid "Open your cookie policy page in new one"
|
240 |
msgstr "Apri la tua pagina per la Cookie policy in una nuova"
|
241 |
|
242 |
-
#: italy-cookie-choices.php:
|
243 |
msgid "Cookie from any embed in your content (Beta) (DEPRECATED)"
|
244 |
msgstr "Cookie da tutti gli embed nel tuo contenuto (Beta) (DEPRECATA)"
|
245 |
|
246 |
-
#: italy-cookie-choices.php:
|
247 |
msgid "Cookie from any embed in your widget area (Beta) (DEPRECATED)"
|
248 |
msgstr "Cookie da tutti gli embed nei tuoi widget (Beta) (DEPRECATA)"
|
249 |
|
250 |
-
#: italy-cookie-choices.php:
|
251 |
msgid "Cookie from any embed in all body, except head and footer (Beta)"
|
252 |
msgstr ""
|
253 |
"Cookie da tutti gli embed nella tua pagina, eccetto head e footer (Beta)"
|
254 |
|
255 |
-
#: italy-cookie-choices.php:
|
|
|
256 |
msgid ""
|
257 |
"<script src="http://domain.com/widget-example.js"></"
|
258 |
"script>\n"
|
@@ -272,34 +362,62 @@ msgstr ""
|
|
272 |
"<script src="http://lastdomain.com/gadget-example.js"></"
|
273 |
"script>"
|
274 |
|
275 |
-
#: italy-cookie-choices.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
msgid ""
|
277 |
"Scripts shown in the head and in the footer does not automatically blocked."
|
278 |
"<br />Split each script with <strong><em><---------SEP---------></em></"
|
279 |
"strong>"
|
280 |
msgstr ""
|
281 |
-
"Script inseriti nella head e nel footer non
|
282 |
">Split each script with <strong><em><---------SEP---------></em></"
|
283 |
"strong>"
|
284 |
|
285 |
-
#: italy-cookie-choices.php:
|
286 |
msgid "Your lock message for embedded contents inside posts, pages and widgets"
|
287 |
msgstr ""
|
288 |
"Il tuo messaggio da visualizzare nel box per i contenuti bloccati "
|
289 |
"incorporati all'interno di pagine, articoli e widget"
|
290 |
|
291 |
-
#: italy-cookie-choices.php:
|
|
|
292 |
msgid "Cookie name field it can't be empty. Restored default name."
|
293 |
msgstr ""
|
294 |
"Il campo del nome del Cookie non può essere vuoto. Ripristinato il nome di "
|
295 |
"default."
|
296 |
|
297 |
-
#: italy-cookie-choices.php:
|
|
|
298 |
msgid "Cookie value field it can't be empty. Restored default value."
|
299 |
msgstr ""
|
300 |
"Il campo del valore del Cookie non può essere vuoto. Ripristinato il valore "
|
301 |
"di default."
|
302 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
#~ msgid "Top Bar (Default, Display a top bar wth your message)"
|
304 |
#~ msgstr "Top Bar (Default, verrà visualizzata una barra in cima alla pagina)"
|
305 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: italy-cookie-choices\n"
|
4 |
+
"POT-Creation-Date: 2015-06-24 16:53+0100\n"
|
5 |
+
"PO-Revision-Date: 2015-06-24 17:04+0100\n"
|
6 |
"Last-Translator: Enea Overclokk <info@overclokk.net>\n"
|
7 |
"Language-Team: info@overclokk.net\n"
|
8 |
"Language: it_IT\n"
|
18 |
"X-Poedit-SearchPathExcluded-0: node_modules\n"
|
19 |
"X-Poedit-SearchPathExcluded-1: .git\n"
|
20 |
|
21 |
+
#: admin/class-italy-cookie-choices-admin.php:74
|
22 |
msgid "Italy Cookie Choices Dashboard"
|
23 |
msgstr "Pannello di Italy Cookie Choices"
|
24 |
|
25 |
+
#: admin/class-italy-cookie-choices-admin.php:88
|
26 |
msgid "You do not have sufficient permissions to access this page."
|
27 |
msgstr "Non hai abbastanza permessi per visualizzare questa pagina."
|
28 |
|
29 |
+
#: admin/class-italy-cookie-choices-admin.php:149
|
30 |
msgid "Italy Cookie Choices options page"
|
31 |
msgstr "Pagina opzioni per Italy Cookie Choices"
|
32 |
|
33 |
+
#: admin/class-italy-cookie-choices-admin.php:159
|
34 |
msgid "Activate"
|
35 |
msgstr "Attiva"
|
36 |
|
37 |
+
#: admin/class-italy-cookie-choices-admin.php:171
|
38 |
msgid "Where display the banner"
|
39 |
msgstr "Dove mostrare il banner"
|
40 |
|
41 |
+
#: admin/class-italy-cookie-choices-admin.php:182
|
42 |
msgid "Mouse scroll event"
|
43 |
msgstr "Evento scroll del mouse"
|
44 |
|
45 |
+
#: admin/class-italy-cookie-choices-admin.php:193
|
46 |
msgid "Accept on second view"
|
47 |
msgstr "Accettazione continuando la navigazione"
|
48 |
|
49 |
+
#: admin/class-italy-cookie-choices-admin.php:204
|
50 |
msgid "Refresh page"
|
51 |
msgstr "Aggiorna la pagina"
|
52 |
|
53 |
+
#: admin/class-italy-cookie-choices-admin.php:215
|
54 |
msgid "Text to display"
|
55 |
msgstr "Testo da mostrare"
|
56 |
|
57 |
+
#: admin/class-italy-cookie-choices-admin.php:226
|
58 |
msgid "URL for cookie policy"
|
59 |
msgstr "URL per la cookie policy"
|
60 |
|
61 |
+
#: admin/class-italy-cookie-choices-admin.php:237
|
62 |
msgid "Anchor text for URL"
|
63 |
msgstr "Anchor text per la URL"
|
64 |
|
65 |
+
#: admin/class-italy-cookie-choices-admin.php:248
|
66 |
msgid "Button text"
|
67 |
msgstr "Testo per il bottone"
|
68 |
|
69 |
+
#: admin/class-italy-cookie-choices-admin.php:259
|
70 |
msgid "Style settings"
|
71 |
msgstr "Impostazioni per lo stile"
|
72 |
|
73 |
+
#: admin/class-italy-cookie-choices-admin.php:269
|
74 |
msgid "CookieChoices Template"
|
75 |
msgstr "CookieChoices Template"
|
76 |
|
77 |
+
#: admin/class-italy-cookie-choices-admin.php:280
|
78 |
msgid "HTML top margin"
|
79 |
msgstr "Margine alto per HTML"
|
80 |
|
81 |
+
#: admin/class-italy-cookie-choices-admin.php:291
|
82 |
msgid "Banner Background color"
|
83 |
msgstr "Colore di sfondo per il banner"
|
84 |
|
85 |
+
#: admin/class-italy-cookie-choices-admin.php:302
|
86 |
msgid "Banner text color"
|
87 |
msgstr "Colore per il testo del banner"
|
88 |
|
89 |
+
#: admin/class-italy-cookie-choices-admin.php:313
|
90 |
+
msgid "Custom CSS"
|
91 |
+
msgstr "CSS personalizzato"
|
92 |
+
|
93 |
+
#: admin/class-italy-cookie-choices-admin.php:324
|
94 |
+
msgid "Custom CSS Class (Optional)"
|
95 |
+
msgstr "Classi CSS personalizzate (Opzionali)"
|
96 |
+
|
97 |
+
#: admin/class-italy-cookie-choices-admin.php:335
|
98 |
msgid "Advanced settings"
|
99 |
msgstr "Opzioni avanzate"
|
100 |
|
101 |
+
#: admin/class-italy-cookie-choices-admin.php:345
|
102 |
msgid "Cookie name"
|
103 |
msgstr "Nome del Cookie"
|
104 |
|
105 |
+
#: admin/class-italy-cookie-choices-admin.php:356
|
106 |
msgid "Cookie value"
|
107 |
msgstr "Valore del Cookie"
|
108 |
|
109 |
+
#: admin/class-italy-cookie-choices-admin.php:367
|
110 |
msgid "Cookie policy page slug"
|
111 |
msgstr "Slug pagina Cookie policy"
|
112 |
|
113 |
+
#: admin/class-italy-cookie-choices-admin.php:378
|
114 |
msgid "Open policy in new page"
|
115 |
msgstr "Apri in una nuova pagina"
|
116 |
|
117 |
+
#: admin/class-italy-cookie-choices-admin.php:389
|
118 |
msgid "Third part cookie block (beta)"
|
119 |
msgstr "Blocco dei cookie di terze parti (Beta)"
|
120 |
|
121 |
+
#: admin/class-italy-cookie-choices-admin.php:400
|
122 |
+
msgid "Scripts allowed in body"
|
123 |
+
msgstr "Script da non bloccare"
|
124 |
+
|
125 |
+
#: admin/class-italy-cookie-choices-admin.php:411
|
126 |
+
msgid "Scripts to be blocked"
|
127 |
+
msgstr "Script da bloccare"
|
128 |
|
129 |
+
#: admin/class-italy-cookie-choices-admin.php:422
|
130 |
msgid "Text message for locked embedded content"
|
131 |
msgstr "Testo per gli embed bloccati"
|
132 |
|
133 |
+
#: admin/class-italy-cookie-choices-admin.php:433
|
134 |
msgid "Button text to activate locked embedded content"
|
135 |
msgstr "Testo per il bottone di accettazione degli embed bloccati"
|
136 |
|
137 |
+
#: admin/class-italy-cookie-choices-admin.php:458
|
138 |
msgid "Customize your banner for cookie law"
|
139 |
msgstr "Personalizza il banner per la Cookie Law"
|
140 |
|
141 |
+
#: admin/class-italy-cookie-choices-admin.php:473
|
142 |
msgid "Display banner for Cookie Law in front-end"
|
143 |
msgstr ""
|
144 |
"Visualizza il banner sul tuo sito web, se non attivi non viene mostrato "
|
145 |
"nulla."
|
146 |
|
147 |
+
#: admin/class-italy-cookie-choices-admin.php:493
|
148 |
msgid "Top Bar (Default, Display a top bar with your message)"
|
149 |
msgstr "Top Bar (Default, Visualizza una top bar con il tuo messaggio)"
|
150 |
|
151 |
+
#: admin/class-italy-cookie-choices-admin.php:501
|
152 |
msgid "Dialog (Display an overlay with your message)"
|
153 |
msgstr "Dialog (Visualizza un popup con il tuo messaggio)"
|
154 |
|
155 |
+
#: admin/class-italy-cookie-choices-admin.php:509
|
156 |
msgid "Bottom Bar (Display a bar in the footer with your message)"
|
157 |
msgstr "Bottom Bar (Visualizza una barra nel footer con il tuo messaggio)"
|
158 |
|
159 |
+
#: admin/class-italy-cookie-choices-admin.php:529
|
160 |
msgid "Accepts disclosures on mouse scroll event"
|
161 |
msgstr "Accetta l'informativa sull'evento scroll del mouse"
|
162 |
|
163 |
+
#: admin/class-italy-cookie-choices-admin.php:549
|
164 |
msgid "Activate accept on second view"
|
165 |
+
msgstr "Attiva l'accettazione se l'utente continua la navigazione"
|
166 |
|
167 |
+
#: admin/class-italy-cookie-choices-admin.php:567
|
168 |
msgid "Refresh page after button click (DEPRECATED)"
|
169 |
msgstr "Aggiorna la pagina dopo l'accettazione (DEPRECATA)"
|
170 |
|
171 |
+
#: admin/class-italy-cookie-choices-admin.php:582
|
172 |
msgid "Your short cookie policy"
|
173 |
msgstr "La tua informativa breve"
|
174 |
|
175 |
+
#: admin/class-italy-cookie-choices-admin.php:585
|
176 |
+
#: admin/class-italy-cookie-choices-admin.php:989
|
177 |
msgid ""
|
178 |
"People will see this notice only the first time that they enter your site"
|
179 |
msgstr ""
|
180 |
"Le persone visualizzeranno il messaggio la prima volta che visiteranno il "
|
181 |
"tuo sito"
|
182 |
|
183 |
+
#: admin/class-italy-cookie-choices-admin.php:599
|
184 |
msgid "e.g. http://www.aboutcookies.org/"
|
185 |
msgstr "es: http://www.aboutcookies.org/"
|
186 |
|
187 |
+
#: admin/class-italy-cookie-choices-admin.php:602
|
188 |
msgid "Insert here the link to your policy page"
|
189 |
msgstr "Inserisci il link alla tua pagina con l'informativa estesa"
|
190 |
|
191 |
+
#: admin/class-italy-cookie-choices-admin.php:616
|
192 |
msgid "e.g. More Info"
|
193 |
msgstr "es: Maggiori informazioni"
|
194 |
|
195 |
+
#: admin/class-italy-cookie-choices-admin.php:619
|
196 |
msgid "Insert here anchor text for the link"
|
197 |
msgstr "Inserisci qui l'anchor text per il link"
|
198 |
|
199 |
+
#: admin/class-italy-cookie-choices-admin.php:633
|
200 |
+
#: admin/class-italy-cookie-choices-admin.php:1005
|
201 |
msgid "e.g. Close"
|
202 |
msgstr "es: Chiudi"
|
203 |
|
204 |
+
#: admin/class-italy-cookie-choices-admin.php:636
|
205 |
+
#: admin/class-italy-cookie-choices-admin.php:1008
|
206 |
msgid "Insert here name of button (e.g. \"Close\") "
|
207 |
msgstr "Inserisci il testo del link per chiudere il popup/banner (es: Chiudi)"
|
208 |
|
209 |
+
#: admin/class-italy-cookie-choices-admin.php:653
|
210 |
msgid "Customize your style settings"
|
211 |
msgstr "Personalizza le impostazioni per lo stile"
|
212 |
|
213 |
+
#: admin/class-italy-cookie-choices-admin.php:669
|
214 |
msgid "Add a page top margin for info top bar, only for default topbar stile"
|
215 |
msgstr "Aggiungi un margine in cima alla pagina, solo per la topbar di default"
|
216 |
|
217 |
+
#: admin/class-italy-cookie-choices-admin.php:687
|
218 |
+
msgid "Default cookiechoices template (centered with text links)"
|
219 |
+
msgstr "Template di default, testo centrato con link testuali."
|
220 |
+
|
221 |
+
#: admin/class-italy-cookie-choices-admin.php:689
|
222 |
+
msgid "Centered container with left aligned text and big buttons"
|
223 |
+
msgstr ""
|
224 |
+
"Template con contenitore centrato (980px), testo allineato a sinistra e "
|
225 |
+
"bottoni grandi"
|
226 |
+
|
227 |
+
#: admin/class-italy-cookie-choices-admin.php:691
|
228 |
+
msgid "Centered container with left aligned text and small buttons"
|
229 |
+
msgstr ""
|
230 |
+
"Template con contenitore centrato (980px), testo allineato a sinistra e "
|
231 |
+
"bottoni piccoli"
|
232 |
+
|
233 |
+
#: admin/class-italy-cookie-choices-admin.php:693
|
234 |
+
msgid "My custom CSS"
|
235 |
+
msgstr "Il mio css personalizzato"
|
236 |
+
|
237 |
+
#: admin/class-italy-cookie-choices-admin.php:697
|
238 |
msgid "Select the template to use"
|
239 |
msgstr "Seleziona il template che vuoi usare"
|
240 |
|
241 |
+
#: admin/class-italy-cookie-choices-admin.php:718
|
242 |
msgid "Custom Background color for banner"
|
243 |
msgstr "Colore di sfondo per il banner"
|
244 |
|
245 |
+
#: admin/class-italy-cookie-choices-admin.php:738
|
246 |
msgid "Custom text color for banner"
|
247 |
msgstr "Colore del testo per il banner"
|
248 |
|
249 |
+
#: admin/class-italy-cookie-choices-admin.php:755
|
250 |
+
msgid "Your custom css"
|
251 |
+
msgstr "Il tuo css personalizzato"
|
252 |
+
|
253 |
+
#: admin/class-italy-cookie-choices-admin.php:758
|
254 |
+
msgid "Inset here your custom CSS for banner"
|
255 |
+
msgstr "Inserisci qui il tuo CSS personalizzato per il banner"
|
256 |
+
|
257 |
+
#: admin/class-italy-cookie-choices-admin.php:783
|
258 |
+
msgid "Eg: bannerStyle"
|
259 |
+
msgstr "Es: bannerStyle"
|
260 |
+
|
261 |
+
#: admin/class-italy-cookie-choices-admin.php:785
|
262 |
+
msgid "CSS class for div container (Default <code>bannerStyle</code>)"
|
263 |
+
msgstr ""
|
264 |
+
"Classe CSS per il tag div del contenitore (Default <code>bannerStyle</code>)"
|
265 |
+
|
266 |
+
#: admin/class-italy-cookie-choices-admin.php:788
|
267 |
+
msgid "Eg: contentStyle"
|
268 |
+
msgstr "Es: contentStyle"
|
269 |
+
|
270 |
+
#: admin/class-italy-cookie-choices-admin.php:790
|
271 |
+
msgid "CSS class for div content (Default <code>contentStyle</code>)"
|
272 |
+
msgstr ""
|
273 |
+
"Classe CSS per il tag div del contenuto (Default <code>contentStyle</code>)"
|
274 |
+
|
275 |
+
#: admin/class-italy-cookie-choices-admin.php:793
|
276 |
+
msgid "Eg: consentText"
|
277 |
+
msgstr "Es: consentText"
|
278 |
+
|
279 |
+
#: admin/class-italy-cookie-choices-admin.php:795
|
280 |
+
msgid "CSS class for span content (Default <code>consentText</code>)"
|
281 |
+
msgstr "Classe CSS per il tag span (Default <code>consentText</code>)"
|
282 |
+
|
283 |
+
#: admin/class-italy-cookie-choices-admin.php:798
|
284 |
+
msgid "Eg: infoClass"
|
285 |
+
msgstr "Es: infoClass"
|
286 |
+
|
287 |
+
#: admin/class-italy-cookie-choices-admin.php:800
|
288 |
+
msgid "CSS class for Info link (Default <code>itaybtn</code>)"
|
289 |
+
msgstr "Classe CSS per il link info (Default <code>itaybtn</code>)"
|
290 |
+
|
291 |
+
#: admin/class-italy-cookie-choices-admin.php:803
|
292 |
+
msgid "Eg: closeClass"
|
293 |
+
msgstr "Es: closeClass"
|
294 |
+
|
295 |
+
#: admin/class-italy-cookie-choices-admin.php:805
|
296 |
+
msgid "CSS class for close link (Default <code>itaybtn</code>)"
|
297 |
+
msgstr "Classe CSS per il link di chiusura (Default <code>itaybtn</code>)"
|
298 |
+
|
299 |
+
#: admin/class-italy-cookie-choices-admin.php:808
|
300 |
+
msgid "Customize with your personal CSS class"
|
301 |
+
msgstr "Personalizza con le tue classi CSS"
|
302 |
+
|
303 |
+
#: admin/class-italy-cookie-choices-admin.php:824
|
304 |
msgid "Customize your advanced settings"
|
305 |
msgstr "Personalizza le impostazioni avanzate"
|
306 |
|
307 |
+
#: admin/class-italy-cookie-choices-admin.php:840
|
308 |
msgid "Insert your cookie name (Default: displayCookieConsent)"
|
309 |
msgstr "Inserisci il nome del tuo Cookie (Default: displayCookieConsent)"
|
310 |
|
311 |
+
#: admin/class-italy-cookie-choices-admin.php:859
|
312 |
msgid "Insert your cookie value (Default: y)"
|
313 |
msgstr "Inserisci il valore del tuo Cookie (Default: y)"
|
314 |
|
315 |
+
#: admin/class-italy-cookie-choices-admin.php:875
|
316 |
msgid "e.g. your-policy-url.html"
|
317 |
msgstr "es: la-tua-pagina-per-la-cookie-policy"
|
318 |
|
319 |
+
#: admin/class-italy-cookie-choices-admin.php:878
|
320 |
msgid ""
|
321 |
"Insert your cookie policy page slug (e.g. your-policy-url), it will display "
|
322 |
"only topbar in your cookie policy page"
|
324 |
"Inserisci lo slug della tua pagina per la Cookie policy, in questa pagina "
|
325 |
"verrà mostrata soltanto la topbar"
|
326 |
|
327 |
+
#: admin/class-italy-cookie-choices-admin.php:898
|
328 |
msgid "Open your cookie policy page in new one"
|
329 |
msgstr "Apri la tua pagina per la Cookie policy in una nuova"
|
330 |
|
331 |
+
#: admin/class-italy-cookie-choices-admin.php:922
|
332 |
msgid "Cookie from any embed in your content (Beta) (DEPRECATED)"
|
333 |
msgstr "Cookie da tutti gli embed nel tuo contenuto (Beta) (DEPRECATA)"
|
334 |
|
335 |
+
#: admin/class-italy-cookie-choices-admin.php:927
|
336 |
msgid "Cookie from any embed in your widget area (Beta) (DEPRECATED)"
|
337 |
msgstr "Cookie da tutti gli embed nei tuoi widget (Beta) (DEPRECATA)"
|
338 |
|
339 |
+
#: admin/class-italy-cookie-choices-admin.php:932
|
340 |
msgid "Cookie from any embed in all body, except head and footer (Beta)"
|
341 |
msgstr ""
|
342 |
"Cookie da tutti gli embed nella tua pagina, eccetto head e footer (Beta)"
|
343 |
|
344 |
+
#: admin/class-italy-cookie-choices-admin.php:949
|
345 |
+
#: admin/class-italy-cookie-choices-admin.php:967
|
346 |
msgid ""
|
347 |
"<script src="http://domain.com/widget-example.js"></"
|
348 |
"script>\n"
|
362 |
"<script src="http://lastdomain.com/gadget-example.js"></"
|
363 |
"script>"
|
364 |
|
365 |
+
#: admin/class-italy-cookie-choices-admin.php:952
|
366 |
+
msgid ""
|
367 |
+
"Scripts to be excluded from the automatic block.<br />Split each script with "
|
368 |
+
"<strong><em><---------SEP---------></em></strong>"
|
369 |
+
msgstr ""
|
370 |
+
"Scripts da non bloccare con il blocco automatico.<br />Dividi ogni script "
|
371 |
+
"con <strong><em><---------SEP---------></em></strong>"
|
372 |
+
|
373 |
+
#: admin/class-italy-cookie-choices-admin.php:970
|
374 |
msgid ""
|
375 |
"Scripts shown in the head and in the footer does not automatically blocked."
|
376 |
"<br />Split each script with <strong><em><---------SEP---------></em></"
|
377 |
"strong>"
|
378 |
msgstr ""
|
379 |
+
"Script inseriti nella head e nel footer non automaticamente bloccati.<br /"
|
380 |
">Split each script with <strong><em><---------SEP---------></em></"
|
381 |
"strong>"
|
382 |
|
383 |
+
#: admin/class-italy-cookie-choices-admin.php:986
|
384 |
msgid "Your lock message for embedded contents inside posts, pages and widgets"
|
385 |
msgstr ""
|
386 |
"Il tuo messaggio da visualizzare nel box per i contenuti bloccati "
|
387 |
"incorporati all'interno di pagine, articoli e widget"
|
388 |
|
389 |
+
#: admin/class-italy-cookie-choices-admin.php:1120
|
390 |
+
#: admin/class-italy-cookie-choices-sanitize.php:77
|
391 |
msgid "Cookie name field it can't be empty. Restored default name."
|
392 |
msgstr ""
|
393 |
"Il campo del nome del Cookie non può essere vuoto. Ripristinato il nome di "
|
394 |
"default."
|
395 |
|
396 |
+
#: admin/class-italy-cookie-choices-admin.php:1127
|
397 |
+
#: admin/class-italy-cookie-choices-sanitize.php:84
|
398 |
msgid "Cookie value field it can't be empty. Restored default value."
|
399 |
msgstr ""
|
400 |
"Il campo del valore del Cookie non può essere vuoto. Ripristinato il valore "
|
401 |
"di default."
|
402 |
|
403 |
+
#: italy-cookie-choices.php:135 italy-cookie-choices.php:145
|
404 |
+
msgid "Activation of Italy Cookie Choices in not possible"
|
405 |
+
msgstr "L'attivazione di Italy Cookie Choices non è possibile"
|
406 |
+
|
407 |
+
#: italy-cookie-choices.php:236
|
408 |
+
#, php-format
|
409 |
+
msgid ""
|
410 |
+
"Your server is running %s version %s but this plugin requires at least %s"
|
411 |
+
msgstr ""
|
412 |
+
"Il tuo server sta eseguendo %s con la versione %s ma qesto plugin richiede "
|
413 |
+
"almeno la versione %s"
|
414 |
+
|
415 |
+
#~ msgid "Banner text"
|
416 |
+
#~ msgstr "Testo del banner"
|
417 |
+
|
418 |
+
#~ msgid "Function for custom script block"
|
419 |
+
#~ msgstr "Script personalizzati"
|
420 |
+
|
421 |
#~ msgid "Top Bar (Default, Display a top bar wth your message)"
|
422 |
#~ msgstr "Top Bar (Default, verrà visualizzata una barra in cima alla pagina)"
|
423 |
|
lang/italy-cookie-choices-ro_RO.mo
CHANGED
Binary file
|
lang/italy-cookie-choices-ro_RO.po
CHANGED
@@ -1,207 +1,245 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: italy-cookie-choices\n"
|
4 |
-
"POT-Creation-Date: 2015-06-
|
5 |
-
"PO-Revision-Date: 2015-06-
|
6 |
"Last-Translator: Florin Lungu <me@florinlungu.it>\n"
|
7 |
"Language-Team: info@overclokk.net\n"
|
8 |
"Language: ro_RO\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"X-Generator: Poedit 1.5
|
13 |
"X-Poedit-Basepath: ..\\\n"
|
14 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
"X-Poedit-KeywordsList: __;_e\n"
|
|
|
17 |
"X-Poedit-SearchPathExcluded-0: node_modules\n"
|
18 |
"X-Poedit-SearchPathExcluded-1: .git\n"
|
19 |
-
"X-Poedit-SearchPath-0: .\n"
|
20 |
|
21 |
-
#: italy-cookie-choices.php:
|
22 |
msgid "Italy Cookie Choices Dashboard"
|
23 |
msgstr "Panoul de control Italy Cookie Choices"
|
24 |
|
25 |
-
#: italy-cookie-choices.php:
|
26 |
msgid "You do not have sufficient permissions to access this page."
|
27 |
msgstr "Nu ai destule autorizații pentru a vedea această pagină."
|
28 |
|
29 |
-
#: italy-cookie-choices.php:
|
30 |
msgid "Italy Cookie Choices options page"
|
31 |
msgstr "Pagina cu opțiuni pentru Italy Cookie Choices"
|
32 |
|
33 |
-
#: italy-cookie-choices.php:
|
34 |
msgid "Activate"
|
35 |
msgstr "Activează"
|
36 |
|
37 |
-
#: italy-cookie-choices.php:
|
38 |
msgid "Where display the banner"
|
39 |
msgstr "Unde sa vizualizezi banner-ul"
|
40 |
|
41 |
-
#: italy-cookie-choices.php:
|
42 |
msgid "Mouse scroll event"
|
43 |
msgstr "Acțiune scroll de mouse"
|
44 |
|
45 |
-
#: italy-cookie-choices.php:
|
|
|
|
|
|
|
|
|
46 |
msgid "Refresh page"
|
47 |
msgstr "Actualizează pagina"
|
48 |
|
49 |
-
#: italy-cookie-choices.php:
|
50 |
msgid "Text to display"
|
51 |
msgstr "Textul pentru afișare"
|
52 |
|
53 |
-
#: italy-cookie-choices.php:
|
54 |
msgid "URL for cookie policy"
|
55 |
msgstr "URL pentru politica cookie"
|
56 |
|
57 |
-
#: italy-cookie-choices.php:
|
58 |
msgid "Anchor text for URL"
|
59 |
msgstr "Ancora text pentru URL"
|
60 |
|
61 |
-
#: italy-cookie-choices.php:
|
62 |
msgid "Button text"
|
63 |
msgstr "Text-ul pentru buton"
|
64 |
|
65 |
-
#: italy-cookie-choices.php:
|
66 |
msgid "Style settings"
|
67 |
msgstr "Setări de stil"
|
68 |
|
69 |
-
#: italy-cookie-choices.php:
|
|
|
|
|
|
|
|
|
70 |
msgid "HTML top margin"
|
71 |
msgstr "Marginea înaltă pentru HTML"
|
72 |
|
73 |
-
#: italy-cookie-choices.php:
|
74 |
msgid "Banner Background color"
|
75 |
msgstr "Culoare de background pentru banner "
|
76 |
|
77 |
-
#: italy-cookie-choices.php:
|
78 |
msgid "Banner text color"
|
79 |
msgstr "Culoarea text-ului din banner"
|
80 |
|
81 |
-
#: italy-cookie-choices.php:
|
82 |
msgid "Advanced settings"
|
83 |
msgstr "Setări avansate"
|
84 |
|
85 |
-
#: italy-cookie-choices.php:
|
86 |
msgid "Cookie name"
|
87 |
msgstr "Nume Cookie"
|
88 |
|
89 |
-
#: italy-cookie-choices.php:
|
90 |
msgid "Cookie value"
|
91 |
msgstr "Valoare Cookie"
|
92 |
|
93 |
-
#: italy-cookie-choices.php:
|
94 |
msgid "Cookie policy page slug"
|
95 |
msgstr "Slug pentru pagina de Politica Cookie"
|
96 |
|
97 |
-
#: italy-cookie-choices.php:
|
98 |
msgid "Open policy in new page"
|
99 |
msgstr "Deschide politica de cookie in o pagina nouă"
|
100 |
|
101 |
-
#: italy-cookie-choices.php:
|
102 |
msgid "Third part cookie block (beta)"
|
103 |
msgstr "Blochează cookie-urile externe"
|
104 |
|
105 |
-
#: italy-cookie-choices.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
msgid "Text message for locked embedded content"
|
107 |
msgstr "Mesaj pentru conținuturile încorporate blocate"
|
108 |
|
109 |
-
#: italy-cookie-choices.php:
|
110 |
msgid "Button text to activate locked embedded content"
|
111 |
msgstr "Textul butonului pentru a activa conținutul încorporat blocat"
|
112 |
|
113 |
-
#: italy-cookie-choices.php:
|
114 |
msgid "Customize your banner for cookie law"
|
115 |
msgstr "Personalizează banner-ul pentru Cookie Law"
|
116 |
|
117 |
-
#: italy-cookie-choices.php:
|
118 |
msgid "Display banner for Cookie Law in front-end"
|
119 |
msgstr "Visualizează banner-ul in front-end"
|
120 |
|
121 |
-
#: italy-cookie-choices.php:
|
122 |
-
msgid "Top Bar (Default, Display a top bar
|
123 |
-
msgstr "
|
|
|
|
|
124 |
|
125 |
-
#: italy-cookie-choices.php:
|
126 |
msgid "Dialog (Display an overlay with your message)"
|
127 |
msgstr "Dialog (Visualizează un pop-up cu text-ul tău)"
|
128 |
|
129 |
-
#: italy-cookie-choices.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
msgid "Accepts disclosures on mouse scroll event"
|
131 |
msgstr "Acceptă informativa cu scroll de mouse"
|
132 |
|
133 |
-
#: italy-cookie-choices.php:
|
134 |
-
msgid "
|
135 |
-
msgstr "
|
|
|
|
|
|
|
|
|
136 |
|
137 |
-
#: italy-cookie-choices.php:
|
138 |
msgid "Your short cookie policy"
|
139 |
msgstr "Informativa ta scurtă despre cookie"
|
140 |
|
141 |
-
#: italy-cookie-choices
|
|
|
142 |
msgid ""
|
143 |
"People will see this notice only the first time that they enter your site"
|
144 |
msgstr "Persoanele v-or vedea mesajul doar prima dată când vizită site-ul tău"
|
145 |
|
146 |
-
#: italy-cookie-choices.php:
|
147 |
msgid "e.g. http://www.aboutcookies.org/"
|
148 |
msgstr "De exemplu: http://www.aboutcookies.org/"
|
149 |
|
150 |
-
#: italy-cookie-choices.php:
|
151 |
msgid "Insert here the link to your policy page"
|
152 |
msgstr "Introduce link-ul la pagina ta cu informativa extinsă"
|
153 |
|
154 |
-
#: italy-cookie-choices.php:
|
155 |
msgid "e.g. More Info"
|
156 |
msgstr "De exemplu: Mai multe informații"
|
157 |
|
158 |
-
#: italy-cookie-choices.php:
|
159 |
msgid "Insert here anchor text for the link"
|
160 |
msgstr "Introdu aici ancora text pentru link"
|
161 |
|
162 |
-
#: italy-cookie-choices
|
|
|
163 |
msgid "e.g. Close"
|
164 |
msgstr "De exemplu: Închide"
|
165 |
|
166 |
-
#: italy-cookie-choices
|
|
|
167 |
msgid "Insert here name of button (e.g. \"Close\") "
|
168 |
msgstr ""
|
169 |
"Introduce textul link-ului pentru închiderea pop-upului/banner-ului (ex: "
|
170 |
"Închide)"
|
171 |
|
172 |
-
#: italy-cookie-choices.php:
|
173 |
msgid "Customize your style settings"
|
174 |
msgstr "Personalizează setările de stil"
|
175 |
|
176 |
-
#: italy-cookie-choices.php:
|
177 |
-
msgid "Add a page top margin for info top bar"
|
178 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
|
180 |
-
#: italy-cookie-choices.php:
|
181 |
msgid "Custom Background color for banner"
|
182 |
msgstr "Culoare personalizată pentru background-ul bannerului"
|
183 |
|
184 |
-
#: italy-cookie-choices.php:
|
185 |
msgid "Custom text color for banner"
|
186 |
msgstr "Culoare personalizată pentru culoarea textului în banner"
|
187 |
|
188 |
-
#: italy-cookie-choices.php:
|
189 |
msgid "Customize your advanced settings"
|
190 |
msgstr "Personalizează setările avansate"
|
191 |
|
192 |
-
#: italy-cookie-choices.php:
|
193 |
msgid "Insert your cookie name (Default: displayCookieConsent)"
|
194 |
msgstr "Introduceți numele Cookie-ului tău (Default: displayCookieConsent)"
|
195 |
|
196 |
-
#: italy-cookie-choices.php:
|
197 |
msgid "Insert your cookie value (Default: y)"
|
198 |
msgstr "Introduceți valoarea Cookie-ului (Default: y)"
|
199 |
|
200 |
-
#: italy-cookie-choices.php:
|
201 |
msgid "e.g. your-policy-url.html"
|
202 |
msgstr "ex: link-politica-ta.html"
|
203 |
|
204 |
-
#: italy-cookie-choices.php:
|
205 |
msgid ""
|
206 |
"Insert your cookie policy page slug (e.g. your-policy-url), it will display "
|
207 |
"only topbar in your cookie policy page"
|
@@ -210,29 +248,105 @@ msgstr ""
|
|
210 |
"politica-ta), acesta va vizualiza doar bara din sus în pagina despre "
|
211 |
"politica cookie-urilor"
|
212 |
|
213 |
-
#: italy-cookie-choices.php:
|
214 |
msgid "Open your cookie policy page in new one"
|
215 |
msgstr "Deschide pagina cookie-urilor în una noua"
|
216 |
|
217 |
-
#: italy-cookie-choices.php:
|
218 |
-
msgid "Cookie from any embed in your content (Beta)"
|
219 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
|
221 |
-
#: italy-cookie-choices.php:
|
222 |
-
msgid "
|
223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
|
225 |
-
#: italy-cookie-choices.php:
|
226 |
msgid "Your lock message for embedded contents inside posts, pages and widgets"
|
227 |
msgstr ""
|
228 |
"Mesajul tău de blocare pentru conținuturile încorporate în postări, pagini "
|
229 |
"și widget-uri"
|
230 |
|
231 |
-
#: italy-cookie-choices.php:
|
|
|
232 |
msgid "Cookie name field it can't be empty. Restored default name."
|
233 |
msgstr "Numele Cookie-ului nu poate fi lăsat gol. Resetat numele de default."
|
234 |
|
235 |
-
#: italy-cookie-choices.php:
|
|
|
236 |
msgid "Cookie value field it can't be empty. Restored default value."
|
237 |
msgstr ""
|
238 |
"Valoarea Cookie-ului nu poate fi lăsat gol. Resetată valoarea de default"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: italy-cookie-choices\n"
|
4 |
+
"POT-Creation-Date: 2015-06-22 12:54+0100\n"
|
5 |
+
"PO-Revision-Date: 2015-06-22 19:36+0100\n"
|
6 |
"Last-Translator: Florin Lungu <me@florinlungu.it>\n"
|
7 |
"Language-Team: info@overclokk.net\n"
|
8 |
"Language: ro_RO\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 1.7.5\n"
|
13 |
"X-Poedit-Basepath: ..\\\n"
|
14 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
"X-Poedit-KeywordsList: __;_e\n"
|
17 |
+
"X-Poedit-SearchPath-0: .\n"
|
18 |
"X-Poedit-SearchPathExcluded-0: node_modules\n"
|
19 |
"X-Poedit-SearchPathExcluded-1: .git\n"
|
|
|
20 |
|
21 |
+
#: admin/class-italy-cookie-choices-admin.php:74
|
22 |
msgid "Italy Cookie Choices Dashboard"
|
23 |
msgstr "Panoul de control Italy Cookie Choices"
|
24 |
|
25 |
+
#: admin/class-italy-cookie-choices-admin.php:88
|
26 |
msgid "You do not have sufficient permissions to access this page."
|
27 |
msgstr "Nu ai destule autorizații pentru a vedea această pagină."
|
28 |
|
29 |
+
#: admin/class-italy-cookie-choices-admin.php:149
|
30 |
msgid "Italy Cookie Choices options page"
|
31 |
msgstr "Pagina cu opțiuni pentru Italy Cookie Choices"
|
32 |
|
33 |
+
#: admin/class-italy-cookie-choices-admin.php:159
|
34 |
msgid "Activate"
|
35 |
msgstr "Activează"
|
36 |
|
37 |
+
#: admin/class-italy-cookie-choices-admin.php:171
|
38 |
msgid "Where display the banner"
|
39 |
msgstr "Unde sa vizualizezi banner-ul"
|
40 |
|
41 |
+
#: admin/class-italy-cookie-choices-admin.php:182
|
42 |
msgid "Mouse scroll event"
|
43 |
msgstr "Acțiune scroll de mouse"
|
44 |
|
45 |
+
#: admin/class-italy-cookie-choices-admin.php:193
|
46 |
+
msgid "Accept on second view"
|
47 |
+
msgstr "Acceptați intr-o noua fereastră"
|
48 |
+
|
49 |
+
#: admin/class-italy-cookie-choices-admin.php:204
|
50 |
msgid "Refresh page"
|
51 |
msgstr "Actualizează pagina"
|
52 |
|
53 |
+
#: admin/class-italy-cookie-choices-admin.php:215
|
54 |
msgid "Text to display"
|
55 |
msgstr "Textul pentru afișare"
|
56 |
|
57 |
+
#: admin/class-italy-cookie-choices-admin.php:226
|
58 |
msgid "URL for cookie policy"
|
59 |
msgstr "URL pentru politica cookie"
|
60 |
|
61 |
+
#: admin/class-italy-cookie-choices-admin.php:237
|
62 |
msgid "Anchor text for URL"
|
63 |
msgstr "Ancora text pentru URL"
|
64 |
|
65 |
+
#: admin/class-italy-cookie-choices-admin.php:248
|
66 |
msgid "Button text"
|
67 |
msgstr "Text-ul pentru buton"
|
68 |
|
69 |
+
#: admin/class-italy-cookie-choices-admin.php:259
|
70 |
msgid "Style settings"
|
71 |
msgstr "Setări de stil"
|
72 |
|
73 |
+
#: admin/class-italy-cookie-choices-admin.php:269
|
74 |
+
msgid "CookieChoices Template"
|
75 |
+
msgstr "Template CookieChoices"
|
76 |
+
|
77 |
+
#: admin/class-italy-cookie-choices-admin.php:280
|
78 |
msgid "HTML top margin"
|
79 |
msgstr "Marginea înaltă pentru HTML"
|
80 |
|
81 |
+
#: admin/class-italy-cookie-choices-admin.php:291
|
82 |
msgid "Banner Background color"
|
83 |
msgstr "Culoare de background pentru banner "
|
84 |
|
85 |
+
#: admin/class-italy-cookie-choices-admin.php:302
|
86 |
msgid "Banner text color"
|
87 |
msgstr "Culoarea text-ului din banner"
|
88 |
|
89 |
+
#: admin/class-italy-cookie-choices-admin.php:313
|
90 |
msgid "Advanced settings"
|
91 |
msgstr "Setări avansate"
|
92 |
|
93 |
+
#: admin/class-italy-cookie-choices-admin.php:323
|
94 |
msgid "Cookie name"
|
95 |
msgstr "Nume Cookie"
|
96 |
|
97 |
+
#: admin/class-italy-cookie-choices-admin.php:334
|
98 |
msgid "Cookie value"
|
99 |
msgstr "Valoare Cookie"
|
100 |
|
101 |
+
#: admin/class-italy-cookie-choices-admin.php:345
|
102 |
msgid "Cookie policy page slug"
|
103 |
msgstr "Slug pentru pagina de Politica Cookie"
|
104 |
|
105 |
+
#: admin/class-italy-cookie-choices-admin.php:356
|
106 |
msgid "Open policy in new page"
|
107 |
msgstr "Deschide politica de cookie in o pagina nouă"
|
108 |
|
109 |
+
#: admin/class-italy-cookie-choices-admin.php:367
|
110 |
msgid "Third part cookie block (beta)"
|
111 |
msgstr "Blochează cookie-urile externe"
|
112 |
|
113 |
+
#: admin/class-italy-cookie-choices-admin.php:378
|
114 |
+
msgid "Scripts allowed in body"
|
115 |
+
msgstr "Script permis in body"
|
116 |
+
|
117 |
+
#: admin/class-italy-cookie-choices-admin.php:389
|
118 |
+
msgid "Scripts to be blocked"
|
119 |
+
msgstr "Script care urmează sa fie blocat"
|
120 |
+
|
121 |
+
#: admin/class-italy-cookie-choices-admin.php:400
|
122 |
msgid "Text message for locked embedded content"
|
123 |
msgstr "Mesaj pentru conținuturile încorporate blocate"
|
124 |
|
125 |
+
#: admin/class-italy-cookie-choices-admin.php:411
|
126 |
msgid "Button text to activate locked embedded content"
|
127 |
msgstr "Textul butonului pentru a activa conținutul încorporat blocat"
|
128 |
|
129 |
+
#: admin/class-italy-cookie-choices-admin.php:436
|
130 |
msgid "Customize your banner for cookie law"
|
131 |
msgstr "Personalizează banner-ul pentru Cookie Law"
|
132 |
|
133 |
+
#: admin/class-italy-cookie-choices-admin.php:451
|
134 |
msgid "Display banner for Cookie Law in front-end"
|
135 |
msgstr "Visualizează banner-ul in front-end"
|
136 |
|
137 |
+
#: admin/class-italy-cookie-choices-admin.php:471
|
138 |
+
msgid "Top Bar (Default, Display a top bar with your message)"
|
139 |
+
msgstr ""
|
140 |
+
"Bara înaltă (Predefinită, Vizualizează o bara în partea înaltă cu mesajul "
|
141 |
+
"tău)"
|
142 |
|
143 |
+
#: admin/class-italy-cookie-choices-admin.php:479
|
144 |
msgid "Dialog (Display an overlay with your message)"
|
145 |
msgstr "Dialog (Visualizează un pop-up cu text-ul tău)"
|
146 |
|
147 |
+
#: admin/class-italy-cookie-choices-admin.php:487
|
148 |
+
msgid "Bottom Bar (Display a bar in the footer with your message)"
|
149 |
+
msgstr ""
|
150 |
+
"Bara în partea de jos a ecranului (Vizualizează o bară in partea de jos a "
|
151 |
+
"ecranului cu mesajul tău)"
|
152 |
+
|
153 |
+
#: admin/class-italy-cookie-choices-admin.php:507
|
154 |
msgid "Accepts disclosures on mouse scroll event"
|
155 |
msgstr "Acceptă informativa cu scroll de mouse"
|
156 |
|
157 |
+
#: admin/class-italy-cookie-choices-admin.php:527
|
158 |
+
msgid "Activate accept on second view"
|
159 |
+
msgstr "Activează accept într-o fereastră nouă"
|
160 |
+
|
161 |
+
#: admin/class-italy-cookie-choices-admin.php:545
|
162 |
+
msgid "Refresh page after button click (DEPRECATED)"
|
163 |
+
msgstr "Reîncarcă pagina dupa click pe buton (Deprecat)"
|
164 |
|
165 |
+
#: admin/class-italy-cookie-choices-admin.php:560
|
166 |
msgid "Your short cookie policy"
|
167 |
msgstr "Informativa ta scurtă despre cookie"
|
168 |
|
169 |
+
#: admin/class-italy-cookie-choices-admin.php:563
|
170 |
+
#: admin/class-italy-cookie-choices-admin.php:893
|
171 |
msgid ""
|
172 |
"People will see this notice only the first time that they enter your site"
|
173 |
msgstr "Persoanele v-or vedea mesajul doar prima dată când vizită site-ul tău"
|
174 |
|
175 |
+
#: admin/class-italy-cookie-choices-admin.php:577
|
176 |
msgid "e.g. http://www.aboutcookies.org/"
|
177 |
msgstr "De exemplu: http://www.aboutcookies.org/"
|
178 |
|
179 |
+
#: admin/class-italy-cookie-choices-admin.php:580
|
180 |
msgid "Insert here the link to your policy page"
|
181 |
msgstr "Introduce link-ul la pagina ta cu informativa extinsă"
|
182 |
|
183 |
+
#: admin/class-italy-cookie-choices-admin.php:594
|
184 |
msgid "e.g. More Info"
|
185 |
msgstr "De exemplu: Mai multe informații"
|
186 |
|
187 |
+
#: admin/class-italy-cookie-choices-admin.php:597
|
188 |
msgid "Insert here anchor text for the link"
|
189 |
msgstr "Introdu aici ancora text pentru link"
|
190 |
|
191 |
+
#: admin/class-italy-cookie-choices-admin.php:611
|
192 |
+
#: admin/class-italy-cookie-choices-admin.php:909
|
193 |
msgid "e.g. Close"
|
194 |
msgstr "De exemplu: Închide"
|
195 |
|
196 |
+
#: admin/class-italy-cookie-choices-admin.php:614
|
197 |
+
#: admin/class-italy-cookie-choices-admin.php:912
|
198 |
msgid "Insert here name of button (e.g. \"Close\") "
|
199 |
msgstr ""
|
200 |
"Introduce textul link-ului pentru închiderea pop-upului/banner-ului (ex: "
|
201 |
"Închide)"
|
202 |
|
203 |
+
#: admin/class-italy-cookie-choices-admin.php:631
|
204 |
msgid "Customize your style settings"
|
205 |
msgstr "Personalizează setările de stil"
|
206 |
|
207 |
+
#: admin/class-italy-cookie-choices-admin.php:647
|
208 |
+
msgid "Add a page top margin for info top bar, only for default topbar stile"
|
209 |
+
msgstr ""
|
210 |
+
"Adaugă o margine în partea înaltă a paginii pentru bara cu informații din "
|
211 |
+
"partea înaltă a ecranului, doar pentru stilul predefinit a barei din partea "
|
212 |
+
"înaltă a ecranului"
|
213 |
+
|
214 |
+
#: admin/class-italy-cookie-choices-admin.php:670
|
215 |
+
msgid "Select the template to use"
|
216 |
+
msgstr "Alege un template care să-l folosești"
|
217 |
|
218 |
+
#: admin/class-italy-cookie-choices-admin.php:691
|
219 |
msgid "Custom Background color for banner"
|
220 |
msgstr "Culoare personalizată pentru background-ul bannerului"
|
221 |
|
222 |
+
#: admin/class-italy-cookie-choices-admin.php:711
|
223 |
msgid "Custom text color for banner"
|
224 |
msgstr "Culoare personalizată pentru culoarea textului în banner"
|
225 |
|
226 |
+
#: admin/class-italy-cookie-choices-admin.php:728
|
227 |
msgid "Customize your advanced settings"
|
228 |
msgstr "Personalizează setările avansate"
|
229 |
|
230 |
+
#: admin/class-italy-cookie-choices-admin.php:744
|
231 |
msgid "Insert your cookie name (Default: displayCookieConsent)"
|
232 |
msgstr "Introduceți numele Cookie-ului tău (Default: displayCookieConsent)"
|
233 |
|
234 |
+
#: admin/class-italy-cookie-choices-admin.php:763
|
235 |
msgid "Insert your cookie value (Default: y)"
|
236 |
msgstr "Introduceți valoarea Cookie-ului (Default: y)"
|
237 |
|
238 |
+
#: admin/class-italy-cookie-choices-admin.php:779
|
239 |
msgid "e.g. your-policy-url.html"
|
240 |
msgstr "ex: link-politica-ta.html"
|
241 |
|
242 |
+
#: admin/class-italy-cookie-choices-admin.php:782
|
243 |
msgid ""
|
244 |
"Insert your cookie policy page slug (e.g. your-policy-url), it will display "
|
245 |
"only topbar in your cookie policy page"
|
248 |
"politica-ta), acesta va vizualiza doar bara din sus în pagina despre "
|
249 |
"politica cookie-urilor"
|
250 |
|
251 |
+
#: admin/class-italy-cookie-choices-admin.php:802
|
252 |
msgid "Open your cookie policy page in new one"
|
253 |
msgstr "Deschide pagina cookie-urilor în una noua"
|
254 |
|
255 |
+
#: admin/class-italy-cookie-choices-admin.php:826
|
256 |
+
msgid "Cookie from any embed in your content (Beta) (DEPRECATED)"
|
257 |
+
msgstr ""
|
258 |
+
"Cookie din orice conținut incorporat in conținutul paginii (Beta) (Deprecat)"
|
259 |
+
|
260 |
+
#: admin/class-italy-cookie-choices-admin.php:831
|
261 |
+
msgid "Cookie from any embed in your widget area (Beta) (DEPRECATED)"
|
262 |
+
msgstr "Cookie din orice conținut încorporat din area widget-ului (Deprecat)"
|
263 |
+
|
264 |
+
#: admin/class-italy-cookie-choices-admin.php:836
|
265 |
+
msgid "Cookie from any embed in all body, except head and footer (Beta)"
|
266 |
+
msgstr ""
|
267 |
+
"Cookie din orice conținut încorporat în orice conținut a paginii, mai puțin "
|
268 |
+
"partea înaltă si cea de jos a paginii"
|
269 |
+
|
270 |
+
#: admin/class-italy-cookie-choices-admin.php:853
|
271 |
+
#: admin/class-italy-cookie-choices-admin.php:871
|
272 |
+
msgid ""
|
273 |
+
"<script src="http://domain.com/widget-example.js"></"
|
274 |
+
"script>\n"
|
275 |
+
"<---------SEP--------->\n"
|
276 |
+
"<script src="http://otherdomain.com/script-example.js"></"
|
277 |
+
"script>\n"
|
278 |
+
"<---------SEP--------->\n"
|
279 |
+
"<script src="http://lastdomain.com/gadget-example.js"></"
|
280 |
+
"script>"
|
281 |
+
msgstr ""
|
282 |
+
"<script src="http://domain.com/widget-example.js"></"
|
283 |
+
"script>\n"
|
284 |
+
"<---------SEP--------->\n"
|
285 |
+
"<script src="http://otherdomain.com/script-example.js"></"
|
286 |
+
"script>\n"
|
287 |
+
"<---------SEP--------->\n"
|
288 |
+
"<script src="http://lastdomain.com/gadget-example.js"></"
|
289 |
+
"script>"
|
290 |
+
|
291 |
+
#: admin/class-italy-cookie-choices-admin.php:856
|
292 |
+
msgid ""
|
293 |
+
"Scripts to be excluded from the automatic block.<br />Split each script with "
|
294 |
+
"<strong><em><---------SEP---------></em></strong>"
|
295 |
+
msgstr ""
|
296 |
+
"Script care va fi exclus din blocarea automatică.<br />Împarte fiecare "
|
297 |
+
"script cu <strong><em><---------SEP---------></em></strong>"
|
298 |
|
299 |
+
#: admin/class-italy-cookie-choices-admin.php:874
|
300 |
+
msgid ""
|
301 |
+
"Scripts shown in the head and in the footer does not automatically blocked."
|
302 |
+
"<br />Split each script with <strong><em><---------SEP---------></em></"
|
303 |
+
"strong>"
|
304 |
+
msgstr ""
|
305 |
+
"Scripturile vizualizate in partea înalta si cea de jos a paginii nu sunt "
|
306 |
+
"blocate automat.<br />Împarte fiecare script cu <strong><em><---------"
|
307 |
+
"SEP---------></em></strong>"
|
308 |
|
309 |
+
#: admin/class-italy-cookie-choices-admin.php:890
|
310 |
msgid "Your lock message for embedded contents inside posts, pages and widgets"
|
311 |
msgstr ""
|
312 |
"Mesajul tău de blocare pentru conținuturile încorporate în postări, pagini "
|
313 |
"și widget-uri"
|
314 |
|
315 |
+
#: admin/class-italy-cookie-choices-admin.php:996
|
316 |
+
#: admin/class-italy-cookie-choices-sanitize.php:77
|
317 |
msgid "Cookie name field it can't be empty. Restored default name."
|
318 |
msgstr "Numele Cookie-ului nu poate fi lăsat gol. Resetat numele de default."
|
319 |
|
320 |
+
#: admin/class-italy-cookie-choices-admin.php:1003
|
321 |
+
#: admin/class-italy-cookie-choices-sanitize.php:84
|
322 |
msgid "Cookie value field it can't be empty. Restored default value."
|
323 |
msgstr ""
|
324 |
"Valoarea Cookie-ului nu poate fi lăsat gol. Resetată valoarea de default"
|
325 |
+
|
326 |
+
#: italy-cookie-choices.php:135 italy-cookie-choices.php:145
|
327 |
+
msgid "Activation of Italy Cookie Choices in not possible"
|
328 |
+
msgstr "Activarea a Italy Cookie Choices nu este posibilă"
|
329 |
+
|
330 |
+
#: italy-cookie-choices.php:236
|
331 |
+
#, php-format
|
332 |
+
msgid ""
|
333 |
+
"Your server is running %s version %s but this plugin requires at least %s"
|
334 |
+
msgstr ""
|
335 |
+
"Server-ul tău folosește versiunea %s a %s dar acest plugin are nevoie de "
|
336 |
+
"măcar versiunea %s"
|
337 |
+
|
338 |
+
#~ msgid "Top Bar (Default, Display a top bar wth your message)"
|
339 |
+
#~ msgstr ""
|
340 |
+
#~ "Top Bar (Default, va fi vizualizată o bară în partea înaltă a paginii)"
|
341 |
+
|
342 |
+
#~ msgid "Refresh page after button click"
|
343 |
+
#~ msgstr "Actualizează pagina după click pe buton"
|
344 |
+
|
345 |
+
#~ msgid "Add a page top margin for info top bar"
|
346 |
+
#~ msgstr "Adăuga o margine în partea înaltă a paginii doar pentru bara înaltă"
|
347 |
+
|
348 |
+
#~ msgid "Cookie from any embed in your content (Beta)"
|
349 |
+
#~ msgstr "Cookie din orice conținut încorporat în pagina ta (Beta)"
|
350 |
+
|
351 |
+
#~ msgid "Cookie from any embed in your widget area (Beta)"
|
352 |
+
#~ msgstr "Cookie din orice conținut încorporat în zona widget-urilor"
|
lang/italy-cookie-choices.pot
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: Italy Cookie Choices\n"
|
5 |
-
"POT-Creation-Date: 2015-06-
|
6 |
"PO-Revision-Date: 2015-05-21 20:22+0100\n"
|
7 |
"Last-Translator: Enea Overclokk <info@overclokk.net>\n"
|
8 |
"Language-Team: info@overclokk.net\n"
|
@@ -19,231 +19,315 @@ msgstr ""
|
|
19 |
"X-Poedit-SearchPathExcluded-0: node_modules\n"
|
20 |
"X-Poedit-SearchPathExcluded-1: .git\n"
|
21 |
|
22 |
-
#: italy-cookie-choices.php:
|
23 |
msgid "Italy Cookie Choices Dashboard"
|
24 |
msgstr ""
|
25 |
|
26 |
-
#: italy-cookie-choices.php:
|
27 |
msgid "You do not have sufficient permissions to access this page."
|
28 |
msgstr ""
|
29 |
|
30 |
-
#: italy-cookie-choices.php:
|
31 |
msgid "Italy Cookie Choices options page"
|
32 |
msgstr ""
|
33 |
|
34 |
-
#: italy-cookie-choices.php:
|
35 |
msgid "Activate"
|
36 |
msgstr ""
|
37 |
|
38 |
-
#: italy-cookie-choices.php:
|
39 |
msgid "Where display the banner"
|
40 |
msgstr ""
|
41 |
|
42 |
-
#: italy-cookie-choices.php:
|
43 |
msgid "Mouse scroll event"
|
44 |
msgstr ""
|
45 |
|
46 |
-
#: italy-cookie-choices.php:
|
47 |
msgid "Accept on second view"
|
48 |
msgstr ""
|
49 |
|
50 |
-
#: italy-cookie-choices.php:
|
51 |
msgid "Refresh page"
|
52 |
msgstr ""
|
53 |
|
54 |
-
#: italy-cookie-choices.php:
|
55 |
msgid "Text to display"
|
56 |
msgstr ""
|
57 |
|
58 |
-
#: italy-cookie-choices.php:
|
59 |
msgid "URL for cookie policy"
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: italy-cookie-choices.php:
|
63 |
msgid "Anchor text for URL"
|
64 |
msgstr ""
|
65 |
|
66 |
-
#: italy-cookie-choices.php:
|
67 |
msgid "Button text"
|
68 |
msgstr ""
|
69 |
|
70 |
-
#: italy-cookie-choices.php:
|
71 |
msgid "Style settings"
|
72 |
msgstr ""
|
73 |
|
74 |
-
#: italy-cookie-choices.php:
|
75 |
msgid "CookieChoices Template"
|
76 |
msgstr ""
|
77 |
|
78 |
-
#: italy-cookie-choices.php:
|
79 |
msgid "HTML top margin"
|
80 |
msgstr ""
|
81 |
|
82 |
-
#: italy-cookie-choices.php:
|
83 |
msgid "Banner Background color"
|
84 |
msgstr ""
|
85 |
|
86 |
-
#: italy-cookie-choices.php:
|
87 |
msgid "Banner text color"
|
88 |
msgstr ""
|
89 |
|
90 |
-
#: italy-cookie-choices.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
msgid "Advanced settings"
|
92 |
msgstr ""
|
93 |
|
94 |
-
#: italy-cookie-choices.php:
|
95 |
msgid "Cookie name"
|
96 |
msgstr ""
|
97 |
|
98 |
-
#: italy-cookie-choices.php:
|
99 |
msgid "Cookie value"
|
100 |
msgstr ""
|
101 |
|
102 |
-
#: italy-cookie-choices.php:
|
103 |
msgid "Cookie policy page slug"
|
104 |
msgstr ""
|
105 |
|
106 |
-
#: italy-cookie-choices.php:
|
107 |
msgid "Open policy in new page"
|
108 |
msgstr ""
|
109 |
|
110 |
-
#: italy-cookie-choices.php:
|
111 |
msgid "Third part cookie block (beta)"
|
112 |
msgstr ""
|
113 |
|
114 |
-
#: italy-cookie-choices.php:
|
115 |
-
msgid "
|
|
|
|
|
|
|
|
|
116 |
msgstr ""
|
117 |
|
118 |
-
#: italy-cookie-choices.php:
|
119 |
msgid "Text message for locked embedded content"
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: italy-cookie-choices.php:
|
123 |
msgid "Button text to activate locked embedded content"
|
124 |
msgstr ""
|
125 |
|
126 |
-
#: italy-cookie-choices.php:
|
127 |
msgid "Customize your banner for cookie law"
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: italy-cookie-choices.php:
|
131 |
msgid "Display banner for Cookie Law in front-end"
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: italy-cookie-choices.php:
|
135 |
msgid "Top Bar (Default, Display a top bar with your message)"
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: italy-cookie-choices.php:
|
139 |
msgid "Dialog (Display an overlay with your message)"
|
140 |
msgstr ""
|
141 |
|
142 |
-
#: italy-cookie-choices.php:
|
143 |
msgid "Bottom Bar (Display a bar in the footer with your message)"
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: italy-cookie-choices.php:
|
147 |
msgid "Accepts disclosures on mouse scroll event"
|
148 |
msgstr ""
|
149 |
|
150 |
-
#: italy-cookie-choices.php:
|
151 |
msgid "Activate accept on second view"
|
152 |
msgstr ""
|
153 |
|
154 |
-
#: italy-cookie-choices.php:
|
155 |
msgid "Refresh page after button click (DEPRECATED)"
|
156 |
msgstr ""
|
157 |
|
158 |
-
#: italy-cookie-choices.php:
|
159 |
msgid "Your short cookie policy"
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: italy-cookie-choices
|
|
|
163 |
msgid "People will see this notice only the first time that they enter your site"
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: italy-cookie-choices.php:
|
167 |
msgid "e.g. http://www.aboutcookies.org/"
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: italy-cookie-choices.php:
|
171 |
msgid "Insert here the link to your policy page"
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: italy-cookie-choices.php:
|
175 |
msgid "e.g. More Info"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: italy-cookie-choices.php:
|
179 |
msgid "Insert here anchor text for the link"
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: italy-cookie-choices
|
|
|
183 |
msgid "e.g. Close"
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: italy-cookie-choices
|
|
|
187 |
msgid "Insert here name of button (e.g. \"Close\") "
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: italy-cookie-choices.php:
|
191 |
msgid "Customize your style settings"
|
192 |
msgstr ""
|
193 |
|
194 |
-
#: italy-cookie-choices.php:
|
195 |
msgid "Add a page top margin for info top bar, only for default topbar stile"
|
196 |
msgstr ""
|
197 |
|
198 |
-
#: italy-cookie-choices.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
msgid "Select the template to use"
|
200 |
msgstr ""
|
201 |
|
202 |
-
#: italy-cookie-choices.php:
|
203 |
msgid "Custom Background color for banner"
|
204 |
msgstr ""
|
205 |
|
206 |
-
#: italy-cookie-choices.php:
|
207 |
msgid "Custom text color for banner"
|
208 |
msgstr ""
|
209 |
|
210 |
-
#: italy-cookie-choices.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
msgid "Customize your advanced settings"
|
212 |
msgstr ""
|
213 |
|
214 |
-
#: italy-cookie-choices.php:
|
215 |
msgid "Insert your cookie name (Default: displayCookieConsent)"
|
216 |
msgstr ""
|
217 |
|
218 |
-
#: italy-cookie-choices.php:
|
219 |
msgid "Insert your cookie value (Default: y)"
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: italy-cookie-choices.php:
|
223 |
msgid "e.g. your-policy-url.html"
|
224 |
msgstr ""
|
225 |
|
226 |
-
#: italy-cookie-choices.php:
|
227 |
msgid "Insert your cookie policy page slug (e.g. your-policy-url), it will display only topbar in your cookie policy page"
|
228 |
msgstr ""
|
229 |
|
230 |
-
#: italy-cookie-choices.php:
|
231 |
msgid "Open your cookie policy page in new one"
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: italy-cookie-choices.php:
|
235 |
msgid "Cookie from any embed in your content (Beta) (DEPRECATED)"
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: italy-cookie-choices.php:
|
239 |
msgid "Cookie from any embed in your widget area (Beta) (DEPRECATED)"
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: italy-cookie-choices.php:
|
243 |
msgid "Cookie from any embed in all body, except head and footer (Beta)"
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: italy-cookie-choices.php:
|
|
|
247 |
msgid ""
|
248 |
"<script src="http://domain.com/widget-example.js"></script>\n"
|
249 |
"<---------SEP--------->\n"
|
@@ -252,18 +336,33 @@ msgid ""
|
|
252 |
"<script src="http://lastdomain.com/gadget-example.js"></script>"
|
253 |
msgstr ""
|
254 |
|
255 |
-
#: italy-cookie-choices.php:
|
|
|
|
|
|
|
|
|
256 |
msgid "Scripts shown in the head and in the footer does not automatically blocked.<br />Split each script with <strong><em><---------SEP---------></em></strong>"
|
257 |
msgstr ""
|
258 |
|
259 |
-
#: italy-cookie-choices.php:
|
260 |
msgid "Your lock message for embedded contents inside posts, pages and widgets"
|
261 |
msgstr ""
|
262 |
|
263 |
-
#: italy-cookie-choices.php:
|
|
|
264 |
msgid "Cookie name field it can't be empty. Restored default name."
|
265 |
msgstr ""
|
266 |
|
267 |
-
#: italy-cookie-choices.php:
|
|
|
268 |
msgid "Cookie value field it can't be empty. Restored default value."
|
269 |
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: Italy Cookie Choices\n"
|
5 |
+
"POT-Creation-Date: 2015-06-24 16:53+0100\n"
|
6 |
"PO-Revision-Date: 2015-05-21 20:22+0100\n"
|
7 |
"Last-Translator: Enea Overclokk <info@overclokk.net>\n"
|
8 |
"Language-Team: info@overclokk.net\n"
|
19 |
"X-Poedit-SearchPathExcluded-0: node_modules\n"
|
20 |
"X-Poedit-SearchPathExcluded-1: .git\n"
|
21 |
|
22 |
+
#: admin/class-italy-cookie-choices-admin.php:74
|
23 |
msgid "Italy Cookie Choices Dashboard"
|
24 |
msgstr ""
|
25 |
|
26 |
+
#: admin/class-italy-cookie-choices-admin.php:88
|
27 |
msgid "You do not have sufficient permissions to access this page."
|
28 |
msgstr ""
|
29 |
|
30 |
+
#: admin/class-italy-cookie-choices-admin.php:149
|
31 |
msgid "Italy Cookie Choices options page"
|
32 |
msgstr ""
|
33 |
|
34 |
+
#: admin/class-italy-cookie-choices-admin.php:159
|
35 |
msgid "Activate"
|
36 |
msgstr ""
|
37 |
|
38 |
+
#: admin/class-italy-cookie-choices-admin.php:171
|
39 |
msgid "Where display the banner"
|
40 |
msgstr ""
|
41 |
|
42 |
+
#: admin/class-italy-cookie-choices-admin.php:182
|
43 |
msgid "Mouse scroll event"
|
44 |
msgstr ""
|
45 |
|
46 |
+
#: admin/class-italy-cookie-choices-admin.php:193
|
47 |
msgid "Accept on second view"
|
48 |
msgstr ""
|
49 |
|
50 |
+
#: admin/class-italy-cookie-choices-admin.php:204
|
51 |
msgid "Refresh page"
|
52 |
msgstr ""
|
53 |
|
54 |
+
#: admin/class-italy-cookie-choices-admin.php:215
|
55 |
msgid "Text to display"
|
56 |
msgstr ""
|
57 |
|
58 |
+
#: admin/class-italy-cookie-choices-admin.php:226
|
59 |
msgid "URL for cookie policy"
|
60 |
msgstr ""
|
61 |
|
62 |
+
#: admin/class-italy-cookie-choices-admin.php:237
|
63 |
msgid "Anchor text for URL"
|
64 |
msgstr ""
|
65 |
|
66 |
+
#: admin/class-italy-cookie-choices-admin.php:248
|
67 |
msgid "Button text"
|
68 |
msgstr ""
|
69 |
|
70 |
+
#: admin/class-italy-cookie-choices-admin.php:259
|
71 |
msgid "Style settings"
|
72 |
msgstr ""
|
73 |
|
74 |
+
#: admin/class-italy-cookie-choices-admin.php:269
|
75 |
msgid "CookieChoices Template"
|
76 |
msgstr ""
|
77 |
|
78 |
+
#: admin/class-italy-cookie-choices-admin.php:280
|
79 |
msgid "HTML top margin"
|
80 |
msgstr ""
|
81 |
|
82 |
+
#: admin/class-italy-cookie-choices-admin.php:291
|
83 |
msgid "Banner Background color"
|
84 |
msgstr ""
|
85 |
|
86 |
+
#: admin/class-italy-cookie-choices-admin.php:302
|
87 |
msgid "Banner text color"
|
88 |
msgstr ""
|
89 |
|
90 |
+
#: admin/class-italy-cookie-choices-admin.php:313
|
91 |
+
msgid "Custom CSS"
|
92 |
+
msgstr ""
|
93 |
+
|
94 |
+
#: admin/class-italy-cookie-choices-admin.php:324
|
95 |
+
msgid "Custom CSS Class (Optional)"
|
96 |
+
msgstr ""
|
97 |
+
|
98 |
+
#: admin/class-italy-cookie-choices-admin.php:335
|
99 |
msgid "Advanced settings"
|
100 |
msgstr ""
|
101 |
|
102 |
+
#: admin/class-italy-cookie-choices-admin.php:345
|
103 |
msgid "Cookie name"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: admin/class-italy-cookie-choices-admin.php:356
|
107 |
msgid "Cookie value"
|
108 |
msgstr ""
|
109 |
|
110 |
+
#: admin/class-italy-cookie-choices-admin.php:367
|
111 |
msgid "Cookie policy page slug"
|
112 |
msgstr ""
|
113 |
|
114 |
+
#: admin/class-italy-cookie-choices-admin.php:378
|
115 |
msgid "Open policy in new page"
|
116 |
msgstr ""
|
117 |
|
118 |
+
#: admin/class-italy-cookie-choices-admin.php:389
|
119 |
msgid "Third part cookie block (beta)"
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: admin/class-italy-cookie-choices-admin.php:400
|
123 |
+
msgid "Scripts allowed in body"
|
124 |
+
msgstr ""
|
125 |
+
|
126 |
+
#: admin/class-italy-cookie-choices-admin.php:411
|
127 |
+
msgid "Scripts to be blocked"
|
128 |
msgstr ""
|
129 |
|
130 |
+
#: admin/class-italy-cookie-choices-admin.php:422
|
131 |
msgid "Text message for locked embedded content"
|
132 |
msgstr ""
|
133 |
|
134 |
+
#: admin/class-italy-cookie-choices-admin.php:433
|
135 |
msgid "Button text to activate locked embedded content"
|
136 |
msgstr ""
|
137 |
|
138 |
+
#: admin/class-italy-cookie-choices-admin.php:458
|
139 |
msgid "Customize your banner for cookie law"
|
140 |
msgstr ""
|
141 |
|
142 |
+
#: admin/class-italy-cookie-choices-admin.php:473
|
143 |
msgid "Display banner for Cookie Law in front-end"
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: admin/class-italy-cookie-choices-admin.php:493
|
147 |
msgid "Top Bar (Default, Display a top bar with your message)"
|
148 |
msgstr ""
|
149 |
|
150 |
+
#: admin/class-italy-cookie-choices-admin.php:501
|
151 |
msgid "Dialog (Display an overlay with your message)"
|
152 |
msgstr ""
|
153 |
|
154 |
+
#: admin/class-italy-cookie-choices-admin.php:509
|
155 |
msgid "Bottom Bar (Display a bar in the footer with your message)"
|
156 |
msgstr ""
|
157 |
|
158 |
+
#: admin/class-italy-cookie-choices-admin.php:529
|
159 |
msgid "Accepts disclosures on mouse scroll event"
|
160 |
msgstr ""
|
161 |
|
162 |
+
#: admin/class-italy-cookie-choices-admin.php:549
|
163 |
msgid "Activate accept on second view"
|
164 |
msgstr ""
|
165 |
|
166 |
+
#: admin/class-italy-cookie-choices-admin.php:567
|
167 |
msgid "Refresh page after button click (DEPRECATED)"
|
168 |
msgstr ""
|
169 |
|
170 |
+
#: admin/class-italy-cookie-choices-admin.php:582
|
171 |
msgid "Your short cookie policy"
|
172 |
msgstr ""
|
173 |
|
174 |
+
#: admin/class-italy-cookie-choices-admin.php:585
|
175 |
+
#: admin/class-italy-cookie-choices-admin.php:989
|
176 |
msgid "People will see this notice only the first time that they enter your site"
|
177 |
msgstr ""
|
178 |
|
179 |
+
#: admin/class-italy-cookie-choices-admin.php:599
|
180 |
msgid "e.g. http://www.aboutcookies.org/"
|
181 |
msgstr ""
|
182 |
|
183 |
+
#: admin/class-italy-cookie-choices-admin.php:602
|
184 |
msgid "Insert here the link to your policy page"
|
185 |
msgstr ""
|
186 |
|
187 |
+
#: admin/class-italy-cookie-choices-admin.php:616
|
188 |
msgid "e.g. More Info"
|
189 |
msgstr ""
|
190 |
|
191 |
+
#: admin/class-italy-cookie-choices-admin.php:619
|
192 |
msgid "Insert here anchor text for the link"
|
193 |
msgstr ""
|
194 |
|
195 |
+
#: admin/class-italy-cookie-choices-admin.php:633
|
196 |
+
#: admin/class-italy-cookie-choices-admin.php:1005
|
197 |
msgid "e.g. Close"
|
198 |
msgstr ""
|
199 |
|
200 |
+
#: admin/class-italy-cookie-choices-admin.php:636
|
201 |
+
#: admin/class-italy-cookie-choices-admin.php:1008
|
202 |
msgid "Insert here name of button (e.g. \"Close\") "
|
203 |
msgstr ""
|
204 |
|
205 |
+
#: admin/class-italy-cookie-choices-admin.php:653
|
206 |
msgid "Customize your style settings"
|
207 |
msgstr ""
|
208 |
|
209 |
+
#: admin/class-italy-cookie-choices-admin.php:669
|
210 |
msgid "Add a page top margin for info top bar, only for default topbar stile"
|
211 |
msgstr ""
|
212 |
|
213 |
+
#: admin/class-italy-cookie-choices-admin.php:687
|
214 |
+
msgid "Default cookiechoices template (centered with text links)"
|
215 |
+
msgstr ""
|
216 |
+
|
217 |
+
#: admin/class-italy-cookie-choices-admin.php:689
|
218 |
+
msgid "Centered container with left aligned text and big buttons"
|
219 |
+
msgstr ""
|
220 |
+
|
221 |
+
#: admin/class-italy-cookie-choices-admin.php:691
|
222 |
+
msgid "Centered container with left aligned text and small buttons"
|
223 |
+
msgstr ""
|
224 |
+
|
225 |
+
#: admin/class-italy-cookie-choices-admin.php:693
|
226 |
+
msgid "My custom CSS"
|
227 |
+
msgstr ""
|
228 |
+
|
229 |
+
#: admin/class-italy-cookie-choices-admin.php:697
|
230 |
msgid "Select the template to use"
|
231 |
msgstr ""
|
232 |
|
233 |
+
#: admin/class-italy-cookie-choices-admin.php:718
|
234 |
msgid "Custom Background color for banner"
|
235 |
msgstr ""
|
236 |
|
237 |
+
#: admin/class-italy-cookie-choices-admin.php:738
|
238 |
msgid "Custom text color for banner"
|
239 |
msgstr ""
|
240 |
|
241 |
+
#: admin/class-italy-cookie-choices-admin.php:755
|
242 |
+
msgid "Your custom css"
|
243 |
+
msgstr ""
|
244 |
+
|
245 |
+
#: admin/class-italy-cookie-choices-admin.php:758
|
246 |
+
msgid "Inset here your custom CSS for banner"
|
247 |
+
msgstr ""
|
248 |
+
|
249 |
+
#: admin/class-italy-cookie-choices-admin.php:783
|
250 |
+
msgid "Eg: bannerStyle"
|
251 |
+
msgstr ""
|
252 |
+
|
253 |
+
#: admin/class-italy-cookie-choices-admin.php:785
|
254 |
+
msgid "CSS class for div container (Default <code>bannerStyle</code>)"
|
255 |
+
msgstr ""
|
256 |
+
|
257 |
+
#: admin/class-italy-cookie-choices-admin.php:788
|
258 |
+
msgid "Eg: contentStyle"
|
259 |
+
msgstr ""
|
260 |
+
|
261 |
+
#: admin/class-italy-cookie-choices-admin.php:790
|
262 |
+
msgid "CSS class for div content (Default <code>contentStyle</code>)"
|
263 |
+
msgstr ""
|
264 |
+
|
265 |
+
#: admin/class-italy-cookie-choices-admin.php:793
|
266 |
+
msgid "Eg: consentText"
|
267 |
+
msgstr ""
|
268 |
+
|
269 |
+
#: admin/class-italy-cookie-choices-admin.php:795
|
270 |
+
msgid "CSS class for span content (Default <code>consentText</code>)"
|
271 |
+
msgstr ""
|
272 |
+
|
273 |
+
#: admin/class-italy-cookie-choices-admin.php:798
|
274 |
+
msgid "Eg: infoClass"
|
275 |
+
msgstr ""
|
276 |
+
|
277 |
+
#: admin/class-italy-cookie-choices-admin.php:800
|
278 |
+
msgid "CSS class for Info link (Default <code>itaybtn</code>)"
|
279 |
+
msgstr ""
|
280 |
+
|
281 |
+
#: admin/class-italy-cookie-choices-admin.php:803
|
282 |
+
msgid "Eg: closeClass"
|
283 |
+
msgstr ""
|
284 |
+
|
285 |
+
#: admin/class-italy-cookie-choices-admin.php:805
|
286 |
+
msgid "CSS class for close link (Default <code>itaybtn</code>)"
|
287 |
+
msgstr ""
|
288 |
+
|
289 |
+
#: admin/class-italy-cookie-choices-admin.php:808
|
290 |
+
msgid "Customize with your personal CSS class"
|
291 |
+
msgstr ""
|
292 |
+
|
293 |
+
#: admin/class-italy-cookie-choices-admin.php:824
|
294 |
msgid "Customize your advanced settings"
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: admin/class-italy-cookie-choices-admin.php:840
|
298 |
msgid "Insert your cookie name (Default: displayCookieConsent)"
|
299 |
msgstr ""
|
300 |
|
301 |
+
#: admin/class-italy-cookie-choices-admin.php:859
|
302 |
msgid "Insert your cookie value (Default: y)"
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: admin/class-italy-cookie-choices-admin.php:875
|
306 |
msgid "e.g. your-policy-url.html"
|
307 |
msgstr ""
|
308 |
|
309 |
+
#: admin/class-italy-cookie-choices-admin.php:878
|
310 |
msgid "Insert your cookie policy page slug (e.g. your-policy-url), it will display only topbar in your cookie policy page"
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: admin/class-italy-cookie-choices-admin.php:898
|
314 |
msgid "Open your cookie policy page in new one"
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: admin/class-italy-cookie-choices-admin.php:922
|
318 |
msgid "Cookie from any embed in your content (Beta) (DEPRECATED)"
|
319 |
msgstr ""
|
320 |
|
321 |
+
#: admin/class-italy-cookie-choices-admin.php:927
|
322 |
msgid "Cookie from any embed in your widget area (Beta) (DEPRECATED)"
|
323 |
msgstr ""
|
324 |
|
325 |
+
#: admin/class-italy-cookie-choices-admin.php:932
|
326 |
msgid "Cookie from any embed in all body, except head and footer (Beta)"
|
327 |
msgstr ""
|
328 |
|
329 |
+
#: admin/class-italy-cookie-choices-admin.php:949
|
330 |
+
#: admin/class-italy-cookie-choices-admin.php:967
|
331 |
msgid ""
|
332 |
"<script src="http://domain.com/widget-example.js"></script>\n"
|
333 |
"<---------SEP--------->\n"
|
336 |
"<script src="http://lastdomain.com/gadget-example.js"></script>"
|
337 |
msgstr ""
|
338 |
|
339 |
+
#: admin/class-italy-cookie-choices-admin.php:952
|
340 |
+
msgid "Scripts to be excluded from the automatic block.<br />Split each script with <strong><em><---------SEP---------></em></strong>"
|
341 |
+
msgstr ""
|
342 |
+
|
343 |
+
#: admin/class-italy-cookie-choices-admin.php:970
|
344 |
msgid "Scripts shown in the head and in the footer does not automatically blocked.<br />Split each script with <strong><em><---------SEP---------></em></strong>"
|
345 |
msgstr ""
|
346 |
|
347 |
+
#: admin/class-italy-cookie-choices-admin.php:986
|
348 |
msgid "Your lock message for embedded contents inside posts, pages and widgets"
|
349 |
msgstr ""
|
350 |
|
351 |
+
#: admin/class-italy-cookie-choices-admin.php:1120
|
352 |
+
#: admin/class-italy-cookie-choices-sanitize.php:77
|
353 |
msgid "Cookie name field it can't be empty. Restored default name."
|
354 |
msgstr ""
|
355 |
|
356 |
+
#: admin/class-italy-cookie-choices-admin.php:1127
|
357 |
+
#: admin/class-italy-cookie-choices-sanitize.php:84
|
358 |
msgid "Cookie value field it can't be empty. Restored default value."
|
359 |
msgstr ""
|
360 |
+
|
361 |
+
#: italy-cookie-choices.php:135 italy-cookie-choices.php:145
|
362 |
+
msgid "Activation of Italy Cookie Choices in not possible"
|
363 |
+
msgstr ""
|
364 |
+
|
365 |
+
#: italy-cookie-choices.php:236
|
366 |
+
#, php-format
|
367 |
+
msgid "Your server is running %s version %s but this plugin requires at least %s"
|
368 |
+
msgstr ""
|
readme.txt
CHANGED
@@ -2,15 +2,18 @@
|
|
2 |
Contributors: overclokk, andreapernici, cardinaleandrea
|
3 |
Donate link:
|
4 |
Tags: compliance, cookie law, cookies, eu cookie law, eu law, eu privacy directive, privacy, privacy directive, notification, privacy law, cookie law banner, implied consent, third party script, third party cookie
|
5 |
-
Requires at least:
|
6 |
Tested up to: 4.3.0
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
|
|
|
|
11 |
Italy Cookie Choices allows you to easily comply with the european cookie law, showing
|
12 |
-
a notice to the user only the very first time that visits your website without degrading website performance and remove all the occurence of third party embed inside
|
13 |
-
|
|
|
14 |
|
15 |
== Description ==
|
16 |
|
@@ -23,29 +26,48 @@ The plugin will not add any CSS stylesheet or Javascript file but only inline sc
|
|
23 |
|
24 |
Now you can block all cookies with new Third Part Cookie Eraser, activated it and let me now if you have any issue
|
25 |
|
|
|
|
|
26 |
For your custom script (eg: analytics, custom script in footer, social script, ecc) you can add them in new text area `Function for custom script block`, add them one per line and split each script with `<---------SEP--------->`
|
27 |
|
28 |
Eg:
|
|
|
29 |
```
|
30 |
<script>console.log('Your custom script');</script>
|
31 |
<---------SEP--------->
|
32 |
<script async src="//192.168.1.10/italystrap/js.js"></script>
|
33 |
```
|
34 |
|
|
|
|
|
35 |
Please, notify any issue on github repository https://github.com/ItalyCookieChoices/italy-cookie-choices/issues
|
36 |
|
37 |
= Anonymize Analytics IP =
|
38 |
|
39 |
Add `ga('set', 'anonymizeIp', true);` in your analytics snippet [AnonymizeIP](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#anonymizeIp)
|
40 |
|
41 |
-
=
|
|
|
|
|
42 |
|
43 |
-
|
44 |
|
45 |
-
|
|
|
|
|
46 |
|
|
|
|
|
47 |
[Andrea Cardinale](https://www.andrea-cardinale.it/)
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
== Installation ==
|
50 |
|
51 |
1. Upload `italy-cookie-choices` folder to the `/wp-content/plugins/` directory
|
@@ -71,6 +93,13 @@ Yes, simply copy the snippet generate by "Italy Cookie Choses for WordPress" and
|
|
71 |
|
72 |
You have to uncheck the `Detect <script> tags in wp_footer` in Async JS and CSS plugin settings page and refresh page.
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
== Screenshots ==
|
75 |
|
76 |
1. Italy Cookie Choices Options Menu
|
@@ -82,6 +111,25 @@ You have to uncheck the `Detect <script> tags in wp_footer` in Async JS and CSS
|
|
82 |
|
83 |
== Changelog ==
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
= 2.1.0 =
|
86 |
Release Date: June 5th, 2015
|
87 |
|
@@ -207,4 +255,5 @@ a notice to the user only the very first time that visits your website without d
|
|
207 |
== Credits ==
|
208 |
|
209 |
* [www.cookiechoices.org](https://www.cookiechoices.org/)
|
210 |
-
* [Loghino piccolo](http://www.posizionamento-seo.com/)
|
|
2 |
Contributors: overclokk, andreapernici, cardinaleandrea
|
3 |
Donate link:
|
4 |
Tags: compliance, cookie law, cookies, eu cookie law, eu law, eu privacy directive, privacy, privacy directive, notification, privacy law, cookie law banner, implied consent, third party script, third party cookie
|
5 |
+
Requires at least: 3.5
|
6 |
Tested up to: 4.3.0
|
7 |
+
Stable tag: 2.2.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
Italy Cookie Choices allows you to easily comply with the european cookie law and block third part cookie in your page.
|
12 |
+
|
13 |
Italy Cookie Choices allows you to easily comply with the european cookie law, showing
|
14 |
+
a notice to the user only the very first time that visits your website without degrading website performance and remove all the occurence of third party embed inside your site until consent, fully customizable also with your custom css.
|
15 |
+
|
16 |
+
Plugin requirement PHP >= 5.3 and WordPress >= 3.5
|
17 |
|
18 |
== Description ==
|
19 |
|
26 |
|
27 |
Now you can block all cookies with new Third Part Cookie Eraser, activated it and let me now if you have any issue
|
28 |
|
29 |
+
[For more informations read the documentation](https://github.com/ItalyCookieChoices/italy-cookie-choices/wiki)
|
30 |
+
|
31 |
For your custom script (eg: analytics, custom script in footer, social script, ecc) you can add them in new text area `Function for custom script block`, add them one per line and split each script with `<---------SEP--------->`
|
32 |
|
33 |
Eg:
|
34 |
+
|
35 |
```
|
36 |
<script>console.log('Your custom script');</script>
|
37 |
<---------SEP--------->
|
38 |
<script async src="//192.168.1.10/italystrap/js.js"></script>
|
39 |
```
|
40 |
|
41 |
+
[See the documentation](https://github.com/ItalyCookieChoices/italy-cookie-choices/wiki) for more informations
|
42 |
+
|
43 |
Please, notify any issue on github repository https://github.com/ItalyCookieChoices/italy-cookie-choices/issues
|
44 |
|
45 |
= Anonymize Analytics IP =
|
46 |
|
47 |
Add `ga('set', 'anonymizeIp', true);` in your analytics snippet [AnonymizeIP](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#anonymizeIp)
|
48 |
|
49 |
+
= Compatibilità W3TC & WP Super Cache fix =
|
50 |
+
|
51 |
+
https://github.com/ItalyCookieChoices/italy-cookie-choices/wiki/Compatibilit%C3%A0-W3TC-fix
|
52 |
|
53 |
+
= Style customization =
|
54 |
|
55 |
+
https://github.com/ItalyCookieChoices/italy-cookie-choices/wiki/Style-customization
|
56 |
+
|
57 |
+
= Developer =
|
58 |
|
59 |
+
[Enea Overclokk](http://www.overclokk.net/)
|
60 |
+
[Andrea Pernici](https://www.andreapernici.com/)
|
61 |
[Andrea Cardinale](https://www.andrea-cardinale.it/)
|
62 |
|
63 |
+
= Link =
|
64 |
+
[WPItaly+](https://plus.google.com/u/0/communities/109254048492234113886)
|
65 |
+
[Forum GT](http://www.giorgiotave.it/forum/)
|
66 |
+
|
67 |
+
= Translators =
|
68 |
+
|
69 |
+
Romanian: [Florin Lungu](http://www.florinlungu.it/)
|
70 |
+
|
71 |
== Installation ==
|
72 |
|
73 |
1. Upload `italy-cookie-choices` folder to the `/wp-content/plugins/` directory
|
93 |
|
94 |
You have to uncheck the `Detect <script> tags in wp_footer` in Async JS and CSS plugin settings page and refresh page.
|
95 |
|
96 |
+
= I don't see the banner in my site =
|
97 |
+
|
98 |
+
Try this way:
|
99 |
+
deactivate all plugin and try
|
100 |
+
if it works activate one pluigin at time and try
|
101 |
+
if it doesn't work activate standard theme and try
|
102 |
+
|
103 |
== Screenshots ==
|
104 |
|
105 |
1. Italy Cookie Choices Options Menu
|
111 |
|
112 |
== Changelog ==
|
113 |
|
114 |
+
= 2.2.0 =
|
115 |
+
Release Date: June 24th, 2015
|
116 |
+
|
117 |
+
Dev time: 100h
|
118 |
+
|
119 |
+
* New file structure
|
120 |
+
* Removed scroll event on cookie policy page
|
121 |
+
* Fixed compatibility to pre WP 4.1
|
122 |
+
* Added scripts allowed in body
|
123 |
+
* [Added dumb regex for custom javascript](https://github.com/ItalyCookieChoices/italy-cookie-choices/wiki/Custom-script#come-evitare-che-vengano-bloccati-script-che-non-installano-cookie-slider-ecc) `<script src="/assets/js/<---------SOMETHING--------->.js" ></script>`
|
124 |
+
* [Fixed dialog off-screen in mobile devices](https://github.com/ItalyCookieChoices/italy-cookie-choices/issues/24)
|
125 |
+
* [Fixed typo](https://github.com/ItalyCookieChoices/italy-cookie-choices/issues/62)
|
126 |
+
* [Fixed fallback color for Text & BG in banner](https://github.com/ItalyCookieChoices/italy-cookie-choices/issues/95)
|
127 |
+
* [Added multilingual support only for banner](https://github.com/ItalyCookieChoices/italy-cookie-choices/issues/31)
|
128 |
+
* [Added uninstall.php](https://github.com/ItalyCookieChoices/italy-cookie-choices/issues/34)
|
129 |
+
* Added text area for custom CSS
|
130 |
+
* Added input for custom CSS class
|
131 |
+
* Added filter `icc_output_html` on snippet output for developer
|
132 |
+
|
133 |
= 2.1.0 =
|
134 |
Release Date: June 5th, 2015
|
135 |
|
255 |
== Credits ==
|
256 |
|
257 |
* [www.cookiechoices.org](https://www.cookiechoices.org/)
|
258 |
+
* [Loghino piccolo](http://www.posizionamento-seo.com/)
|
259 |
+
* Romanian lang: [Florin Lungu](http://www.florinlungu.it/)
|
uninstall.php
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Fired when the plugin is uninstalled.
|
4 |
+
*
|
5 |
+
* @package Italy Cookie Choices
|
6 |
+
* @author Enea Overclokk, Andrea Pernici, Andrea Cardinale
|
7 |
+
* @license GPLv2 or later
|
8 |
+
* @link https://github.com/ItalyCookieChoices/italy-cookie-choices
|
9 |
+
*
|
10 |
+
*/
|
11 |
+
/**
|
12 |
+
* If uninstall not called from WordPress, then exit
|
13 |
+
*/
|
14 |
+
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
15 |
+
exit;
|
16 |
+
}
|
17 |
+
|
18 |
+
if ( is_multisite() ) {
|
19 |
+
|
20 |
+
global $wpdb;
|
21 |
+
|
22 |
+
$blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A );
|
23 |
+
|
24 |
+
// delete_transient( 'TRANSIENT_NAME' );
|
25 |
+
delete_option('italy_cookie_choices');
|
26 |
+
|
27 |
+
if ( $blogs )
|
28 |
+
foreach ( $blogs as $blog ) {
|
29 |
+
|
30 |
+
switch_to_blog( $blog[ 'blog_id' ] );
|
31 |
+
|
32 |
+
// delete_transient( 'TRANSIENT_NAME' );
|
33 |
+
delete_option('italy_cookie_choices');
|
34 |
+
|
35 |
+
//info: remove and optimize tables
|
36 |
+
$GLOBALS['wpdb']->query( "DROP TABLE `" . $GLOBALS['wpdb']->prefix . "italy_cookie_choices`");
|
37 |
+
$GLOBALS['wpdb']->query( "OPTIMIZE TABLE `" . $GLOBALS['wpdb']->prefix . "options`");
|
38 |
+
|
39 |
+
restore_current_blog();
|
40 |
+
|
41 |
+
}
|
42 |
+
|
43 |
+
} else {
|
44 |
+
|
45 |
+
delete_option('italy_cookie_choices');
|
46 |
+
|
47 |
+
// delete_transient( 'TRANSIENT_NAME' );
|
48 |
+
delete_option('italy_cookie_choices');
|
49 |
+
|
50 |
+
//info: remove and optimize tables
|
51 |
+
$GLOBALS['wpdb']->query("DROP TABLE `".$GLOBALS['wpdb']->prefix."italy_cookie_choices`");
|
52 |
+
$GLOBALS['wpdb']->query("OPTIMIZE TABLE `" .$GLOBALS['wpdb']->prefix."options`");
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
deregister_string( 'Italy Cookie Choices', 'Banner text');
|
57 |
+
// deregister_string( 'Italy Cookie Choices', 'Banner url' );
|
58 |
+
deregister_string( 'Italy Cookie Choices', 'Banner anchor text' );
|
59 |
+
deregister_string( 'Italy Cookie Choices', 'Banner button text' );
|