Version Notes
First stable version
Download this release
Release Info
Developer | Townside |
Extension | Townside_CookieBar |
Version | 0.0.1 |
Comparing to | |
See all releases |
Version 0.0.1
- app/code/local/Townside/CookieBar/Helper/Data.php +5 -0
- app/code/local/Townside/CookieBar/etc/adminhtml.xml +27 -0
- app/code/local/Townside/CookieBar/etc/config.xml +57 -0
- app/code/local/Townside/CookieBar/etc/system.xml +60 -0
- app/design/frontend/base/default/layout/townside/cookiebar.xml +17 -0
- app/design/frontend/base/default/template/townside/cookiebar.phtml +25 -0
- app/etc/modules/Townside_CookieBar.xml +14 -0
- package.xml +18 -0
- skin/frontend/base/default/css/townside/cookiebar.css +6 -0
app/code/local/Townside/CookieBar/Helper/Data.php
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Townside_CookieBar_Helper_Data extends Mage_Core_Helper_Abstract
|
3 |
+
{
|
4 |
+
|
5 |
+
}
|
app/code/local/Townside/CookieBar/etc/adminhtml.xml
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
|
4 |
+
<acl>
|
5 |
+
<resources>
|
6 |
+
<all>
|
7 |
+
<title>Allow Everything</title>
|
8 |
+
</all>
|
9 |
+
<admin>
|
10 |
+
<children>
|
11 |
+
<system>
|
12 |
+
<children>
|
13 |
+
<config>
|
14 |
+
<children>
|
15 |
+
<townsidecookiebar translate="title" module="townsidecookiebar">
|
16 |
+
<title>Cookie Bar Setting</title>
|
17 |
+
<sort_order>-1</sort_order>
|
18 |
+
</townsidecookiebar>
|
19 |
+
</children>
|
20 |
+
</config>
|
21 |
+
</children>
|
22 |
+
</system>
|
23 |
+
</children>
|
24 |
+
</admin>
|
25 |
+
</resources>
|
26 |
+
</acl>
|
27 |
+
</config>
|
app/code/local/Townside/CookieBar/etc/config.xml
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
|
3 |
+
<!-- The root node for Magento module configuration -->
|
4 |
+
<config>
|
5 |
+
|
6 |
+
<!--
|
7 |
+
The module's node contains basic
|
8 |
+
information about each Magento module
|
9 |
+
-->
|
10 |
+
<modules>
|
11 |
+
|
12 |
+
<!--
|
13 |
+
This must exactly match the namespace and module's folder
|
14 |
+
names, with directory separators replaced by underscores
|
15 |
+
-->
|
16 |
+
<Townside_CookieBar>
|
17 |
+
|
18 |
+
<!-- The version of our module, starting at 0.0.1 -->
|
19 |
+
<version>0.0.1</version>
|
20 |
+
|
21 |
+
</Townside_CookieBar>
|
22 |
+
|
23 |
+
</modules>
|
24 |
+
|
25 |
+
<frontend>
|
26 |
+
<layout>
|
27 |
+
<updates>
|
28 |
+
<townsidecookiebar>
|
29 |
+
<file>townside/cookiebar.xml</file>
|
30 |
+
</townsidecookiebar>
|
31 |
+
</updates>
|
32 |
+
</layout>
|
33 |
+
</frontend>
|
34 |
+
|
35 |
+
<global>
|
36 |
+
|
37 |
+
|
38 |
+
<helpers>
|
39 |
+
<townsidecookiebar>
|
40 |
+
<class>Townside_CookieBar_Helper</class>
|
41 |
+
</townsidecookiebar>
|
42 |
+
</helpers>
|
43 |
+
</global>
|
44 |
+
|
45 |
+
<default>
|
46 |
+
<townsidecookiebar>
|
47 |
+
<general>
|
48 |
+
<enabled>0</enabled>
|
49 |
+
<backgroundColour>#efefe</backgroundColour>
|
50 |
+
<textColour>#333333</textColour>
|
51 |
+
<buttonBackgroundColour>#0B4884</buttonBackgroundColour>
|
52 |
+
<buttonTextColour>#ffffff</buttonTextColour>
|
53 |
+
<text>This website requires cookies to provide all of its features. By using our website, you agree to our use of cookies.</text>
|
54 |
+
</general>
|
55 |
+
</townsidecookiebar>
|
56 |
+
</default>
|
57 |
+
</config>
|
app/code/local/Townside/CookieBar/etc/system.xml
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<config>
|
3 |
+
<tabs>
|
4 |
+
<townside translate="label">
|
5 |
+
<label><![CDATA[<div><img src="https://www.townside.co.uk/wp-content/themes/infocus/images/logo.png" alt="Townside" title="Townside" width="103" height="29" style="display:block;" /></div>]]></label>
|
6 |
+
<sort_order>100</sort_order>
|
7 |
+
</townside>
|
8 |
+
</tabs>
|
9 |
+
<sections>
|
10 |
+
<townsidecookiebar translate="label" module="townsidecookiebar">
|
11 |
+
<label>Cookie Bar</label>
|
12 |
+
<tab>townside</tab>
|
13 |
+
<sort_order>100</sort_order>
|
14 |
+
<show_in_default>1</show_in_default>
|
15 |
+
<show_in_website>1</show_in_website>
|
16 |
+
<show_in_store>1</show_in_store>
|
17 |
+
<groups>
|
18 |
+
<general translate="label">
|
19 |
+
<label>General</label>
|
20 |
+
<frontend_type>text</frontend_type>
|
21 |
+
<sort_order>1</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 |
+
<enabled translate="label comment">
|
27 |
+
<label>Enabled</label>
|
28 |
+
<comment>Show or hide cookie bar</comment>
|
29 |
+
<frontend_type>select</frontend_type>
|
30 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
31 |
+
<sort_order>1</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 |
+
</enabled>
|
36 |
+
<learn translate="label comment">
|
37 |
+
<label>Learn more link</label>
|
38 |
+
<comment>CMS page which learn more link points to</comment>
|
39 |
+
<frontend_type>select</frontend_type>
|
40 |
+
<source_model>adminhtml/system_config_source_cms_page</source_model>
|
41 |
+
<sort_order>2</sort_order>
|
42 |
+
<show_in_default>1</show_in_default>
|
43 |
+
<show_in_website>1</show_in_website>
|
44 |
+
<show_in_store>1</show_in_store>
|
45 |
+
</learn>
|
46 |
+
|
47 |
+
<text translate="label comment">
|
48 |
+
<label>Text</label>
|
49 |
+
<frontend_type>textarea</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 |
+
</text>
|
55 |
+
</fields>
|
56 |
+
</general>
|
57 |
+
</groups>
|
58 |
+
</townsidecookiebar>
|
59 |
+
</sections>
|
60 |
+
</config>
|
app/design/frontend/base/default/layout/townside/cookiebar.xml
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.0">
|
3 |
+
|
4 |
+
<default>
|
5 |
+
<reference name="after_body_start" >
|
6 |
+
<block type="core/template" name="townsidecookiebar" template="townside/cookiebar.phtml" />
|
7 |
+
</reference>
|
8 |
+
<reference name="head" >
|
9 |
+
<action method="addItem" ifconfig="townsidecookiebar/general/enabled">
|
10 |
+
<type>skin_css</type>
|
11 |
+
<name>css/townside/cookiebar.css</name>
|
12 |
+
</action>
|
13 |
+
</reference>
|
14 |
+
</default>
|
15 |
+
|
16 |
+
|
17 |
+
</layout>
|
app/design/frontend/base/default/template/townside/cookiebar.phtml
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php if(Mage::getStoreConfig('townsidecookiebar/general/enabled') == 1 && Mage::getStoreConfig('web/cookie/cookie_restriction') == 0 && !isset($_COOKIE['townside_accept_cookies'])){ ?>
|
2 |
+
<div id="townside-cookiebar-outer">
|
3 |
+
<div class="page main townside-cookiebar-inner">
|
4 |
+
|
5 |
+
<div class="actions townside-cookiebar-btn-con">
|
6 |
+
<button class="townside-cookiebar-btn-accept" onclick="clickTownsideCookieBar()"><?php echo $this->__('OKAY'); ?></button>
|
7 |
+
<a class="townside-cookiebar-learn" href="<?php echo Mage::getStoreConfig('townsidecookiebar/general/learn') ?>"><span><?php echo $this->__('Learn more'); ?></span></a>
|
8 |
+
</div>
|
9 |
+
<div class="townside-cookiebar-text"><?php echo Mage::getStoreConfig('townsidecookiebar/general/text') ?></div>
|
10 |
+
<div class="clear"></div>
|
11 |
+
</div>
|
12 |
+
</div>
|
13 |
+
<script type="text/javascript">
|
14 |
+
/* <![CDATA[ */
|
15 |
+
function clickTownsideCookieBar() {
|
16 |
+
Mage.Cookies.set('townside_accept_cookies', '{"1":1}', new Date(new Date().getTime() + 31536000 * 1000));
|
17 |
+
if (Mage.Cookies.get('townside_accept_cookies')) {
|
18 |
+
$('townside-cookiebar-outer').hide();
|
19 |
+
//$$('.townside-cookiebar-outer').setStyle({ display:'none' });
|
20 |
+
}
|
21 |
+
|
22 |
+
}
|
23 |
+
/* ]]> */
|
24 |
+
</script>
|
25 |
+
<?php } ?>
|
app/etc/modules/Townside_CookieBar.xml
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
3 |
+
<modules>
|
4 |
+
<Townside_CookieBar>
|
5 |
+
|
6 |
+
<!-- Whether our module is active: true or false -->
|
7 |
+
<active>true</active>
|
8 |
+
|
9 |
+
<!-- Which code pool to use: core, community or local -->
|
10 |
+
<codePool>local</codePool>
|
11 |
+
|
12 |
+
</Townside_CookieBar>
|
13 |
+
</modules>
|
14 |
+
</config>
|
package.xml
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<package>
|
3 |
+
<name>Townside_CookieBar</name>
|
4 |
+
<version>0.0.1</version>
|
5 |
+
<stability>stable</stability>
|
6 |
+
<license>OSL v3.0</license>
|
7 |
+
<channel>community</channel>
|
8 |
+
<extends/>
|
9 |
+
<summary>EU cookie compliance notification bar for Magento CE.</summary>
|
10 |
+
<description>European union cookie compliance notification bar for Magento Community Edition.</description>
|
11 |
+
<notes>First stable version</notes>
|
12 |
+
<authors><author><name>Townside</name><user>tonyfox</user><email>tony@townside.co.uk</email></author></authors>
|
13 |
+
<date>2013-11-11</date>
|
14 |
+
<time>17:26:19</time>
|
15 |
+
<contents><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="townside"><file name="cookiebar.css" hash="134c1922b4a50ddfcfa0d75358d86044"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Townside"><dir name="CookieBar"><dir name="Helper"><file name="Data.php" hash="9b1ed4e05d218a4fd013b09438b95e9d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="e2c4da882b7f74b377bf84cbcf47d242"/><file name="config.xml" hash="66544403f54d68e2bdd55342d40a5a64"/><file name="system.xml" hash="79bb0b90b769e8df28151ef940aa13f5"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="townside"><file name="cookiebar.xml" hash="f621e02baa37b60607378576ade91aff"/></dir></dir><dir name="template"><dir name="townside"><file name="cookiebar.phtml" hash="029de578daee24994a0e7ddc5cf0b556"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Townside_CookieBar.xml" hash="92e7f7518fc4c1077dc3895cbd29c6c9"/></dir></target></contents>
|
16 |
+
<compatible/>
|
17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
+
</package>
|
skin/frontend/base/default/css/townside/cookiebar.css
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#townside-cookiebar-outer {background-color: #efefef;}
|
2 |
+
.townside-cookiebar-inner {background: inherit; padding: 10px 20px; min-height: 25px;}
|
3 |
+
.townside-cookiebar-btn-con {width: 140px; float: right; text-align: right; margin-left: 20px;}
|
4 |
+
.townside-cookiebar-btn-accept {padding: 5px 10px; color: #fff; background: #0B4884; border: 0; margin-right: 10px; cursor: pointer;}
|
5 |
+
.townside-cookiebar-learn {cursor: pointer;}
|
6 |
+
.townside-cookiebar-text {color: #333; padding: 3px 0;}
|