Ginger – EU Cookie Law - Version 3.1.5

Version Description

  • new option to disable ginger on loggedin
  • new option to exclude specific pages
  • new option to disable ginger in policy page
Download this release

Release Info

Developer manafactory
Plugin Icon 128x128 Ginger – EU Cookie Law
Version 3.1.5
Comparing to
See all releases

Code changes from version 3.1.4 to 3.1.5

admin/ginger.admin.php CHANGED
@@ -11,6 +11,9 @@ if($tab == 'banner'):
11
  wp_enqueue_script('jquery-textarea', plugins_url('/ginger/admin/js/jquery_lined_textarea/jquery-linedtextarea.js'), array( 'jquery' ) );
12
  wp_enqueue_style('textarea-style', plugins_url('/ginger/admin/js/jquery_lined_textarea/jquery-linedtextarea.css'));
13
  endif;
 
 
 
14
 
15
  if(isset($_POST["submit"]) && !wp_verify_nonce($_POST['ginger_options'], 'save_ginger_options')){
16
  return;
@@ -62,12 +65,21 @@ if ($key=='ginger_policy'){
62
  if(is_int($privacy_page_id)):
63
  update_option($key, $privacy_page_id);
64
  endif;
 
 
65
  }else{
66
  update_option($key, $params);}
67
  echo '<div class="updated"><p>'.__( 'Updated!', 'ginger' ).'</p></div>';
68
  }
69
 
70
  $options = get_option($key);
 
 
 
 
 
 
 
71
  ?>
72
 
73
  <div class="wrap">
@@ -79,7 +91,7 @@ $options = get_option($key);
79
  <a href="admin.php?page=ginger-setup&tab=policy" class="nav-tab <?php echo (($_GET["page"] == 'ginger-setup') && (isset($_GET["tab"]) && $_GET["tab"] == "policy" )) ? 'nav-tab-active' : ''; ?>"><?php _e("Privacy Policy", "ginger"); ?></a>
80
  <?php do_action("ginger_add_tab_menu"); ?>
81
  </h2>
82
- <form method="post" action="admin.php?page=<?php echo $_GET["page"]; ?><?php if(isset($tab)) echo '&tab=' . $tab; ?>" <?php if (isset($tab) && $tab == 'url') echo 'class="repeater"';?>>
83
  <?php wp_nonce_field('save_ginger_options', 'ginger_options'); ?>
84
  <?php
85
  switch($tab){
11
  wp_enqueue_script('jquery-textarea', plugins_url('/ginger/admin/js/jquery_lined_textarea/jquery-linedtextarea.js'), array( 'jquery' ) );
12
  wp_enqueue_style('textarea-style', plugins_url('/ginger/admin/js/jquery_lined_textarea/jquery-linedtextarea.css'));
13
  endif;
14
+ if($tab == 'general' || $tab==''):
15
+ wp_enqueue_script('repeater', plugins_url('/ginger/admin/js/jquery.repeater-master/jquery.repeater.js'), array( 'jquery' ) );
16
+ endif;
17
 
18
  if(isset($_POST["submit"]) && !wp_verify_nonce($_POST['ginger_options'], 'save_ginger_options')){
19
  return;
65
  if(is_int($privacy_page_id)):
66
  update_option($key, $privacy_page_id);
67
  endif;
68
+ update_option($key.'_disable_ginger', $_POST["ginger_privacy_click_scroll"]);
69
+
70
  }else{
71
  update_option($key, $params);}
72
  echo '<div class="updated"><p>'.__( 'Updated!', 'ginger' ).'</p></div>';
73
  }
74
 
75
  $options = get_option($key);
76
+ if ($key=='ginger_policy'):
77
+
78
+ $options = get_option($key);
79
+ // recupero la option per il disable click out e scroll in privacy policy page
80
+ $options2 = get_option($key.'_disable_ginger');
81
+
82
+ endif;
83
  ?>
84
 
85
  <div class="wrap">
91
  <a href="admin.php?page=ginger-setup&tab=policy" class="nav-tab <?php echo (($_GET["page"] == 'ginger-setup') && (isset($_GET["tab"]) && $_GET["tab"] == "policy" )) ? 'nav-tab-active' : ''; ?>"><?php _e("Privacy Policy", "ginger"); ?></a>
92
  <?php do_action("ginger_add_tab_menu"); ?>
93
  </h2>
94
+ <form method="post" action="admin.php?page=<?php echo $_GET["page"]; ?><?php if(isset($tab)) echo '&tab=' . $tab; ?>" <?php echo 'class="repeater"';?>>
95
  <?php wp_nonce_field('save_ginger_options', 'ginger_options'); ?>
96
  <?php
