Version Notes
Initial Release
Download this release
Release Info
Developer | Jan Strohmeier |
Extension | hankeme_cookiepolicy |
Version | 0.1.0 |
Comparing to | |
See all releases |
Version 0.1.0
- app/code/community/Hankeme/Cookiepolicy/Block/Layer.php +110 -0
- app/code/community/Hankeme/Cookiepolicy/Helper/Data.php +12 -0
- app/code/community/Hankeme/Cookiepolicy/Model/Policytypes.php +44 -0
- app/code/community/Hankeme/Cookiepolicy/etc/config.xml +66 -0
- app/code/community/Hankeme/Cookiepolicy/etc/system.xml +79 -0
- app/design/frontend/base/default/layout/hankeme_cookiepolicy.xml +18 -0
- app/design/frontend/base/default/template/hankeme/cookiepolicy/layer.phtml +52 -0
- app/etc/modules/Hankeme_Cookiepolicy.xml +19 -0
- package.xml +22 -0
app/code/community/Hankeme/Cookiepolicy/Block/Layer.php
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* @package Hankeme_Cookiepolicy
|
5 |
+
* @authors Jan Strohmeier [jan.strohmeier@hanke.me]
|
6 |
+
* @developers Jan Strohmeier [jan.strohmeier@hanke.me]
|
7 |
+
* @web http://www.hankeme.de
|
8 |
+
* @version 0.1.0
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
|
12 |
+
class Hankeme_Cookiepolicy_Block_Layer extends Mage_Core_Block_Template {
|
13 |
+
|
14 |
+
private $local_policies = array(
|
15 |
+
'AT' => 'opt_in',
|
16 |
+
'CZ' => 'opt_out',
|
17 |
+
'DK' => 'opt_in',
|
18 |
+
'FR' => 'opt_in',
|
19 |
+
'LT' => 'opt_in',
|
20 |
+
'NL' => 'opt_in',
|
21 |
+
'ES' => 'opt_out',
|
22 |
+
'DE' => 'opt_out',
|
23 |
+
'SE' => 'opt_in',
|
24 |
+
'GB' => 'opt_in',
|
25 |
+
'BG' => 'opt_out',
|
26 |
+
'FI' => 'opt_out',
|
27 |
+
'LU' => 'opt_out',
|
28 |
+
'SK' => 'opt_out',
|
29 |
+
);
|
30 |
+
|
31 |
+
private $policies = array(
|
32 |
+
1 => 'opt_in',
|
33 |
+
2 => 'opt_out',
|
34 |
+
3 => 'hint_once',
|
35 |
+
4 => 'recommended'
|
36 |
+
);
|
37 |
+
|
38 |
+
public function getLayer() {
|
39 |
+
|
40 |
+
if(Mage::getStoreConfig('cookiepolicy/basic_group/cookiepolicy_enabled')){
|
41 |
+
|
42 |
+
$policyconfig = Mage::getStoreConfig('cookiepolicy/basic_group/cookiepolicy_policy');
|
43 |
+
|
44 |
+
$policy = $this->policies[$policyconfig];
|
45 |
+
|
46 |
+
if($policy == 'recommended') {
|
47 |
+
if($country = Mage::getStoreConfig('general/country/default')) {
|
48 |
+
|
49 |
+
if(array_key_exists($country, $this->local_policies)) $policy = $this->local_policies[$country];
|
50 |
+
else $policy = 'opt_out';
|
51 |
+
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
if($policy) {
|
56 |
+
|
57 |
+
$hascookie = Mage::getModel('core/cookie')->get('hankeme_cookiepolicy') ? true : false;
|
58 |
+
if(!$hascookie) {
|
59 |
+
switch($policy) {
|
60 |
+
case 'opt_in':
|
61 |
+
|
62 |
+
$msg = Mage::getStoreConfig('cookiepolicy/basic_group/cookiepolicy_text') ? Mage::getStoreConfig('cookiepolicy/basic_group/cookiepolicy_text') : 'This Site uses Cookies to store temporary Information needed for proper Functioning. By clicking the Button below you agree to this fact. More Information is available on our <a href="%s">Cookie Policy Page</a>';
|
63 |
+
|
64 |
+
$button = Mage::getStoreConfig('cookiepolicy/basic_group/cookiepolicy_button_text') ? Mage::getStoreConfig('cookiepolicy/basic_group/cookiepolicy_button_text') : 'I Agree to the use of Cookies';
|
65 |
+
|
66 |
+
return array(
|
67 |
+
'message' => $msg,
|
68 |
+
'link' => Mage::getStoreConfig('web/default/cms_no_cookies'),
|
69 |
+
'ok_button' => $button,
|
70 |
+
'type' => 'opt_in'
|
71 |
+
);
|
72 |
+
|
73 |
+
break;
|
74 |
+
case 'opt_out':
|
75 |
+
|
76 |
+
$msg = Mage::getStoreConfig('cookiepolicy/basic_group/cookiepolicy_text') ? Mage::getStoreConfig('cookiepolicy/basic_group/cookiepolicy_text') : 'This Site uses Cookies to store temporary Information needed for proper Functioning. If you do not agree to this fact you can disable Cookies in your Browser Settings. However, in this Case you will not be able to use this Site. More Information is available on our <a href="%s">Cookie Policy Page</a>';
|
77 |
+
|
78 |
+
$button = Mage::getStoreConfig('cookiepolicy/basic_group/cookiepolicy_button_text') ? Mage::getStoreConfig('cookiepolicy/basic_group/cookiepolicy_button_text') : 'Hide Message';
|
79 |
+
|
80 |
+
return array(
|
81 |
+
'message' => $msg,
|
82 |
+
'link' => Mage::getStoreConfig('web/default/cms_no_cookies'),
|
83 |
+
'ok_button' => $button,
|
84 |
+
'type' => 'opt_out'
|
85 |
+
);
|
86 |
+
|
87 |
+
|
88 |
+
break;
|
89 |
+
case 'hint_once':
|
90 |
+
$msg = Mage::getStoreConfig('cookiepolicy/basic_group/cookiepolicy_text') ? Mage::getStoreConfig('cookiepolicy/basic_group/cookiepolicy_text') : 'This Site uses Cookies to store temporary Information needed for proper Functioning. If you do not agree to this fact you can disable Cookies in your Browser Settings. However, in this Case you will not be able to use this Site. More Information is available on our <a href="%s">Cookie Policy Page</a>';
|
91 |
+
|
92 |
+
//set cookie, layer will only be shown once
|
93 |
+
Mage::getModel('core/cookie')->set('hankeme_cookiepolicy', 1);
|
94 |
+
|
95 |
+
return array(
|
96 |
+
'message' => $msg,
|
97 |
+
'link' => Mage::getStoreConfig('web/default/cms_no_cookies'),
|
98 |
+
'ok_button' => false,
|
99 |
+
'type' => 'hint_once'
|
100 |
+
);
|
101 |
+
break;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
return false;
|
108 |
+
}
|
109 |
+
|
110 |
+
}
|
app/code/community/Hankeme/Cookiepolicy/Helper/Data.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Hankeme_Cookiepolicy
|
4 |
+
* @authors Jan Strohmeier [jan.strohmeier@hanke.me]
|
5 |
+
* @developers Jan Strohmeier [jan.strohmeier@hanke.me]
|
6 |
+
* @web http://www.hankeme.de
|
7 |
+
* @version 0.1.0
|
8 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
9 |
+
*/
|
10 |
+
class Hankeme_Cookiepolicy_Helper_Data extends Mage_Core_Helper_Abstract
|
11 |
+
{
|
12 |
+
}
|
app/code/community/Hankeme/Cookiepolicy/Model/Policytypes.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Hankeme_Cookiepolicy
|
4 |
+
* @authors Jan Strohmeier [jan.strohmeier@hanke.me]
|
5 |
+
* @developers Jan Strohmeier [jan.strohmeier@hanke.me]
|
6 |
+
* @web http://www.hankeme.de
|
7 |
+
* @version 0.1.0
|
8 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
9 |
+
*/
|
10 |
+
|
11 |
+
class Hankeme_Cookiepolicy_Model_Policytypes
|
12 |
+
{
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Options getter
|
16 |
+
*
|
17 |
+
* @return array
|
18 |
+
*/
|
19 |
+
public function toOptionArray()
|
20 |
+
{
|
21 |
+
return array(
|
22 |
+
array('value' => 1, 'label'=>Mage::helper('hankeme_cookiepolicy')->__('Opt-In')),
|
23 |
+
array('value' => 2, 'label'=>Mage::helper('hankeme_cookiepolicy')->__('Opt-Out')),
|
24 |
+
array('value' => 3, 'label'=>Mage::helper('hankeme_cookiepolicy')->__('Hint Once')),
|
25 |
+
array('value' => 4, 'label'=>Mage::helper('hankeme_cookiepolicy')->__('Recommended')),
|
26 |
+
);
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Get options in "key-value" format
|
31 |
+
*
|
32 |
+
* @return array
|
33 |
+
*/
|
34 |
+
public function toArray()
|
35 |
+
{
|
36 |
+
return array(
|
37 |
+
1 => Mage::helper('hankeme_cookiepolicy')->__('Opt-In'),
|
38 |
+
2 => Mage::helper('hankeme_cookiepolicy')->__('Opt-Out'),
|
39 |
+
3 => Mage::helper('hankeme_cookiepolicy')->__('Hint Once'),
|
40 |
+
4 => Mage::helper('hankeme_cookiepolicy')->__('Recommended')
|
41 |
+
);
|
42 |
+
}
|
43 |
+
|
44 |
+
}
|
app/code/community/Hankeme/Cookiepolicy/etc/config.xml
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @package Hankeme_Cookiepolicy
|
5 |
+
* @authors Jan Strohmeier [jan.strohmeier@hanke.me]
|
6 |
+
* @developers Jan Strohmeier [jan.strohmeier@hanke.me]
|
7 |
+
* @web http://www.hankeme.de
|
8 |
+
* @version 0.1.0
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
-->
|
12 |
+
<config>
|
13 |
+
<modules>
|
14 |
+
<Hankeme_Cookiepolicy>
|
15 |
+
<version>0.1.0</version>
|
16 |
+
</Hankeme_Cookiepolicy>
|
17 |
+
</modules>
|
18 |
+
<global>
|
19 |
+
<helpers>
|
20 |
+
<hankeme_cookiepolicy><class>Hankeme_Cookiepolicy_Helper</class></hankeme_cookiepolicy>
|
21 |
+
</helpers>
|
22 |
+
<blocks>
|
23 |
+
<hankeme_cookiepolicy>
|
24 |
+
<class>Hankeme_Cookiepolicy_Block</class>
|
25 |
+
</hankeme_cookiepolicy>
|
26 |
+
</blocks>
|
27 |
+
<models>
|
28 |
+
<hankeme_cookiepolicy>
|
29 |
+
<class>Hankeme_Cookiepolicy_Model</class>
|
30 |
+
</hankeme_cookiepolicy>
|
31 |
+
</models>
|
32 |
+
</global>
|
33 |
+
<frontend>
|
34 |
+
<layout>
|
35 |
+
<updates>
|
36 |
+
<hankeme_cookiepolicy>
|
37 |
+
<file>hankeme_cookiepolicy.xml</file>
|
38 |
+
</hankeme_cookiepolicy>
|
39 |
+
</updates>
|
40 |
+
</layout>
|
41 |
+
</frontend>
|
42 |
+
<adminhtml>
|
43 |
+
<acl>
|
44 |
+
<resources>
|
45 |
+
<all>
|
46 |
+
<title>Allow Everything</title>
|
47 |
+
</all>
|
48 |
+
<admin>
|
49 |
+
<children>
|
50 |
+
<system>
|
51 |
+
<children>
|
52 |
+
<config>
|
53 |
+
<children>
|
54 |
+
<cookiepolicy>
|
55 |
+
<title>Administer Hankeme_Cookiepolicy</title>
|
56 |
+
</cookiepolicy>
|
57 |
+
</children>
|
58 |
+
</config>
|
59 |
+
</children>
|
60 |
+
</system>
|
61 |
+
</children>
|
62 |
+
</admin>
|
63 |
+
</resources>
|
64 |
+
</acl>
|
65 |
+
</adminhtml>
|
66 |
+
</config>
|
app/code/community/Hankeme/Cookiepolicy/etc/system.xml
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @package Hankeme_Cookiepolicy
|
5 |
+
* @authors Jan Strohmeier [jan.strohmeier@hanke.me]
|
6 |
+
* @developers Jan Strohmeier [jan.strohmeier@hanke.me]
|
7 |
+
* @web http://www.hankeme.de
|
8 |
+
* @version 0.1.0
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
-->
|
12 |
+
<config>
|
13 |
+
<tabs>
|
14 |
+
<hme module="hankeme_cookiepolicy">
|
15 |
+
<label>HankeME</label>
|
16 |
+
<sort_order>105</sort_order>
|
17 |
+
</hme>
|
18 |
+
</tabs>
|
19 |
+
<sections>
|
20 |
+
<cookiepolicy module="hankeme_cookiepolicy" translate="label">
|
21 |
+
<label>Cookie Policy Configuration</label>
|
22 |
+
<sort_order>500</sort_order>
|
23 |
+
<show_in_default>1</show_in_default>
|
24 |
+
<show_in_website>1</show_in_website>
|
25 |
+
<show_in_store>1</show_in_store>
|
26 |
+
<tab>hme</tab>
|
27 |
+
<groups>
|
28 |
+
<basic_group translate="label">
|
29 |
+
<label>Basic Settings</label>
|
30 |
+
<comment></comment>
|
31 |
+
<sort_order>10</sort_order>
|
32 |
+
<show_in_default>1</show_in_default>
|
33 |
+
<show_in_website>1</show_in_website>
|
34 |
+
<show_in_store>1</show_in_store>
|
35 |
+
<fields>
|
36 |
+
<cookiepolicy_enabled translate="label tooltip comment">
|
37 |
+
<label>Cookie Policy aktivieren</label>
|
38 |
+
<frontend_type>select</frontend_type>
|
39 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
40 |
+
<sort_order>0</sort_order>
|
41 |
+
<show_in_default>1</show_in_default>
|
42 |
+
<show_in_website>1</show_in_website>
|
43 |
+
<show_in_store>1</show_in_store>
|
44 |
+
<comment>This will enable a Layer with a customer Message regarding the use of Cookies on your Site</comment>
|
45 |
+
</cookiepolicy_enabled>
|
46 |
+
<cookiepolicy_policy translate="label tooltip comment">
|
47 |
+
<label>Cookie Policy</label>
|
48 |
+
<frontend_type>select</frontend_type>
|
49 |
+
<source_model>hankeme_cookiepolicy/policytypes</source_model>
|
50 |
+
<sort_order>1</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>This will determine which kind of cookie policy will be used on the site. 'Opt-In' will display an overlay which will only allow the user to use the site if he agrees to your cookie policy. 'Opt-Out' will display a message at the footer of every page that can be closed (this option is most commonly used). 'Hint Once' will display a message at the footer only on first page visit. 'Recommended' will use the settings recommended for the country set up as the store's default country. This setting will default to 'Opt-Out' if no recommendations for your country exist. Please note that using 'Recommended' settings does NOT GUARANTEE any legal compliance.</comment>
|
55 |
+
</cookiepolicy_policy>
|
56 |
+
<cookiepolicy_text translate="label tooltip comment">
|
57 |
+
<label>Cookie Policy Custom Text</label>
|
58 |
+
<frontend_type>textarea</frontend_type>
|
59 |
+
<sort_order>10</sort_order>
|
60 |
+
<show_in_default>1</show_in_default>
|
61 |
+
<show_in_website>1</show_in_website>
|
62 |
+
<show_in_store>1</show_in_store>
|
63 |
+
<comment>You can override the default -This Site uses Cookies- Layer Content here. You can also use a local translate.csv in your template to adapt the Text</comment>
|
64 |
+
</cookiepolicy_text>
|
65 |
+
<cookiepolicy_button_text translate="label tooltip comment">
|
66 |
+
<label>Cookie Policy Custom Button Text</label>
|
67 |
+
<frontend_type>text</frontend_type>
|
68 |
+
<sort_order>20</sort_order>
|
69 |
+
<show_in_default>1</show_in_default>
|
70 |
+
<show_in_website>1</show_in_website>
|
71 |
+
<show_in_store>1</show_in_store>
|
72 |
+
<comment>You can override the default Button Text here. You can also use a local translate.csv in your template to adapt the Text</comment>
|
73 |
+
</cookiepolicy_button_text>
|
74 |
+
</fields>
|
75 |
+
</basic_group>
|
76 |
+
</groups>
|
77 |
+
</cookiepolicy>
|
78 |
+
</sections>
|
79 |
+
</config>
|
app/design/frontend/base/default/layout/hankeme_cookiepolicy.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @package Hankeme_Cookiepolicy
|
5 |
+
* @authors Jan Strohmeier [jan.strohmeier@hanke.me]
|
6 |
+
* @developers Jan Strohmeier [jan.strohmeier@hanke.me]
|
7 |
+
* @web http://www.hankeme.de
|
8 |
+
* @version 0.1.0
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
-->
|
12 |
+
<layout version="0.1.0">
|
13 |
+
<default>
|
14 |
+
<reference name="before_body_end">
|
15 |
+
<block type="hankeme_cookiepolicy/layer" name="hankeme.cookiepolicy.layer" template="hankeme/cookiepolicy/layer.phtml" />
|
16 |
+
</reference>
|
17 |
+
</default>
|
18 |
+
</layout>
|
app/design/frontend/base/default/template/hankeme/cookiepolicy/layer.phtml
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* @package Hankeme_Cookiepolicy
|
4 |
+
* @authors Jan Strohmeier [jan.strohmeier@hanke.me]
|
5 |
+
* @developers Jan Strohmeier [jan.strohmeier@hanke.me]
|
6 |
+
* @web http://www.hankeme.de
|
7 |
+
* @version 0.1.0
|
8 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
9 |
+
*/
|
10 |
+
?>
|
11 |
+
<?php if($layer = $this->getLayer()) : ?>
|
12 |
+
|
13 |
+
<?php if($layer['type'] == 'opt_in') : ?>
|
14 |
+
|
15 |
+
<script type="text/javascript">
|
16 |
+
document.observe("dom:loaded", function() {
|
17 |
+
var text = '<?php echo $this->__($layer["message"], $layer["link"]); ?>';
|
18 |
+
Dialog.alert(
|
19 |
+
text,
|
20 |
+
{
|
21 |
+
className: "cookielayer",
|
22 |
+
width:540,
|
23 |
+
okLabel: "<?php echo $this->__($layer['ok_button']);?>",
|
24 |
+
ok: function(win) {
|
25 |
+
document.cookie = "hankeme_cookiepolicy=1"; return true;
|
26 |
+
}
|
27 |
+
}
|
28 |
+
);
|
29 |
+
});
|
30 |
+
</script>
|
31 |
+
|
32 |
+
<?php elseif($layer['type'] == 'opt_out') : ?>
|
33 |
+
|
34 |
+
<div class="hankeme_cookiepolicy_optout_info" id="hankeme_cookiepolicy_optout_info" style="display:block; position:fixed; bottom:0; text-align:center; padding: 10px; width:100%; border-top:1px solid #cccccc; background: #eeeeee;">
|
35 |
+
<p>
|
36 |
+
<?php echo $this->__($layer["message"], $layer["link"]); ?>
|
37 |
+
</p>
|
38 |
+
<a class="button" onclick="document.cookie='hankeme_cookiepolicy=1'; $('hankeme_cookiepolicy_optout_info').hide();" href="javascript:void(0)">
|
39 |
+
<span><span><?php echo $this->__($layer['ok_button']);?></span></span>
|
40 |
+
</a>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<?php elseif($layer['type'] == 'hint_once') : ?>
|
44 |
+
|
45 |
+
<div class="hankeme_cookiepolicy_optout_info" id="hankeme_cookiepolicy_optout_info" style="display:block; position:fixed; bottom:0; text-align:center; padding: 10px; width:100%; border-top:1px solid #cccccc; background: #eeeeee;">
|
46 |
+
<p>
|
47 |
+
<?php echo $this->__($layer["message"], $layer["link"]); ?>
|
48 |
+
</p>
|
49 |
+
</div>
|
50 |
+
|
51 |
+
<?php endif; ?>
|
52 |
+
<?php endif; ?>
|
app/etc/modules/Hankeme_Cookiepolicy.xml
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* @package Hankeme_Cookiepolicy
|
5 |
+
* @authors Jan Strohmeier [jan.strohmeier@hanke.me]
|
6 |
+
* @developers Jan Strohmeier [jan.strohmeier@hanke.me]
|
7 |
+
* @web http://www.hankeme.de
|
8 |
+
* @version 0.1.0
|
9 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
10 |
+
*/
|
11 |
+
-->
|
12 |
+
<config>
|
13 |
+
<modules>
|
14 |
+
<Hankeme_Cookiepolicy>
|
15 |
+
<active>true</active>
|
16 |
+
<codePool>community</codePool>
|
17 |
+
</Hankeme_Cookiepolicy>
|
18 |
+
</modules>
|
19 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>hankeme_cookiepolicy</name>
|
4 |
+
<version>0.1.0</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>Adds Info Layers about Site Cookies according to European Laws (E-Privacy 2002/58/EG)</summary>
|
10 |
+
<description>This Extension adds Info Layers about Site Cookies according to European Laws (E-Privacy 2002/58/EG). Settings allow Users to either 'opt-in' or 'opt-out' to the Acceptance of Cookies.
|
11 |
+

|
12 |
+
Cookie Policy can be set up individually on Store-View Level. Settings include an Option 'Use recommended Settings' that will apply the recommended Settings for the Store's default Country.
|
13 |
+

|
14 |
+
</description>
|
15 |
+
<notes>Initial Release</notes>
|
16 |
+
<authors><author><name>Jan Strohmeier</name><user>hankeme_de</user><email>jan.strohmeier@hanke.me</email></author></authors>
|
17 |
+
<date>2014-11-04</date>
|
18 |
+
<time>14:41:41</time>
|
19 |
+
<contents><target name="magecommunity"><dir name="Hankeme"><dir name="Cookiepolicy"><dir name="Block"><file name="Layer.php" hash="338ee38660c32091eb169c6c9d02ca63"/></dir><dir name="Helper"><file name="Data.php" hash="04c7e2ebe836417f76ee0385aff9dffe"/></dir><dir name="Model"><file name="Policytypes.php" hash="c219839b46e1aa35ad8e3b7559c3e469"/></dir><dir name="etc"><file name="config.xml" hash="c9821a05fb9372e1d3adb93c7a68ab49"/><file name="system.xml" hash="2afbe92caaecf9e94f7bdfa34edc74fd"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="hankeme_cookiepolicy.xml" hash="8d0cd02bffaa4b5fb18c1bf45e3f5e01"/></dir><dir name="template"><dir name="hankeme"><dir name="cookiepolicy"><file name="layer.phtml" hash="3bde955262182cc9d8868f51f04bfe70"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Hankeme_Cookiepolicy.xml" hash="66f1f9138978419d897ef802c3b5d399"/></dir></target></contents>
|
20 |
+
<compatible/>
|
21 |
+
<dependencies><required><php><min>5.2.0</min><max>5.6.0</max></php></required></dependencies>
|
22 |
+
</package>
|