creareeucookielaw - Version 1.0.0

Version Notes

First official version release.

Download this release

Release Info

Developer Magento Core Team
Extension creareeucookielaw
Version 1.0.0
Comparing to
See all releases


Code changes from version 0.1.1 to 1.0.0

app/code/{local → community}/Creare/Eucookielaw/etc/adminhtml.xml RENAMED
File without changes
app/code/{local → community}/Creare/Eucookielaw/etc/config.xml RENAMED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Creare_Eucookielaw>
5
- <version>0.1.0</version>
6
  </Creare_Eucookielaw>
7
  </modules>
8
  <frontend>
@@ -20,8 +20,12 @@
20
  <show_banner>1</show_banner>
21
  <cookie_lifetime>14</cookie_lifetime>
22
  <privacy_url>privacy-policy-cookie-restriction-mode</privacy_url>
23
- <privacy_message>Our website uses cookies. By continuing we assume your permission to deploy cookies, as detailed in our Privacy Policy</privacy_message>
24
- <privacy_url_text>Policy Details</privacy_url_text>
 
 
 
 
25
  </cookie_banner_settings>
26
  </eu_cookie_law>
27
  </default>
2
  <config>
3
  <modules>
4
  <Creare_Eucookielaw>
5
+ <version>1.0.0</version>
6
  </Creare_Eucookielaw>
7
  </modules>
8
  <frontend>
20
  <show_banner>1</show_banner>
21
  <cookie_lifetime>14</cookie_lifetime>
22
  <privacy_url>privacy-policy-cookie-restriction-mode</privacy_url>
23
+ <privacy_message>Our website uses cookies. By continuing we assume your permission to deploy cookies, as detailed in our Privacy Policy</privacy_message>
24
+ <privacy_url_text>Policy Details</privacy_url_text>
25
+ <developer_mode>0</developer_mode>
26
+ <css>#cookie-law { background:#f7f7f7; }
27
+ #cookie-law p { padding:5px 0; margin:0; text-align: center }</css>
28
+ <fadeout>0</fadeout>
29
  </cookie_banner_settings>
30
  </eu_cookie_law>
31
  </default>