97
  switch($tab){
admin/js/jquery.repeater-master/jquery.repeater.min.js ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ // jquery.repeater version 1.0.0
2
+ // https://github.com/DubFriend/jquery.repeater
3
+ // (MIT) 11-04-2015
4
+ // Brian Detering <BDeterin@gmail.com> (http://www.briandetering.net/)
5
+ !function(a){"use strict";var b=function(a){return a},c=function(b){return a.isArray(b)},d=function(a){return!c(a)&&a instanceof Object},e=function(b,c){return a.inArray(c,b)},f=function(a,b){return-1!==e(a,b)},g=function(a,b){for(var c in a)a.hasOwnProperty(c)&&b(a[c],c,a)},h=function(a){return a[a.length-1]},i=function(a,b){var c=[];return g(a,function(a,d,e){c.push(b(a,d,e))}),c},j=function(a,b,c){var d={};return g(a,function(a,e,f){e=c?c(e,a):e,d[e]=b(a,e,f)}),d},k=function(a,b,d){return c(a)?i(a,b):j(a,b,d)},l=function(a,b,c){return k(a,function(a){return a[b].apply(a,c||[])})},m=function(a){a=a||{};var b={};return a.publish=function(a,c){g(b[a],function(a){a(c)})},a.subscribe=function(a,c){b[a]=b[a]||[],b[a].push(c)},a.unsubscribe=function(a){g(b,function(b){var c=e(b,a);-1!==c&&b.splice(c,1)})},a};!function(a){var b=function(a,b){var c=m(),d=a.$;return c.getType=function(){throw'implement me (return type. "text", "radio", etc.)'},c.$=function(a){return a?d.find(a):d},c.disable=function(){c.$().prop("disabled",!0),c.publish("isEnabled",!1)},c.enable=function(){c.$().prop("disabled",!1),c.publish("isEnabled",!0)},b.equalTo=function(a,b){return a===b},b.publishChange=function(){var a;return function(d,e){var f=c.get();b.equalTo(f,a)||c.publish("change",{e:d,domElement:e}),a=f}}(),c},i=function(a,c){var d=b(a,c);return d.get=function(){return d.$().val()},d.set=function(a){d.$().val(a)},d.clear=function(){d.set("")},c.buildSetter=function(a){return function(b){a.call(d,b)}},d},j=function(a,b){a=c(a)?a:[a],b=c(b)?b:[b];var d=!0;return a.length!==b.length?d=!1:g(a,function(a){f(b,a)||(d=!1)}),d},k=function(a){var b={},c=i(a,b);return c.getType=function(){return"button"},c.$().on("change",function(a){b.publishChange(a,this)}),c},n=function(b){var d={},e=i(b,d);return e.getType=function(){return"checkbox"},e.get=function(){var b=[];return e.$().filter(":checked").each(function(){b.push(a(this).val())}),b},e.set=function(b){b=c(b)?b:[b],e.$().each(function(){a(this).prop("checked",!1)}),g(b,function(a){e.$().filter('[value="'+a+'"]').prop("checked",!0)})},d.equalTo=j,e.$().change(function(a){d.publishChange(a,this)}),e},o=function(a){var b={},c=x(a,b);return c.getType=function(){return"email"},c},p=function(c){var d={},e=b(c,d);return e.getType=function(){return"file"},e.get=function(){return h(e.$().val().split("\\"))},e.clear=function(){this.$().each(function(){a(this).wrap("<form>").closest("form").get(0).reset(),a(this).unwrap()})},e.$().change(function(a){d.publishChange(a,this)}),e},q=function(a){var b={},c=i(a,b);return c.getType=function(){return"hidden"},c.$().change(function(a){b.publishChange(a,this)}),c},r=function(c){var d={},e=b(c,d);return e.getType=function(){return"file[multiple]"},e.get=function(){var a,b=e.$().get(0).files||[],c=[];for(a=0;a<(b.length||0);a+=1)c.push(b[a].name);return c},e.clear=function(){this.$().each(function(){a(this).wrap("<form>").closest("form").get(0).reset(),a(this).unwrap()})},e.$().change(function(a){d.publishChange(a,this)}),e},s=function(a){var b={},d=i(a,b);return d.getType=function(){return"select[multiple]"},d.get=function(){return d.$().val()||[]},d.set=function(a){d.$().val(""===a?[]:c(a)?a:[a])},b.equalTo=j,d.$().change(function(a){b.publishChange(a,this)}),d},t=function(a){var b={},c=x(a,b);return c.getType=function(){return"password"},c},u=function(b){var c={},d=i(b,c);return d.getType=function(){return"radio"},d.get=function(){return d.$().filter(":checked").val()||null},d.set=function(b){b?d.$().filter('[value="'+b+'"]').prop("checked",!0):d.$().each(function(){a(this).prop("checked",!1)})},d.$().change(function(a){c.publishChange(a,this)}),d},v=function(a){var b={},c=i(a,b);return c.getType=function(){return"range"},c.$().change(function(a){b.publishChange(a,this)}),c},w=function(a){var b={},c=i(a,b);return c.getType=function(){return"select"},c.$().change(function(a){b.publishChange(a,this)}),c},x=function(a){var b={},c=i(a,b);return c.getType=function(){return"text"},c.$().on("change keyup keydown",function(a){b.publishChange(a,this)}),c},y=function(a){var b={},c=i(a,b);return c.getType=function(){return"textarea"},c.$().on("change keyup keydown",function(a){b.publishChange(a,this)}),c},z=function(a){var b={},c=x(a,b);return c.getType=function(){return"url"},c},A=function(b){var c={},f=b.$,h=b.constructorOverride||{button:k,text:x,url:z,email:o,password:t,range:v,textarea:y,select:w,"select[multiple]":s,radio:u,checkbox:n,file:p,"file[multiple]":r,hidden:q},i=function(b,e){var g=d(e)?e:f.find(e);g.each(function(){var d=a(this).attr("name");c[d]=h[b]({$:a(this)})})},j=function(b,i){var j=[],k=d(i)?i:f.find(i);d(i)?c[k.attr("name")]=h[b]({$:k}):(k.each(function(){-1===e(j,a(this).attr("name"))&&j.push(a(this).attr("name"))}),g(j,function(a){c[a]=h[b]({$:f.find('input[name="'+a+'"]')})}))};if(f.is("input, select, textarea"))if(f.is('input[type="button"], button, input[type="submit"]'))i("button",f);else if(f.is("textarea"))i("textarea",f);else if(f.is('input[type="text"]')||f.is("input")&&!f.attr("type"))i("text",f);else if(f.is('input[type="password"]'))i("password",f);else if(f.is('input[type="email"]'))i("email",f);else if(f.is('input[type="url"]'))i("url",f);else if(f.is('input[type="range"]'))i("range",f);else if(f.is("select"))f.is("[multiple]")?i("select[multiple]",f):i("select",f);else if(f.is('input[type="file"]'))f.is("[multiple]")?i("file[multiple]",f):i("file",f);else if(f.is('input[type="hidden"]'))i("hidden",f);else if(f.is('input[type="radio"]'))j("radio",f);else{if(!f.is('input[type="checkbox"]'))throw"invalid input type";j("checkbox",f)}else i("button",'input[type="button"], button, input[type="submit"]'),i("text",'input[type="text"]'),i("password",'input[type="password"]'),i("email",'input[type="email"]'),i("url",'input[type="url"]'),i("range",'input[type="range"]'),i("textarea","textarea"),i("select","select:not([multiple])"),i("select[multiple]","select[multiple]"),i("file",'input[type="file"]:not([multiple])'),i("file[multiple]",'input[type="file"][multiple]'),i("hidden",'input[type="hidden"]'),j("radio",'input[type="radio"]'),j("checkbox",'input[type="checkbox"]');return c};a.fn.inputVal=function(b){var c=a(this),d=A({$:c});return c.is("input, textarea, select")?"undefined"==typeof b?d[c.attr("name")].get():(d[c.attr("name")].set(b),c):"undefined"==typeof b?l(d,"get"):(g(b,function(a,b){d[b].set(a)}),c)},a.fn.inputOnChange=function(b){var c=a(this),d=A({$:c});return g(d,function(a){a.subscribe("change",function(a){b.call(a.domElement,a.e)})}),c},a.fn.inputDisable=function(){var b=a(this);return l(A({$:b}),"disable"),b},a.fn.inputEnable=function(){var b=a(this);return l(A({$:b}),"enable"),b},a.fn.inputClear=function(){var b=a(this);return l(A({$:b}),"clear"),b}}(jQuery),a.fn.repeater=function(c){return c=c||{},a(this).each(function(){var d=a(this),e=c.show||function(){a(this).show()},f=c.hide||function(a){a()},g=d.find("[data-repeater-list]"),i=g.find("[data-repeater-item]").first().clone().hide(),j=a(this).find("[data-repeater-item]").first().find("[data-repeater-delete]");c.isFirstItemUndeletable&&j&&j.remove();var l=g.data("repeater-list"),m=function(){g.find("[data-repeater-item]").each(function(b){a(this).find("[name]").each(function(){var c=a(this).attr("name").match(/\[[^\]]+\]/g),d=c?h(c).replace(/\[|\]/g,""):a(this).attr("name"),e=l+"["+b+"]["+d+"]"+(a(this).is(":checkbox")?"[]":"");a(this).attr("name",e)})}),g.find("input[name][checked]").removeAttr("checked").prop("checked",!0)};m();var n=function(a,c){var d;d=a.find("[name]").first().attr("name").match(/\[([0-9]*)\]/)[1],a.inputVal(k(c,b,function(b){var c=l+"["+d+"]["+b+"]";return a.find('[name="'+c+'"]').length?c:c+"[]"}))},o=function(){var b=function(b){var d=c.defaultValues;b.find("[name]").each(function(){a(this).inputClear()}),d&&n(b,d)};return function(a){g.append(a),m(),b(a)}}();d.find("[data-repeater-create]").click(function(){var a=i.clone();o(a),e.call(a.get(0))}),g.on("click","[data-repeater-delete]",function(){var b=a(this).closest("[data-repeater-item]").get(0);f.call(b,function(){a(b).remove(),m()})})}),this}}(jQuery);
admin/partial/general.php CHANGED
@@ -1,6 +1,3 @@
1
- <?php
2
-
3
- ?>
4
  <table class="form-table striped">
