Zero1_Cookiealert - Version 1.0.0

Version Notes

First release.

Download this release

Release Info

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


Version 1.0.0

app/code/community/Zero1/Cookiealert/Block/Cookiealert.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Zero1_Cookiealert_Block_Cookiealert extends Mage_Core_Block_Template
3
+ {
4
+ protected $_cookiealert;
5
+
6
+ protected function _prepareLayout()
7
+ {
8
+ parent::_prepareLayout();
9
+
10
+ $this->_cookiealert = Mage::getSingleton('cookiealert/cookiealert');
11
+ }
12
+
13
+ public function getCloseUrl()
14
+ {
15
+ return $this->_cookiealert->getCloseUrl();
16
+ }
17
+
18
+ public function getIsClosed()
19
+ {
20
+ return $this->_cookiealert->getIsClosed();
21
+ }
22
+
23
+ public function getCmsPageUrl()
24
+ {
25
+ return $this->_cookiealert->getCmsPageUrl();
26
+ }
27
+ }
app/code/community/Zero1/Cookiealert/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Zero1_Cookiealert_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+
5
+ }
app/code/community/Zero1/Cookiealert/Model/Cookiealert.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Zero1_Cookiealert_Model_Cookiealert extends Mage_Core_Block_Template
3
+ {
4
+ protected $_isClosed;
5
+
6
+ public function _construct()
7
+ {
8
+ $this->_isClosed = Mage::getModel('core/cookie')->get('zero1_cookiealert_closed');
9
+ }
10
+
11
+ public function getCloseUrl()
12
+ {
13
+ return Mage::getUrl('cookiealert/index/accept');
14
+ }
15
+
16
+ public function getIsClosed()
17
+ {
18
+ return $this->_isClosed;
19
+ }
20
+
21
+ public function setIsClosed($closed)
22
+ {
23
+ $this->_isClosed = $closed;
24
+
25
+ Mage::getModel('core/cookie')->set('zero1_cookiealert_closed', $closed);
26
+ }
27
+
28
+ public function getCmsPageUrl()
29
+ {
30
+ return Mage::getUrl(Mage::getStoreConfig('cookiealert/options/cms_page'));
31
+ }
32
+ }
app/code/community/Zero1/Cookiealert/controllers/IndexController.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Zero1_Cookiealert_IndexController extends Mage_Core_Controller_Front_Action
3
+ {
4
+ public function acceptAction()
5
+ {
6
+ Mage::getSingleton('cookiealert/cookiealert')->setIsClosed(true);
7
+
8
+ $this->_redirectReferer();
9
+ }
10
+ }
app/code/community/Zero1/Cookiealert/etc/adminhtml.xml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <cookiealert translate="title" module="cookiealert">
12
+ <title>Cookie Alert</title>
13
+ </cookiealert>
14
+ </children>
15
+ </config>
16
+ </children>
17
+ </system>
18
+ </children>
19
+ </admin>
20
+ </resources>
21
+ </acl>
22
+ </config>
app/code/community/Zero1/Cookiealert/etc/config.xml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Zero1_Cookiealert>
5
+ <version>0.1.0</version>
6
+ </Zero1_Cookiealert>
7
+ </modules>
8
+
9
+ <global>
10
+ <blocks>
11
+ <cookiealert>
12
+ <class>Zero1_Cookiealert_Block</class>
13
+ </cookiealert>
14
+ </blocks>
15
+
16
+ <models>
17
+ <cookiealert>
18
+ <class>Zero1_Cookiealert_Model</class>
19
+ </cookiealert>
20
+ </models>
21
+
22
+ <helpers>
23
+ <cookiealert>
24
+ <class>Zero1_Cookiealert_Helper</class>
25
+ </cookiealert>
26
+ </helpers>
27
+ </global>
28
+
29
+ <frontend>
30
+ <routers>
31
+ <cookiealert>
32
+ <use>standard</use>
33
+ <args>
34
+ <module>Zero1_Cookiealert</module>
35
+ <frontName>cookiealert</frontName>
36
+ </args>
37
+ </cookiealert>
38
+ </routers>
39
+
40
+ <layout>
41
+ <updates>
42
+ <cookiealert>
43
+ <file>cookiealert.xml</file>
44
+ </cookiealert>
45
+ </updates>
46
+ </layout>
47
+ </frontend>
48
+
49
+ <default>
50
+ <cookiealert>
51
+ <options>
52
+ <enabled>1</enabled>
53
+ <cms_page>home</cms_page>
54
+ </options>
55
+ </cookiealert>
56
+ </default>
57
+ </config>
app/code/community/Zero1/Cookiealert/etc/system.xml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <sections>
3
+ <cookiealert translate="label" module="cookiealert">
4
+ <label>Zero1 - Cookie Alert</label>
5
+ <tab>general</tab>
6
+ <frontend_type>text</frontend_type>
7
+ <sort_order>1600</sort_order>
8
+ <show_in_default>1</show_in_default>
9
+ <show_in_website>1</show_in_website>
10
+ <show_in_store>1</show_in_store>
11
+ <groups>
12
+ <options translate="label">
13
+ <label>Alert Options</label>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>1</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <fields>
20
+ <enabled translate="label">
21
+ <label>Enable Frontend Alert</label>
22
+ <frontend_type>select</frontend_type>
23
+ <source_model>adminhtml/system_config_source_yesno</source_model>
24
+ <sort_order>1</sort_order>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>1</show_in_store>
28
+ </enabled>
29
+
30
+ <cms_page translate="label">
31
+ <label>Information Page</label>
32
+ <frontend_type>select</frontend_type>
33
+ <source_model>adminhtml/system_config_source_cms_page</source_model>
34
+ <sort_order>1</sort_order>
35
+ <show_in_default>1</show_in_default>
36
+ <show_in_website>1</show_in_website>
37
+ <show_in_store>1</show_in_store>
38
+ </cms_page>
39
+ </fields>
40
+ </options>
41
+ </groups>
42
+ </cookiealert>
43
+ </sections>
44
+ </config>
app/design/frontend/base/default/layout/cookiealert.xml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <default>
4
+ <reference name="head">
5
+ <action method="addItem"><type>skin_css</type><name>cookiealert/css/cookiealert.css</name></action>
6
+ </reference>
7
+ <reference name="after_body_start">
8
+ <block type="cookiealert/cookiealert" before="-" name="cookiealert" template="cookiealert/cookiealert.phtml" />
9
+ </reference>
10
+ </default>
11
+ </layout>
app/design/frontend/base/default/template/cookiealert/cookiealert.phtml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(Mage::getStoreConfig('cookiealert/options/enabled') && !$this->getIsClosed())
3
+ {
4
+ ?>
5
+ <div class="cookiealert">
6
+ <div class="message">
7
+ <h1><?php echo $this->__('Cookie Policy');?></h1>
8
+ <p>
9
+ <?php echo $this->__('This website uses cookies to ensure proper functionality of the shopping cart and checkout progress. By continuing to browse the site you are agreeing to the use of cookies.');?>
10
+ <a href="<?php echo $this->getCmsPageUrl(); ?>"><?php echo $this->__('Click here to learn about cookie settings.'); ?></a>
11
+ </p>
12
+ <p class="close"><a href="<?php echo $this->getCloseUrl(); ?>"><?php echo $this->__('Close');?></a></p>
13
+ </div>
14
+ </div>
15
+ <?php
16
+ }
app/etc/modules/Zero1_Cookiealert.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Zero1_Cookiealert>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Zero1_Cookiealert>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Zero1_Cookiealert</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://shop.zero1.co.uk/LICENSE.txt">Commercial</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>EU Cookie Alert module</summary>
10
+ <description>EU Cookie Alert module</description>
11
+ <notes>First release.</notes>
12
+ <authors><author><name>Arron Moss</name><user>auto-converted</user><email>arron.moss@zero1.co.uk</email></author></authors>
13
+ <date>2012-06-19</date>
14
+ <time>08:13:59</time>
15
+ <contents><target name="magecommunity"><dir name="Zero1"><dir name="Cookiealert"><dir name="Block"><file name="Cookiealert.php" hash="8c53572ddbb0d8771dc37f65795698bf"/></dir><dir name="Helper"><file name="Data.php" hash="59f4cb7c7f7cd5285a3db55153eff583"/></dir><dir name="Model"><file name="Cookiealert.php" hash="b2d61ae2521cd151e45bebc54141cd59"/></dir><dir name="controllers"><file name="IndexController.php" hash="7a21099e2d8b58354072c4feb36e905d"/></dir><dir name="etc"><file name="adminhtml.xml" hash="3f063b5e621c2c314b17496df733ae96"/><file name="config.xml" hash="01416e301503e2524244232a25fc0f91"/><file name="system.xml" hash="f429aaf2dddaf9506ba365398bf3ba49"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Zero1_Cookiealert.xml" hash="36f0e58b1db5291f4dd7c6f8d5a54ca3"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="cookiealert.xml" hash="3e34e14891cd0c607f3d8e175a303c23"/></dir><dir name="template"><dir name="cookiealert"><file name="cookiealert.phtml" hash="26214cd2118b5c4787ead13a22c8a18c"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="cookiealert"><dir name="css"><file name="cookiealert.css" hash="60df3238e59d8cbb36b4b43a04873197"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>
skin/frontend/base/default/cookiealert/css/cookiealert.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ .cookiealert{background: #333; color: #fff; padding: 5px 0; font: 12px/18px Arial, Helvetica, sans-serif;}
2
+ .cookiealert .message{width: 960px; margin: 0 auto;}
3
+ .cookiealert .message h1{color: #fff; font-size: 16px; font-weight: bold; margin: 0.4em 0 0;}
4
+ .cookiealert .message a{color: #f90; text-decoration: underline;}
5
+ .cookiealert .message a:hover{text-decoration: none;}
6
+ .cookiealert .message .close a{font-size: 16px; text-decoration: none; font-weight: bold;}
7
+ .cookiealert .message .close a:hover{text-decoration: underline;}