app/code/community/Creare/Eucookielaw/etc/system.xml ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <config>
3
+ <tabs>
4
+ <creare_group translate="label">
5
+ <label>Creare Group</label>
6
+ <sort_order>100</sort_order>
7
+ </creare_group>
8
+ </tabs>
9
+ <sections>
10
+ <eu_cookie_law translate="label">
11
+ <label>EU Cookie Law</label>
12
+ <tab>creare_group</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>1000</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <cookie_banner_settings translate="label">
20
+ <label>Cookie Banner Settings</label>
21
+ <sort_order>100</sort_order>
22
+ <show_in_default>1</show_in_default>
23
+ <show_in_website>1</show_in_website>
24
+ <show_in_store>1</show_in_store>
25
+ <fields>
26
+ <show_banner translate="label">
27
+ <label>Show Cookie Banner?</label>
28
+ <frontend_type>select</frontend_type>
29
+ <source_model>adminhtml/system_config_source_yesno</source_model>
30
+ <sort_order>1</sort_order>
31
+ <show_in_default>1</show_in_default>
32
+ <show_in_website>1</show_in_website>
33
+ <show_in_store>1</show_in_store>
34
+ </show_banner>
35
+ <cookie_lifetime translate="label">
36
+ <label>Cookie Lifetime (Days)</label>
37
+ <frontend_type>text</frontend_type>
38
+ <sort_order>2</sort_order>
39
+ <show_in_default>1</show_in_default>
40
+ <show_in_website>1</show_in_website>
41
+ <show_in_store>1</show_in_store>
42
+ <validate>validate-zero-or-greater validate-number</validate>
43
+ <depends>
44
+ <show_banner>1</show_banner>
45
+ </depends>
46
+ </cookie_lifetime>
47
+ <developer_mode translate="label">
48
+ <label>Developer Mode</label>
49
+ <frontend_type>select</frontend_type>
50
+ <source_model>adminhtml/system_config_source_yesno</source_model>
51
+ <sort_order>3</sort_order>
52
+ <show_in_default>1</show_in_default>
53
+ <show_in_website>1</show_in_website>
54
+ <show_in_store>1</show_in_store>
55
+ <comment>When set to 'Yes' the banner will stay put for editing.</comment>
56
+ <depends>
57
+ <show_banner>1</show_banner>
58
+ </depends>
59
+ </developer_mode>
60
+ <privacy_url translate="label">
61
+ <label>Privacy Policy URL</label>
62
+ <frontend_type>text</frontend_type>
63
+ <sort_order>4</sort_order>
64
+ <show_in_default>1</show_in_default>
65
+ <show_in_website>1</show_in_website>
66
+ <show_in_store>1</show_in_store>
67
+ <comment>Relative to your Base Url http://www.domain.com/</comment>
68
+ <depends>
69
+ <show_banner>1</show_banner>
70
+ </depends>
71
+ </privacy_url>
72
+ <privacy_url_text translate="label">
73
+ <label>Privacy Link Text</label>
74
+ <frontend_type>text</frontend_type>
75
+ <sort_order>5</sort_order>
76
+ <show_in_default>1</show_in_default>
77
+ <show_in_website>1</show_in_website>
78
+ <show_in_store>1</show_in_store>
79
+ <depends>
80
+ <show_banner>1</show_banner>
81
+ </depends>
82
+ </privacy_url_text>
83
+ <privacy_message translate="label">
84
+ <label>Privacy Message</label>
85
+ <frontend_type>textarea</frontend_type>
86
+ <sort_order>6</sort_order>
87
+ <show_in_default>1</show_in_default>
88
+ <show_in_website>1</show_in_website>
89
+ <show_in_store>1</show_in_store>
90
+ <depends>
91
+ <show_banner>1</show_banner>
92
+ </depends>
93
+ </privacy_message>
94
+ <css translate="label">
95
+ <label>Banner CSS Styling</label>
96
+ <frontend_type>textarea</frontend_type>
97
+ <sort_order>7</sort_order>
98
+ <show_in_default>1</show_in_default>
99
+ <show_in_website>1</show_in_website>
100
+ <show_in_store>1</show_in_store>
101
+ <depends>
102
+ <show_banner>1</show_banner>
103
+ </depends>
104
+ </css>
105
+ <fadeout translate="label">
106
+ <label>Fade out after (x) seconds</label>
107
+ <frontend_type>text</frontend_type>
108
+ <sort_order>8</sort_order>
109
+ <show_in_default>1</show_in_default>
110
+ <show_in_website>1</show_in_website>
111
+ <show_in_store>1</show_in_store>
112
+ <validate>validate-zero-or-greater validate-number</validate>
113
+ <comment>Enter 0 to make banner stay until user navigates to next page.</comment>
114
+ <depends>
115
+ <show_banner>1</show_banner>
116
+ </depends>
117
+ </fadeout>
118
+ </fields>
119
+ </cookie_banner_settings>
120
+ </groups>
121
+ </eu_cookie_law>
122
+ </sections>
123
+ </config>
app/code/local/Creare/Eucookielaw/etc/system.xml DELETED
@@ -1,86 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <config>
3
- <tabs>
4
- <crearextend translate="label">
5
- <label>Crearextend</label>
6
- <sort_order>100</sort_order>
7
- </crearextend>
8
- </tabs>
9
- <sections>
10
- <eu_cookie_law translate="label">
11
- <label>EU Cookie Law</label>
12
- <tab>crearextend</tab>
13
- <frontend_type>text</frontend_type>
14
- <sort_order>1000</sort_order>
15
- <show_in_default>1</show_in_default>
16
- <show_in_website>1</show_in_website>
17
- <show_in_store>1</show_in_store>
18
- <groups>
19
- <cookie_banner_settings translate="label">
20
- <label>Cookie Banner Settings</label>
21
- <sort_order>100</sort_order>
22
- <show_in_default>1</show_in_default>
23
- <show_in_website>1</show_in_website>
24
- <show_in_store>1</show_in_store>
25
- <fields>
26
- <show_banner translate="label">
27
- <label>Show Cookie Banner?</label>
28
- <frontend_type>select</frontend_type>
29
- <source_model>adminhtml/system_config_source_yesno</source_model>
30
- <sort_order>1</sort_order>
31
- <show_in_default>1</show_in_default>
32
- <show_in_website>1</show_in_website>
33
- <show_in_store>1</show_in_store>
34
- </show_banner>
35
- <cookie_lifetime translate="label">
36
- <label>Cookie Lifetime (Days)</label>
37
- <frontend_type>text</frontend_type>
38
- <sort_order>2</sort_order>
39
- <show_in_default>1</show_in_default>
40
- <show_in_website>1</show_in_website>
41
- <show_in_store>1</show_in_store>
42
- <validate>validate-zero-or-greater</validate>
43
- <depends>
44
- <show_banner>1</show_banner>
45
- </depends>
46
- </cookie_lifetime>
47
- <privacy_url translate="label">
48
- <label>Privacy Policy URL</label>
49
- <frontend_type>text</frontend_type>
50
- <sort_order>3</sort_order>
51
- <show_in_default>1</show_in_default>
52
- <show_in_website>1</show_in_website>
53
- <show_in_store>1</show_in_store>
54
- <comment>Relative to your Base Url http://www.domain.com/</comment>
55
- <depends>
56
- <show_banner>1</show_banner>
57
- </depends>
58
- </privacy_url>
59
- <privacy_url_text translate="label">
60
- <label>Privacy Link Text</label>
61
- <frontend_type>text</frontend_type>
62
- <sort_order>4</sort_order>
63
- <show_in_default>1</show_in_default>
64
- <show_in_website>1</show_in_website>
65
- <show_in_store>1</show_in_store>
66
- <depends>
67
- <show_banner>1</show_banner>
68
- </depends>
69
- </privacy_url_text>
70
- <privacy_message translate="label">
71
- <label>Privacy Message</label>
72
- <frontend_type>textarea</frontend_type>
73
- <sort_order>5</sort_order>
74
- <show_in_default>1</show_in_default>
75
- <show_in_website>1</show_in_website>
76
- <show_in_store>1</show_in_store>
77
- <depends>
78
- <show_banner>1</show_banner>
79
- </depends>
80
- </privacy_message>
81
- </fields>
82
- </cookie_banner_settings>
83
- </groups>
84
- </eu_cookie_law>
85
- </sections>
86
- </config>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/layout/eucookielaw.xml CHANGED
@@ -2,9 +2,6 @@
2
  <layout>