5
  <thead>
6
  <tr>
@@ -187,9 +184,143 @@
187
  </fieldset>
188
  </td>
189
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  </tbody>
192
  </table>
193
 
194
 
195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <table class="form-table striped">
2
  <thead>
3
  <tr>
184
  </fieldset>
185
  </td>
186
  </tr>
187
+ <tr>
188
+ <th scope="row" style="padding-left:20px;"><?php _e("Disable Ginger for logged users", "ginger"); ?></th>
189
+ <td>
190
+ <fieldset>
191
+ <legend class="screen-reader-text">
192
+ <span><?php _e("Disable Ginger for logged users", "ginger"); ?></span>
193
+ </legend>
194
+ <label>
195
+ <input name="ginger_logged_users" type="radio" value="1" class="tog" <?php if(isset($options["ginger_logged_users"]) && $options["ginger_logged_users"] == "1") echo ' checked="checked" '; ?>><?php _e("Yes", "ginger"); ?>
196
+ </label>
197
+ </p>
198
+ <p>
199
+ <label>
200
+ <input name="ginger_logged_users" type="radio" value="0" class="tog" <?php if(!isset($options["ginger_logged_users"]) || $options["ginger_logged_users"] == "0") echo ' checked="checked" '; ?>><?php _e("No", "ginger"); ?>
201
+ </label>
202
+ </p>
203
+ </p>
204
+
205
+ </fieldset>
206
+ </td>
207
+ </tr>
208
 
