Version Notes
- New feature: Adds window border on frontend similar to admin - makes current environment more obvious, especially when scrolling down
- Bug fix: Changed helper code that was not compatible with php5.3
Download this release
Release Info
| Developer | C3 Media |
| Extension | C3_Environment_Banner |
| Version | 1.1.3 |
| Comparing to | |
| See all releases | |
Code changes from version 1.1.1 to 1.1.3
app/code/local/C3/EnvironmentBanner/Helper/Data.php
CHANGED
|
@@ -29,7 +29,8 @@ class C3_EnvironmentBanner_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 29 |
}
|
| 30 |
|
| 31 |
// Check that the given environment is recognised, else false
|
| 32 |
-
|
|
|
|
| 33 |
return false;
|
| 34 |
}
|
| 35 |
|
|
@@ -55,7 +56,8 @@ class C3_EnvironmentBanner_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 55 |
}
|
| 56 |
|
| 57 |
// Check that the given environment is recognised, else false
|
| 58 |
-
|
|
|
|
| 59 |
return false;
|
| 60 |
}
|
| 61 |
|
|
@@ -97,10 +99,11 @@ class C3_EnvironmentBanner_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 97 |
{
|
| 98 |
// Lazily load colours from environment data
|
| 99 |
if ($this->_colours === null) {
|
| 100 |
-
|
|
|
|
| 101 |
return null;
|
| 102 |
}
|
| 103 |
-
$data = $
|
| 104 |
$this->_colours = Mage::getModel('c3_environmentbanner/colours')
|
| 105 |
->setData($data);
|
| 106 |
}
|
| 29 |
}
|
| 30 |
|
| 31 |
// Check that the given environment is recognised, else false
|
| 32 |
+
$environments = $this->getEnvironments();
|
| 33 |
+
if (!isset($environments[$this->getEnvironment()])) {
|
| 34 |
return false;
|
| 35 |
}
|
| 36 |
|
| 56 |
}
|
| 57 |
|
| 58 |
// Check that the given environment is recognised, else false
|
| 59 |
+
$environments = $this->getEnvironments();
|
| 60 |
+
if (!isset($environments[$this->getEnvironment()])) {
|
| 61 |
return false;
|
| 62 |
}
|
| 63 |
|
| 99 |
{
|
| 100 |
// Lazily load colours from environment data
|
| 101 |
if ($this->_colours === null) {
|
| 102 |
+
$environments = $this->getEnvironments();
|
| 103 |
+
if (!isset($environments[$this->getEnvironment()])) {
|
| 104 |
return null;
|
| 105 |
}
|
| 106 |
+
$data = $environments[$this->getEnvironment()];
|
| 107 |
$this->_colours = Mage::getModel('c3_environmentbanner/colours')
|
| 108 |
->setData($data);
|
| 109 |
}
|
app/design/frontend/base/default/template/c3_environmentbanner/banner.phtml
CHANGED
|
@@ -51,7 +51,58 @@ if ($helper->isDisplayFrontendBanner()):
|
|
| 51 |
background-image: -o-linear-gradient(top, <?php echo $cols->getFeLighterBgcolor() ?>, <?php echo $cols->getFeBgcolor() ?>);
|
| 52 |
color: <?php echo $cols->getFeColor() ?>;
|
| 53 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
</style>
|
| 55 |
-
<div class="ribbon-wrapper" onclick="document.getElementById('envbanner').style.display = 'none';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
<?php endif; ?>
|
| 51 |
background-image: -o-linear-gradient(top, <?php echo $cols->getFeLighterBgcolor() ?>, <?php echo $cols->getFeBgcolor() ?>);
|
| 52 |
color: <?php echo $cols->getFeColor() ?>;
|
| 53 |
}
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
.ebborder {
|
| 60 |
+
position:fixed;
|
| 61 |
+
z-index: 10000;
|
| 62 |
+
}
|
| 63 |
+
#ebtop,#ebbottom {
|
| 64 |
+
left:0;
|
| 65 |
+
width:100%;
|
| 66 |
+
height:3px;
|
| 67 |
+
}
|
| 68 |
+
#ebtop {
|
| 69 |
+
top:0;
|
| 70 |
+
}
|
| 71 |
+
#ebbottom {
|
| 72 |
+
bottom:0;
|
| 73 |
+
}
|
| 74 |
+
#ebleft,#ebright {
|
| 75 |
+
top:0;
|
| 76 |
+
height:100%;
|
| 77 |
+
width:3px;
|
| 78 |
+
}
|
| 79 |
+
#ebleft {
|
| 80 |
+
left:0;
|
| 81 |
+
}
|
| 82 |
+
#ebright {
|
| 83 |
+
right:0;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
.ebborder {
|
| 87 |
+
background-color: <?php echo $cols->getBeBorderColor() ?>;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
|
| 91 |
</style>
|
| 92 |
+
<div class="ribbon-wrapper" onclick="document.getElementById('envbanner').style.display = 'none';
|
| 93 |
+
document.getElementById('ebtop').style.display = 'none';
|
| 94 |
+
document.getElementById('ebbottom').style.display = 'none';
|
| 95 |
+
document.getElementById('ebleft').style.display = 'none';
|
| 96 |
+
document.getElementById('ebright').style.display = 'none';
|
| 97 |
+
" id="envbanner"><div class="ribbon-inner <?php echo $env ?>" title="click to hide"><?php echo ucfirst($env) ?></div></div>
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
<div id="ebtop" class="ebborder"></div>
|
| 102 |
+
<div id="ebbottom" class="ebborder"></div>
|
| 103 |
+
<div id="ebleft" class="ebborder"></div>
|
| 104 |
+
<div id="ebright" class="ebborder"></div>
|
| 105 |
+
|
| 106 |
+
|
| 107 |
|
| 108 |
<?php endif; ?>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>C3_Environment_Banner</name>
|
| 4 |
-
<version>1.1.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>GNU General Public License</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -11,7 +11,7 @@
|
|
| 11 |

|
| 12 |
<p>Have you ever performed an action - deleted a product or created a promotion live, only to realise that you've accidentally done it on the production site rather than a development copy? Be honest now.</p>
|
| 13 |

|
| 14 |
-
<p>If so, this extension is for you. It adds a discrete corner banner to the frontend of non-production websites (fail-safe - if it doesn't know what environment it is in then it assumes it is on a production server). It is more striking on the admin side, where the entire title bar is colour-coded, and a border added to the page so that no matter how long the page (I'm looking at you, system config), you'll always have a visual reminder of which environment you are in.</p>
|
| 15 |

|
| 16 |
<p><strong>How it works:</strong> The environment is picked up from the commonly used APPLICATION_ENV environment variable. This is set by the web-server, and for apache it just means adding in a single line to your .htaccess file. e.g.
|
| 17 |
SetEnv APPLICATION_ENV &quot;staging&quot;</p>
|
|
@@ -20,16 +20,18 @@ SetEnv APPLICATION_ENV &quot;staging&quot;</p>
|
|
| 20 |
<p>You can set any set of environments and colours in the admin interface. As default these are: production, staging, preview and development</p>
|
| 21 |
<p>The extension is <a href="https://github.com/c3limited/magento-environment-banner">Open source on GitHub</a></p>
|
| 22 |
<p>Include via composer or modman</p>
|
|
|
|
| 23 |
<p>Oldest supported CE version is 1.6.0.0</p>
|
| 24 |
<p>Tested in EE 1.13.0.0 to 1.14.0.1</p>
|
| 25 |
<p>Developed by C3 Media, a full service <a href="http://www.c3media.co.uk">Magento agency</a></p></description>
|
| 26 |
<notes><ul>
|
| 27 |
-
<li>
|
|
|
|
| 28 |
</ul></notes>
|
| 29 |
<authors><author><name>C3 Media</name><user>c3media_ltd</user><email>hello@c3media.co.uk</email></author></authors>
|
| 30 |
-
<date>
|
| 31 |
-
<time>09:
|
| 32 |
-
<contents><target name="mageetc"><dir name="modules"><file name="C3_EnvironmentBanner.xml" hash="35dfc2771b04c92c1a007103db954e7b"/></dir></target><target name="magelocal"><dir name="C3"><dir name="EnvironmentBanner"><dir name="Block"><dir name="Adminhtml"><dir name="Page"><file name="Header.php" hash="d0cb927ced912b84f9a495df946c0ac1"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Environment.php" hash="c5333c5851ba0c7b47520cdffa0ae53b"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="
|
| 33 |
<compatible/>
|
| 34 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>Core</name><min/><max/></extension></required></dependencies>
|
| 35 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>C3_Environment_Banner</name>
|
| 4 |
+
<version>1.1.3</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license>GNU General Public License</license>
|
| 7 |
<channel>community</channel>
|
| 11 |

|
| 12 |
<p>Have you ever performed an action - deleted a product or created a promotion live, only to realise that you've accidentally done it on the production site rather than a development copy? Be honest now.</p>
|
| 13 |

|
| 14 |
+
<p>If so, this extension is for you. It adds a discrete corner banner and window border to the frontend of non-production websites (fail-safe - if it doesn't know what environment it is in then it assumes it is on a production server). It is more striking on the admin side, where the entire title bar is colour-coded, and a border added to the page so that no matter how long the page (I'm looking at you, system config), you'll always have a visual reminder of which environment you are in.</p>
|
| 15 |

|
| 16 |
<p><strong>How it works:</strong> The environment is picked up from the commonly used APPLICATION_ENV environment variable. This is set by the web-server, and for apache it just means adding in a single line to your .htaccess file. e.g.
|
| 17 |
SetEnv APPLICATION_ENV &quot;staging&quot;</p>
|
| 20 |
<p>You can set any set of environments and colours in the admin interface. As default these are: production, staging, preview and development</p>
|
| 21 |
<p>The extension is <a href="https://github.com/c3limited/magento-environment-banner">Open source on GitHub</a></p>
|
| 22 |
<p>Include via composer or modman</p>
|
| 23 |
+
<p>Tested with php 5.3 to 5.6</p>
|
| 24 |
<p>Oldest supported CE version is 1.6.0.0</p>
|
| 25 |
<p>Tested in EE 1.13.0.0 to 1.14.0.1</p>
|
| 26 |
<p>Developed by C3 Media, a full service <a href="http://www.c3media.co.uk">Magento agency</a></p></description>
|
| 27 |
<notes><ul>
|
| 28 |
+
<li>New feature: Adds window border on frontend similar to admin - makes current environment more obvious, especially when scrolling down</li>
|
| 29 |
+
<li>Bug fix: Changed helper code that was not compatible with php5.3</li>
|
| 30 |
</ul></notes>
|
| 31 |
<authors><author><name>C3 Media</name><user>c3media_ltd</user><email>hello@c3media.co.uk</email></author></authors>
|
| 32 |
+
<date>2015-06-10</date>
|
| 33 |
+
<time>09:48:03</time>
|
| 34 |
+
<contents><target name="mageetc"><dir name="modules"><file name="C3_EnvironmentBanner.xml" hash="35dfc2771b04c92c1a007103db954e7b"/></dir></target><target name="magelocal"><dir name="C3"><dir name="EnvironmentBanner"><dir name="Block"><dir name="Adminhtml"><dir name="Page"><file name="Header.php" hash="d0cb927ced912b84f9a495df946c0ac1"/></dir><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Environment.php" hash="c5333c5851ba0c7b47520cdffa0ae53b"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="b8182d6217948005f9569b7a7d3d1de5"/></dir><dir name="Model"><file name="Colours.php" hash="36cf70a33c0e8ee3b5ff6cc8239e86e3"/></dir><dir name="etc"><file name="adminhtml.xml" hash="8f49b5c04cdcfb2ff975c8227d30d33c"/><file name="config.xml" hash="82b5c13bc79878a3b2407d9a05063879"/><file name="system.xml" hash="4d6dfff3681f6df651cf8208767968a5"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="c3_environmentbanner"><file name="header.phtml" hash="3888446b24c1c996b1333e068c486bbd"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="c3_environmentbanner"><file name="banner.phtml" hash="2feb2c78cc82db8edf2c12e4648a4c4a"/></dir></dir><dir name="layout"><file name="c3_environmentbanner.xml" hash="f080e3fefdd423257212a8ac9e6f1084"/></dir></dir></dir></dir></target></contents>
|
| 35 |
<compatible/>
|
| 36 |
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>Core</name><min/><max/></extension></required></dependencies>
|
| 37 |
</package>
|