3
  <default>
4
  <reference name="head">
5
- <action method="addCss">
6
- <stylesheet>css/eucookielaw.css</stylesheet>
7
- </action>
8
  <action method="addItem">
9
  <type>skin_js</type>
10
  <name>js/eucookielaw.js</name>
2
  <layout>
3
  <default>
4
  <reference name="head">
 
 
 
5
  <action method="addItem">
6
  <type>skin_js</type>
7
  <name>js/eucookielaw.js</name>
app/design/frontend/base/default/template/eucookielaw/js.phtml CHANGED
@@ -1,19 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php if (Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/show_banner')) : ?>
2
  <script type="text/javascript">
3
-
 
 
 
 
4
  var dropCookie = true;
5
  var cookieDuration = <?php echo Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/cookie_lifetime') ?>;
6
  var cookieName = 'complianceCookie';
7
  var cookieValue = 'on';
 
8
  var privacyUrl = '<?php echo $this->getUrl(Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/privacy_url')) ?>';
9
  var privacyMessage = '<?php echo Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/privacy_message') ?>';
10
  var privacyLinkText = '<?php echo Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/privacy_url_text') ?>';
 
11
 
12
  window.onload = function(){
13
  if(checkCookie(window.cookieName) != window.cookieValue){
14
  createDiv();
15
- }
 
 
 
 
16
  }
17
-
18
  </script>