209
+ <tr>
210
+ <th class="escludi-pagine" scope="row" style="padding-left:20px;"><?php _e("Disable Ginger for those pages", "ginger"); ?></th>
211
+ <td>
212
+ <fieldset>
213
+ <div data-repeater-list="pagine_escluse">
214
+ <?php if (!empty($options['pagine_escluse'])):?>
215
+
216
+
217
+ <?php foreach ($options['pagine_escluse'] as $array_pagine):?>
218
+
219
+ <?php $args = array(
220
+ 'sort_order' => 'asc',
221
+ 'sort_column' => 'post_title',
222
+ 'hierarchical' => 1,
223
+ 'exclude' => '',
224
+ 'include' => '',
225
+ 'meta_key' => '',
226
+ 'meta_value' => '',
227
+ 'authors' => '',
228
+ 'child_of' => 0,
229
+ 'parent' => -1,
230
+ 'exclude_tree' => '',
231
+ 'number' => '',
232
+ 'offset' => 0,
233
+ 'post_type' => 'page',
234
+ 'post_status' => 'publish'
235
+ );
236
+ $pages = get_pages($args);
237
+ ?>
238
+ <div data-repeater-item>
239
+ <select name="select-input" style="min-width:30%">
240
+ <option value="">Seleziona</option>
241
+
242
+ <?php
243
+ foreach ($pages as $page):
244
+ ?>
245
+ <option value="<?php echo $page->ID;?>" <?php if ($array_pagine['select-input']==$page->ID): echo "selected"; endif;?>><?php echo $page->post_title;?></option>
246
+ <?php
247
+ endforeach;
248
+ ?>
249
+ </select>
250
+ <input data-repeater-delete type="button" value="<?php _e('Cancella', 'ginger'); ?>" class="button button-primary" style="background: #F1F1F1; border-color: #B3B3B3; box-shadow: 0 1px 0 #F1F1F1; color: #444; text-shadow: 0 0 0 !important "/>
251
+ </div>
252
+ <?php endforeach;?>
253
+
254
+ <?php else:?>
255
+
256
+
257
+
258
+ <?php $args = array(
259
+ 'sort_order' => 'asc',
260
+ 'sort_column' => 'post_title',
261
+ 'hierarchical' => 1,
262
+ 'exclude' => '',
263
+ 'include' => '',
264
+ 'meta_key' => '',
265
+ 'meta_value' => '',
266
+ 'authors' => '',
267
+ 'child_of' => 0,
268
+ 'parent' => -1,
269
+ 'exclude_tree' => '',
270
+ 'number' => '',
271
+ 'offset' => 0,
272
+ 'post_type' => 'page',
273
+ 'post_status' => 'publish'
274
+ );
275
+ $pages = get_pages($args);
276
+ ?>
277
+ <div data-repeater-item>
278
+ <select name="select-input" style="min-width:30%">
279
+ <option value="">Seleziona</option>
280
+
281
+ <?php
282
+ foreach ($pages as $page):
283
+ ?>
284
+ <option value="<?php echo $page->ID;?>"><?php echo $page->post_title;?></option>
285
+ <?php
286
+ endforeach;
287
+ ?>
288
+ </select>
289
+ <input data-repeater-delete type="button" value="<?php _e('Delete', 'ginger'); ?>" class="button button-primary" style="background: #F1F1F1; border-color: #B3B3B3; box-shadow: 0 1px 0 #F1F1F1; color: #444; text-shadow: 0 0 0 !important "/>
290
+ </div>
291
+
292
+ <?php endif;?>
293
+
294
+
295
+
296
+ </div>
297
+ <input data-repeater-create type="button" value="<?php _e('+', 'ginger'); ?>" class="button button-primary" style="margin-top: 8px; background: #F1F1F1; border-color: #B3B3B3; box-shadow: 0 1px 0 #F1F1F1; color: #444; text-shadow: 0 0 0 !important "/>
298
+ <p>
299
+ <small style="padding-top: 20px">
300
+ <i>(<?php _e("Select pages in which Ginger is disabled", "ginger"); ?>)</i>
301
+ </small>
302
+ </p>
303
+ </fieldset>
304
+ </td>
305
+ </tr>
306
  </tbody>
