Zero1_Cookiealert - Version 1.0.1

Version Notes

Supports the Full Page Caching Enterprise Module.

Download this release

Release Info

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


Code changes from version 1.0.0 to 1.0.1

app/code/community/Zero1/Cookiealert/Block/Cookiealert.php CHANGED
@@ -10,16 +10,6 @@ class Zero1_Cookiealert_Block_Cookiealert extends Mage_Core_Block_Template
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();
10
  $this->_cookiealert = Mage::getSingleton('cookiealert/cookiealert');
11
  }
12
 
 
 
 
 
 
 
 
 
 
 
13
  public function getCmsPageUrl()
14
  {
15
  return $this->_cookiealert->getCmsPageUrl();
app/code/community/Zero1/Cookiealert/Model/Cookiealert.php CHANGED
@@ -1,30 +1,6 @@
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'));
1
  <?php
2
  class Zero1_Cookiealert_Model_Cookiealert extends Mage_Core_Block_Template
3
+ {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  public function getCmsPageUrl()
5
  {
6
  return Mage::getUrl(Mage::getStoreConfig('cookiealert/options/cms_page'));
app/code/community/Zero1/Cookiealert/controllers/IndexController.php CHANGED
@@ -1,10 +1,5 @@
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
  }
1
  <?php
2
  class Zero1_Cookiealert_IndexController extends Mage_Core_Controller_Front_Action
3
  {
4
+
 
 
 
 
 
5
  }
app/code/community/Zero1/Cookiealert/etc/config.xml CHANGED
@@ -1,11 +1,11 @@
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>
1
+ <?xml version="1.0" encoding="UTF-8"?>
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>
app/design/frontend/base/default/template/cookiealert/cookiealert.phtml CHANGED
@@ -1,16 +1,28 @@
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
  }
1
  <?php
2
+ if(Mage::getStoreConfig('cookiealert/options/enabled'))
3
  {
4
  ?>
5
+ <div id="cookiealert" class="cookiealert" style="display:none;">
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="javascript:closeCookieAlert();"><?php echo $this->__('Close');?></a></p>
13
  </div>
14
  </div>
15
+ <script type="text/javascript">
16
+ function closeCookieAlert()
17
+ {
18
+ Mage.Cookies.set('cookieAlertClosedFlag', 1, new Date(new Date().getTime() + 60 * 1000));
19
+ document.getElementById('cookiealert').style.display = 'none';
20
+ }
21
+
22
+ if(!Mage.Cookies.get('cookieAlertClosedFlag'))
23
+ {
24
+ document.getElementById('cookiealert').style.display = '';
25
+ }
26
+ </script>
27
  <?php
28
  }
package.xml CHANGED
@@ -1,18 +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>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Zero1_Cookiealert</name>
4
+ <version>1.0.1</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>Supports the Full Page Caching Enterprise Module.</notes>
12
  <authors><author><name>Arron Moss</name><user>auto-converted</user><email>arron.moss@zero1.co.uk</email></author></authors>
13
+ <date>2012-10-05</date>
14
+ <time>10:57:30</time>
15
+ <contents><target name="magecommunity"><dir name="Zero1"><dir name="Cookiealert"><dir name="Block"><file name="Cookiealert.php" hash="edcbd90a12d4907c751f610fb987425c"/></dir><dir name="Helper"><file name="Data.php" hash="59f4cb7c7f7cd5285a3db55153eff583"/></dir><dir name="Model"><file name="Cookiealert.php" hash="116acbd3add322d389e95316420c56d4"/></dir><dir name="controllers"><file name="IndexController.php" hash="02d15b278a410e1c73df8a38bf62bb92"/></dir><dir name="etc"><file name="adminhtml.xml" hash="3f063b5e621c2c314b17496df733ae96"/><file name="config.xml" hash="80a1d6073fe29d04f5472236de59a95d"/><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="8e1dc90815f6cb60b6e8fb28827a9580"/></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>