19
  <?php endif ?>
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Academic Free License (AFL 3.0)
8
+ * that is bundled with this package in the file LICENSE_AFL.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/afl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magentocommerce.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magentocommerce.com for more information.
20
+ *
21
+ * @category design
22
+ * @package base_default
23
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
24
+ */
25
+ ?>
26
  <?php if (Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/show_banner')) : ?>
27
  <script type="text/javascript">
28
+ <?php if (Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/developer_mode')) : ?>
29
+ var devMode = true;
30
+ <?php else : ?>
31
+ var devMode = false;
32
+ <?php endif ?>
33
  var dropCookie = true;
34
  var cookieDuration = <?php echo Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/cookie_lifetime') ?>;
35
  var cookieName = 'complianceCookie';
36
  var cookieValue = 'on';
37
+ var css = '<?php echo preg_replace( "/\r|\n/", "", Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/css')) ?>';
38
  var privacyUrl = '<?php echo $this->getUrl(Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/privacy_url')) ?>';
39
  var privacyMessage = '<?php echo Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/privacy_message') ?>';
40
  var privacyLinkText = '<?php echo Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/privacy_url_text') ?>';
41
+ var fadeOutTime = <?php echo Mage::getStoreConfig('eu_cookie_law/cookie_banner_settings/fadeout') ?>;
42
 
43
  window.onload = function(){
44
  if(checkCookie(window.cookieName) != window.cookieValue){
45
  createDiv();
46
+ } else
47
+ {
48
+ if (devMode)
49
+ createDiv();
50
+ }
51
  }
 
52
  </script>
53
  <?php endif ?>
app/etc/modules/Creare_Eucookielaw.xml CHANGED
@@ -3,8 +3,8 @@
3
  <modules>
4
  <Creare_Eucookielaw>
5
  <active>true</active>
6
- <codePool>local</codePool>
7
- <version>1.0</version>
8
  </Creare_Eucookielaw>
9
  </modules>
10
  </config>
3
  <modules>
4
  <Creare_Eucookielaw>
5
  <active>true</active>
6
+ <codePool>community</codePool>
7
+ <version>1.0.0</version>
8
  </Creare_Eucookielaw>
9
  </modules>
10
  </config>
package.xml CHANGED
@@ -1,20 +1,27 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>creareeucookielaw</name>
4
- <version>0.1.1</version>
5
  <stability>stable</stability>
6
- <license>OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Add a discreet EU Cookie privacy banner to your website which shows up once in accordance with EU guidelines.</summary>
 
 
 
 
 
 
 
10
  <description>This module adds a very simple privacy policy banner to your website which shows up only once when the customer visits the site. This is in accordance with the latest EU Cookie Law.&#xD;
11
  &#xD;
12
  The banner text and link is fully customisable in the Magento administration area, and can be translated per store or website view.</description>
13
- <notes>No longer available for 1.3</notes>
14
- <authors><author><name>Adam Moss</name><user>CreareGroup</user><email>magento@creare.co.uk</email></author></authors>
15
- <date>2013-03-08</date>
16
- <time>11:28:38</time>
17
- <contents><target name="magelocal"><dir name="Creare"><dir name="Eucookielaw"><dir name="etc"><file name="adminhtml.xml" hash="0986fee5af8fe7c96b1541dacfc814ab"/><file name="config.xml" hash="7295833e6fef5edc937bbd8f16cf7768"/><file name="system.xml" hash="c77b4f402c77914ab3c0b0bea2f5a1ce"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Creare_Eucookielaw.xml" hash="c90e439bb6db42a6fbda93ef0256722a"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="eucookielaw"><file name="js.phtml" hash="6699019a7124c05c4fa7ce254076655c"/></dir></dir><dir name="layout"><file name="eucookielaw.xml" hash="b04b3ea67d122ca21dc03250c19022b3"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="eucookielaw.css" hash="c753c839803456db7d0f668c42c012d6"/></dir><dir name="js"><file name="eucookielaw.js" hash="86588ebc828a8f7f5f66bed27732efd1"/></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
- <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>creareeucookielaw</name>
4
+ <version>1.0.0</version>
5
  <stability>stable</stability>
6
+ <license uri="http://opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>An extremely lightweight, prototype-friendly cookie law banner extension for Magento. Includes a host of configurable options such as:&#xD;
10
+ &#xD;
11
+ Show or hide banner&#xD;
12
+ Link text&#xD;
13
+ Banner text&#xD;
14
+ Fade out delay&#xD;
15
+ Cookie lifetime&#xD;
16
+ CSS styles</summary>
17
  <description>This module adds a very simple privacy policy banner to your website which shows up only once when the customer visits the site. This is in accordance with the latest EU Cookie Law.&#xD;