307
  </table>
308
 
309
 
310
 
311
+ <script>
312
+ jQuery(document).ready(function () {
313
+ 'use strict';
314
+ jQuery('.repeater').repeater({
315
+
316
+ show: function () {
317
+ jQuery(this).slideDown();
318
+ },
319
+ hide: function (deleteElement) {
320
+ if(confirm('Are you sure you want to delete this element?')) {
321
+ jQuery(this).slideUp(deleteElement);
322
+ }
323
+ }
324
+ });
325
+ });
326
+ </script>
admin/partial/policy.php CHANGED
@@ -1,6 +1,3 @@
1
- <?php
2
-
3
- ?>
4
  <table class="form-table striped">
5
  <thead>
6
  <tr>
@@ -12,9 +9,11 @@
12
  <tbody>
13
 
14
  <tr>
15
- <th scope="row" style="padding-left:20px;"><label><input name="choice" type="radio" value="page"
16
- onclick="javascript:select_privacy_page();" <?php if ($options != "") echo ' checked="checked" '; ?>> <?php _e("Select your privacy policy page", "ginger"); ?>
17
- </label></th>
 
 
18
  </tr>
19
  <tr>
20
  <td colspan="2">
@@ -22,51 +21,52 @@
22
  <legend class="screen-reader-text">
23
  <span><?php _e("DialogText", "ginger"); ?></span>
24
  </legend>
25
- <?php
26
 
27
- $args = array(
28
- 'sort_order' => 'asc',
29
- 'sort_column' => 'post_title',
30
- 'hierarchical' => 1,
31
- 'exclude' => '',
32
- 'include' => '',
33
- 'meta_key' => '',
34
- 'meta_value' => '',
35
- 'authors' => '',
36
- 'child_of' => 0,
37
- 'parent' => -1,
38
- 'exclude_tree' => '',
39
- 'number' => '',
40
- 'offset' => 0,
41
- 'post_type' => 'page',
42
- 'post_status' => 'publish',
43
- 'suppress_filters' => false
44
- );
45
- $pages = get_pages($args);
46
 
47
 
48
 
49
 
50
- ?>
51
  <p>
52
  <label>
53
  <?php _e('Privacy Policy page', 'ginger'); ?>
54
  </label>
55
- <select name="ginger_privacy_page"
56
- id="privacy_page_select" <?php if ($options == "") echo ' disabled="true"'; ?>>
57
- <option value=""><?php _e('Select page', 'ginger'); ?></option>
58
- <?php foreach ($pages as $page) { ?>
59
- <option value="<?php echo $page->ID;?>" <?php if ($options == $page->ID) echo ' selected="selected" '; ?>><?php echo $page->post_title; ?></option>
60
- <?php } ?>
61
  </select>
62
  </p>
63
  </fieldset>
64
  </td>
65
  </tr>
66
  <tr>
67
- <th scope="row" style="padding-left:20px;"><label><input name="choice" type="radio" value="new_page"
68
- onclick="javascript:new_privacy_page();"><?php _e("or create your privacy policy page", "ginger"); ?>
69
- </label></th>
 
 
70
  </tr>
