Version Notes
Initial Release
Download this release
Release Info
Developer | Robert Kent |
Extension | creareeucookielaw |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/local/Creare/Eucookielaw/etc/adminhtml.xml +26 -0
- app/code/local/Creare/Eucookielaw/etc/config.xml +28 -0
- app/code/local/Creare/Eucookielaw/etc/system.xml +86 -0
- app/design/frontend/base/default/layout/eucookielaw.xml +16 -0
- app/design/frontend/base/default/template/eucookielaw/js.phtml +19 -0
- app/etc/modules/Creare_Eucookielaw.xml +10 -0
- package.xml +20 -0
- skin/frontend/base/default/css/eucookielaw.css +2 -0
- skin/frontend/base/default/js/eucookielaw.js +44 -0
app/code/local/Creare/Eucookielaw/etc/adminhtml.xml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<acl>
|
4 |
+
<resources>
|
5 |
+
<all>
|
6 |
+
<title>Allow Everything</title>
|
7 |
+
</all>
|
8 |
+
<admin>
|
9 |
+
<children>
|
10 |
+
<system>
|
11 |
+
<children>
|
12 |
+
<config>
|
13 |
+
<children>
|
14 |
+
<eu_cookie_law translate="title">
|
15 |
+
<title>EU Cookie Law</title>
|
16 |
+
<sort_order>100</sort_order>
|
17 |
+
</eu_cookie_law>
|
18 |
+
</children>
|
19 |
+
</config>
|
20 |
+
</children>
|
21 |
+
</system>
|
22 |
+
</children>
|
23 |
+
</admin>
|
24 |
+
</resources>
|
25 |
+
</acl>
|
26 |
+
</config>
|
app/code/local/Creare/Eucookielaw/etc/config.xml
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Creare_Eucookielaw>
|
5 |
+
<version>0.1.0</version>
|
6 |
+
</Creare_Eucookielaw>
|
7 |
+
</modules>
|
8 |
+
<frontend>
|
9 |
+
<layout>
|
10 |
+
<updates>
|
11 |
+
<eucookielaw>
|
12 |
+
<file>eucookielaw.xml</file>
|
13 |
+
</eucookielaw>
|
14 |
+
</updates>
|
15 |
+
</layout>
|
16 |
+
</frontend>
|
17 |
+
<default>
|
18 |
+
<eu_cookie_law>
|
19 |
+
<cookie_banner_settings>
|
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>
|
28 |
+
</config>
|
app/code/local/Creare/Eucookielaw/etc/system.xml
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
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>
|
11 |
+
<params/>
|
12 |
+
</action>
|
13 |
+
<block type="core/template" template="eucookielaw/js.phtml" />
|
14 |
+
</reference>
|
15 |
+
</default>
|
16 |
+
</layout>
|
app/design/frontend/base/default/template/eucookielaw/js.phtml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 ?>
|
app/etc/modules/Creare_Eucookielaw.xml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
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>
|
package.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>creareeucookielaw</name>
|
4 |
+
<version>0.1.0</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.
|
11 |
+

|
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>Initial Release</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>10:49:28</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>
|
skin/frontend/base/default/css/eucookielaw.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
#cookie-law { background:#f7f7f7; }
|
2 |
+
#cookie-law p { padding:5px 0; margin:0; }
|
skin/frontend/base/default/js/eucookielaw.js
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// Creare's 'Implied Consent' EU Cookie Law Banner v:2.2
|
2 |
+
|
3 |
+
function createDiv(){
|
4 |
+
var bodytag = document.getElementsByTagName('body')[0];
|
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) {
|
21 |
+
var date = new Date();
|
22 |
+
date.setTime(date.getTime()+(days*24*60*60*1000));
|
23 |
+
var expires = "; expires="+date.toGMTString();
|
24 |
+
}
|
25 |
+
else var expires = "";
|
26 |
+
if(window.dropCookie) {
|
27 |
+
document.cookie = name+"="+value+expires+"; path=/";
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
function checkCookie(name) {
|
32 |
+
var nameEQ = name + "=";
|
33 |
+
var ca = document.cookie.split(';');
|
34 |
+
for(var i=0;i < ca.length;i++) {
|
35 |
+
var c = ca[i];
|
36 |
+
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
37 |
+
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
38 |
+
}
|
39 |
+
return null;
|
40 |
+
}
|
41 |
+
|
42 |
+
function eraseCookie(name) {
|
43 |
+
createCookie(name,"",-1);
|
44 |
+
}
|