18
  &#xD;
19
  The banner text and link is fully customisable in the Magento administration area, and can be translated per store or website view.</description>
20
+ <notes>First official version release.</notes>
21
+ <authors><author><name>Adam Moss</name><user>auto-converted</user><email>magento@creare.co.uk</email></author></authors>
22
+ <date>2013-11-12</date>
23
+ <time>15:59:52</time>
24
+ <contents><target name="magecommunity"><dir name="Creare"><dir name="Eucookielaw"><dir name="etc"><file name="adminhtml.xml" hash="0986fee5af8fe7c96b1541dacfc814ab"/><file name="config.xml" hash="4e9a59e1761f0ede8417edb44fe32e09"/><file name="system.xml" hash="9fd9938aec46d12f6c50642c45917d51"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Creare_Eucookielaw.xml" hash="4f7fef5525abddda68b6cf6d88e7da2c"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="eucookielaw"><file name="js.phtml" hash="fd4920ac050f2e9640c749da2a7340b6"/></dir></dir><dir name="layout"><file name="eucookielaw.xml" hash="9022ec5658479347ad2b107a2c0eb2aa"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="js"><file name="eucookielaw.js" hash="de191946f4509cd6f7230f9ad325b8a8"/></dir></dir></dir></dir></target></contents>
25
  <compatible/>
26
+ <dependencies/>
27
  </package>
skin/frontend/base/default/css/eucookielaw.css DELETED
@@ -1,2 +0,0 @@
1
- #cookie-law { background:#f7f7f7; }
2
- #cookie-law p { padding:5px 0; margin:0; }
 
 
skin/frontend/base/default/js/eucookielaw.js CHANGED
@@ -5,16 +5,37 @@ function createDiv(){
5
  var div = document.createElement('div');
6
  div.setAttribute('id','cookie-law');
7
  div.innerHTML = '<p>'+privacyMessage+' <a href="'+privacyUrl+'" rel="nofollow" title="'+privacyLinkText+'">'+privacyLinkText+'</a>.</p>';
8
-
 
9
  // bodytag.appendChild(div); // Adds the Cookie Law Banner just before the closing </body> tag
10
  // or
11
  bodytag.insertBefore(div,bodytag.firstChild); // Adds the Cookie Law Banner just after the opening <body>
12
 
13
- document.getElementsByTagName('body')[0].className+=' cookiebanner'; //Adds a class tothe <body> tag when the banner is visible
14
-
15
  createCookie(window.cookieName,window.cookieValue, window.cookieDuration); // Create the cookie
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  }
17
 
 
 
 
 
 
 
 
 
 
18
 
19
  function createCookie(name,value,days) {
20
  if (days) {
5
  var div = document.createElement('div');
6
  div.setAttribute('id','cookie-law');
7
  div.innerHTML = '<p>'+privacyMessage+' <a href="'+privacyUrl+'" rel="nofollow" title="'+privacyLinkText+'">'+privacyLinkText+'</a>.</p>';
8
+ appendCSS();
9
+
10
  // bodytag.appendChild(div); // Adds the Cookie Law Banner just before the closing </body> tag
11
  // or
12
  bodytag.insertBefore(div,bodytag.firstChild); // Adds the Cookie Law Banner just after the opening <body>
13
 
 
 
14
  createCookie(window.cookieName,window.cookieValue, window.cookieDuration); // Create the cookie
15
+
16
+ if (getFadeOutTime())
17
+ {
18
+ setTimeout("fadeOut()",getFadeOutTime());
19
+ }
20
+ }
21
+
22
+ function appendCSS(){
23
+ var head = document.head;
24
+ var style = document.createElement('style');
25
+ style.type = 'text/css';
26
+ style.appendChild(document.createTextNode(css));
27
+ head.appendChild(style);
28
  }
29
 
30
+ function fadeOut()
31
+ {
32
+ new Effect.Fade('cookie-law', { duration:1});
33
+ }
34
+
35
+ function getFadeOutTime()
36
+ {
37
+ return (fadeOutTime*1000);
38
+ }
39
 
40
  function createCookie(name,value,days) {
41
  if (days) {