71
  <tr>
72
  <td colspan="2">
@@ -79,8 +79,6 @@
79
  </label>
80
  </p>
81
  <p id="p_exist_title" style="color: #ff0000; visibility: hidden"><?php _e('Attention ! There is already a page with this title', 'ginger');?></p>
82
-
83
-
84
  <p>
85
  <label>
86
  <fieldset>
@@ -102,7 +100,28 @@
102
  </small>
103
  </p>
104
  </div>
 
105
  </td>
106
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  </tbody>
108
- </table>
 
 
 
 
1
  <table class="form-table striped">
2
  <thead>
3
  <tr>
9
  <tbody>
10
 
11
  <tr>
12
+ <th scope="row" style="padding-left:20px;">
13
+ <label>
14
+ <input name="choice" type="radio" value="page" onclick="javascript:select_privacy_page();" <?php if ($options != "") echo ' checked="checked" '; ?>> <?php _e("Select your privacy policy page", "ginger"); ?>
15
+ </label>
16
+ </th>
17
  </tr>
18
  <tr>
19
  <td colspan="2">
21
  <legend class="screen-reader-text">
22
  <span><?php _e("DialogText", "ginger"); ?></span>
23
  </legend>
24
+ <?php
25
 
26
+ $args = array(
27
+ 'sort_order' => 'asc',
28
+ 'sort_column' => 'post_title',
29
+ 'hierarchical' => 1,
30
+ 'exclude' => '',
31
+ 'include' => '',
32
+ 'meta_key' => '',
33
+ 'meta_value' => '',
34
+ 'authors' => '',
35
+ 'child_of' => 0,
36
+ 'parent' => -1,
37
+ 'exclude_tree' => '',
38
+ 'number' => '',
39
+ 'offset' => 0,
40
+ 'post_type' => 'page',
41
+ 'post_status' => 'publish',
42
+ 'suppress_filters' => false
43
+ );
44
+ $pages = get_pages($args);
45
 
46
 
47
 
48
 
49
+ ?>
50
  <p>
51
  <label>
52
  <?php _e('Privacy Policy page', 'ginger'); ?>
53
  </label>
54
+ <select name="ginger_privacy_page" id="privacy_page_select" <?php if ($options == "") echo ' disabled="true"'; ?>>
55
+ <option value=""><?php _e('Select page', 'ginger'); ?></option>
56
+ <?php foreach ($pages as $page) { ?>
57
+ <option value="<?php echo $page->ID;?>" <?php if ($options == $page->ID) echo ' selected="selected" '; ?>><?php echo $page->post_title; ?></option>
58
+ <?php } ?>
 
59
  </select>
60
  </p>
61
  </fieldset>
62
  </td>
63
  </tr>
64
  <tr>
65
+ <th scope="row" style="padding-left:20px;">
66
+ <label>
67
+ <input name="choice" type="radio" value="new_page" onclick="javascript:new_privacy_page();"><?php _e("or create your privacy policy page", "ginger"); ?>
68
+ </label>
69
+ </th>
70
  </tr>
71
  <tr>
72
  <td colspan="2">
79
  </label>
80
  </p>
81
  <p id="p_exist_title" style="color: #ff0000; visibility: hidden"><?php _e('Attention ! There is already a page with this title', 'ginger');?></p>
 
 
82
  <p>
83
  <label>
84
  <fieldset>
100
  </small>
101
  </p>
102
  </div>
103
+ </fieldset>
104
  </td>
105
  </tr>
106
+ <tr>
107
+ <th scope="row" style="padding-left:20px;"><?php _e("Disable Click-out and Scroll to accept cookies in Privacy Policy page", "ginger"); ?></th>
108
+ </tr>
109
+ <tr>
110
+ <td colspan="2" style="padding-left:20px;">
111
+ <fieldset>
112
+ <p>
113
+ <label>
114
+ <input name="ginger_privacy_click_scroll" type="radio" value="1" class="tog" <?php if($options2 == "1") echo ' checked="checked" '; ?>><?php _e("Yes", "ginger"); ?>
115
+ </label>
116
+ </p>
117
+ <p>
118
+ <label>
119
+ <input name="ginger_privacy_click_scroll" type="radio" value="0" class="tog" <?php if($options2 == "0") echo ' checked="checked" '; ?>><?php _e("No", "ginger"); ?>
120
+ </label>
121
+ </p>
122
+ </fieldset>
123
+ </td>
124
+ </tr>
125
  </tbody>
126
+ </table>
127
+
front/gingerfront.core.php CHANGED
@@ -1,12 +1,5 @@
1
  <?php
2
- /**
3
- * Created by PhpStorm.
4
- * User: matteobarale
5
- * Date: 09/07/15
6
- * Time: 13:17
7
- */
8
-
9
-
10
  function ginger_get_text_iframe($option_ginger_bar){
11
 
12
  if($option_ginger_bar['ginger_Iframe_text']):
@@ -79,10 +72,32 @@ endif;
79
  function ginger_run(){
80
  if(is_feed()) return;
81
  $option_ginger_general = get_option('ginger_general');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  if(!(isset($option_ginger_general['enable_ginger']) && $option_ginger_general['enable_ginger'] == 1)) return;
83
  if(isset($_COOKIE['ginger-cookie']) && $_COOKIE['ginger-cookie'] == 'Y'):
84
  if(isset($option_ginger_general['ginger_cache']) && $option_ginger_general['ginger_cache'] == 'no') return;
85
  endif;
 
 
86
  if(isset($option_ginger_general['ginger_opt']) && $option_ginger_general['ginger_opt'] == 'in'):
87
 
88
  ob_start();
1
  <?php
2
+ /* GINGER CORE */
 
 
 
 
 
 
 
3
  function ginger_get_text_iframe($option_ginger_bar){
4
 
5
  if($option_ginger_bar['ginger_Iframe_text']):
72
  function ginger_run(){
73
  if(is_feed()) return;
74
  $option_ginger_general = get_option('ginger_general');
75
+ if(isset($option_ginger_general['ginger_logged_users']) && $option_ginger_general['ginger_logged_users']=='1' && is_user_logged_in()) return;
76
+ if((isset($option_ginger_general['pagine_escluse'])) && (!empty($option_ginger_general['pagine_escluse']))):
77
+
78
+ $pagine=array();
79
+
80
+
81
+
82
+ foreach ($option_ginger_general['pagine_escluse'] as $array_pagine):
83
+
84
+
85
+ $pagine[] = $array_pagine['select-input'];
86
+ // $pagine=array_push($pagine, $array_pagine['select-input']);
87
+ endforeach;
88
+ $id_current=get_the_id();
89
+ if (in_array($id_current, $pagine)):
90
+ return;
91
+ endif;
92
+
93
+ endif;
94
+
95
  if(!(isset($option_ginger_general['enable_ginger']) && $option_ginger_general['enable_ginger'] == 1)) return;
96
  if(isset($_COOKIE['ginger-cookie']) && $_COOKIE['ginger-cookie'] == 'Y'):
97
  if(isset($option_ginger_general['ginger_cache']) && $option_ginger_general['ginger_cache'] == 'no') return;
98
  endif;
99
+
100
+
101
  if(isset($option_ginger_general['ginger_opt']) && $option_ginger_general['ginger_opt'] == 'in'):
102
 
103
  ob_start();
front/gingerfront.utils.php CHANGED
@@ -69,6 +69,30 @@ function ginger_script(){ ?>
69
  <?php
70
  //Recupero le informazioni necessarie per stampare il banner
71
  $option_ginger_general = get_option('ginger_general');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  $option_ginger_bar = get_option('ginger_banner');
73
  if($option_ginger_general['enable_ginger'] != 1) return;
74
  //Verifoco la tipologia di accettazione dei cookie
@@ -83,6 +107,11 @@ function ginger_script(){ ?>
83
  else:
84
  $click_outside = 'false';
85
  endif;
 
 
 
 
 
86
  //Verifico se è abilitato il forceReload
87
  if($option_ginger_general['ginger_force_reload'] == 1):
88
  $ginger_force_reload = 'true';
69
  <?php
70
  //Recupero le informazioni necessarie per stampare il banner
71
  $option_ginger_general = get_option('ginger_general');
72
+ $option_ginger_policy = get_option('ginger_policy_disable_ginger');
73
+
74
+ $id_privacy_policy = get_option('ginger_policy');
75
+ $id_current=get_the_id();
76
+
77
+
78
+ if((isset($option_ginger_general['pagine_escluse'])) && (!empty($option_ginger_general['pagine_escluse']))):
79
+
80
+ $pagine=array();
81
+
82
+
83
+
84
+ foreach ($option_ginger_general['pagine_escluse'] as $array_pagine):
85
+
86
+
87
+ $pagine[] = $array_pagine['select-input'];
88
+ // $pagine=array_push($pagine, $array_pagine['select-input']);
89
+ endforeach;
90
+ if (in_array($id_current, $pagine)):
91
+ return;
92
+ endif;
93
+
94
+ endif;
95
+ if(isset($option_ginger_general['ginger_logged_users']) && $option_ginger_general['ginger_logged_users']=='1' && is_user_logged_in()) return;
96
  $option_ginger_bar = get_option('ginger_banner');
97
  if($option_ginger_general['enable_ginger'] != 1) return;
98
  //Verifoco la tipologia di accettazione dei cookie
107
  else:
108
  $click_outside = 'false';
109
  endif;
110
+ if ($id_current==$id_privacy_policy && $option_ginger_policy == 1):
111
+
112
+ $click_outside = 'false';
113
+ $type_scroll = 'false';
114
+ endif;
115
  //Verifico se è abilitato il forceReload
116
  if($option_ginger_general['ginger_force_reload'] == 1):
117
  $ginger_force_reload = 'true';
ginger-eu-cookie-law.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ginger - EU Cookie Law
4
  Plugin URI: http://www.ginger-cookielaw.com/
5
  Description: Make your website compliant with EU Cookie Policy! For more features get <a href="http://www.ginger-cookielaw.com/download/">Ginger Plus - Tools Installer</a>
6
- Version: 3.1.4
7
  Author: Manafactory
8
  Author URI: http://manafactory.it/
9
  License: GPLv2 or later
3
  Plugin Name: Ginger - EU Cookie Law
4
  Plugin URI: http://www.ginger-cookielaw.com/
5
  Description: Make your website compliant with EU Cookie Policy! For more features get <a href="http://www.ginger-cookielaw.com/download/">Ginger Plus - Tools Installer</a>
6
+ Version: 3.1.5
7
  Author: Manafactory
8
  Author URI: http://manafactory.it/
9
  License: GPLv2 or later
languages/ginger-it_IT.mo CHANGED
Binary file
languages/ginger-it_IT.po CHANGED
@@ -5,7 +5,7 @@ msgstr ""
5
  "Project-Id-Version: _s 1.0.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tags/_s\n"
7
  "POT-Creation-Date: 2015-07-09 12:06+0100\n"
8
- "PO-Revision-Date: 2015-07-09 15:18+0100\n"
9
  "Last-Translator: \n"
10
  "Language-Team: \n"
11
  "Language: it_IT\n"
@@ -866,6 +866,20 @@ msgstr "Titolo"
866
  msgid "Attention ! There is already a page with this title"
867
  msgstr "Attenzione! C'è già una pagina con questo titolo"
868
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
869
  #: /var/www/sitolocale/wp-content/plugins/ginger/admin/partial/policy.php:111
870
  msgid "If you create a new page this will be setted as Privacy Policy Page"
871
  msgstr ""
5
  "Project-Id-Version: _s 1.0.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tags/_s\n"
7
  "POT-Creation-Date: 2015-07-09 12:06+0100\n"
8
+ "PO-Revision-Date: 2016-02-05 16:56+0100\n"
9
  "Last-Translator: \n"
10
  "Language-Team: \n"
11
  "Language: it_IT\n"
866
  msgid "Attention ! There is already a page with this title"
867
  msgstr "Attenzione! C'è già una pagina con questo titolo"
868
 
869
+ msgid "Disable Ginger for logged users"
870
+ msgstr "Disabilita Ginger per gli utenti loggati"
871
+
872
+ msgid "Disable Ginger for those pages"
873
+ msgstr "Disabilita Ginger per queste pagine"
874
+
875
+ msgid "Select pages in which Ginger is disabled"
876
+ msgstr "Seleziona le pagine nelle quali vuoi che Ginger sia disabilitato"
877
+
878
+ msgid "Disable Click-out and Scroll to accept cookies in Privacy Policy page"
879
+ msgstr ""
880
+ "Disabilita Click-out e Scroll per accettare i cookies nella pagina di "
881
+ "Privacy Policy"
882
+
883
  #: /var/www/sitolocale/wp-content/plugins/ginger/admin/partial/policy.php:111
884
  msgid "If you create a new page this will be setted as Privacy Policy Page"
885
  msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.ginger-cookielaw.com/
4
  Tags: EU Cookie Law, cookie law, block cookie, cookie consent, cookie law, cookie policy, privacy policy, cookie banner, italian cookie law, cookie italia
5
  Requires at least: 3.0.1
6
  Tested up to: 4.4
7
- Stable tag: 3.1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -93,6 +93,11 @@ Yes, actually you we have 2 addons for multilanguages: wpml and polylang. Ask to
93
 
94
  == Changelog ==
95
 
 
 
 
 
 
96
  = 3.1.4 =
97
  * disabled banner text indicization
98
 
4
  Tags: EU Cookie Law, cookie law, block cookie, cookie consent, cookie law, cookie policy, privacy policy, cookie banner, italian cookie law, cookie italia
5
  Requires at least: 3.0.1
6
  Tested up to: 4.4
7
+ Stable tag: 3.1.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
93
 
94
  == Changelog ==
95
 
96
+ = 3.1.5 =
97
+ * new option to disable ginger on loggedin
98
+ * new option to exclude specific pages
99
+ * new option to disable ginger in policy page
100
+
101
  = 3.1.4 =
102
  * disabled banner text indicization
103