c3-environment-banner - Version 1.1.1

Version Notes


  • Bug fix: Admin displays incorrectly if no env var or colour set

Download this release

Release Info

Developer C3 Media
Extension c3-environment-banner
Version 1.1.1
Comparing to
See all releases


Code changes from version 1.1.0 to 1.1.1

app/code/local/C3/EnvironmentBanner/Helper/Data.php CHANGED
@@ -42,6 +42,32 @@ class C3_EnvironmentBanner_Helper_Data extends Mage_Core_Helper_Abstract
42
  return true;
43
  }
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  /**
46
  * Get environments array, indexed by environment code
47
  *
42
  return true;
43
  }
44
 
45
+ /**
46
+ * Whether to display, given environment, settings etc.
47
+ *
48
+ * @return bool
49
+ */
50
+ public function isDisplayAdminBanner()
51
+ {
52
+ // Check that output is enabled, else return false
53
+ if (!$this->isChangeAdminColour()) {
54
+ return false;
55
+ }
56
+
57
+ // Check that the given environment is recognised, else false
58
+ if (!isset($this->getEnvironments()[$this->getEnvironment()])) {
59
+ return false;
60
+ }
61
+
62
+ // Never display if no background colour set (can be used to indicate skipping)
63
+ if ($this->getEnvColours()->getBeColor() === null) {
64
+ return false;
65
+ }
66
+
67
+ // We're enabled, in a recognised environment, so... display!
68
+ return true;
69
+ }
70
+
71
  /**
72
  * Get environments array, indexed by environment code
73
  *
app/design/adminhtml/default/default/template/c3_environmentbanner/header.phtml CHANGED
@@ -23,7 +23,7 @@ $cols = $envHelper->getEnvColours();
23
  }
24
  <?php
25
  // Change colour of heading if that option is turned on
26
- if ($envHelper->isChangeAdminColour()):
27
  ?>
28
  .ebborder {
29
  position:fixed;
23
  }
24
  <?php
25
  // Change colour of heading if that option is turned on
26
+ if ($envHelper->isDisplayAdminBanner()):
27
  ?>
28
  .ebborder {
29
  position:fixed;
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>c3-environment-banner</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License</license>
7
  <channel>community</channel>
@@ -24,16 +24,12 @@ SetEnv APPLICATION_ENV &amp;quot;staging&amp;quot;&lt;/p&gt;&#xD;
24
  &lt;p&gt;Tested in EE 1.13.0.0 to 1.14.0.1&lt;/p&gt;&#xD;
25
  &lt;p&gt;Developed by C3 Media, a full service &lt;a href="http://www.c3media.co.uk"&gt;Magento agency&lt;/a&gt;&lt;/p&gt;</description>
26
  <notes>&lt;ul&gt;&#xD;
27
- &lt;li&gt;Safe. DOES NOT display on production sites - fails safe to display nothing if it does not recognise the environment&lt;/li&gt;&#xD;
28
- &lt;li&gt;Display corner banner on front end pages&lt;/li&gt;&#xD;
29
- &lt;li&gt;Optionally change colour in admin&lt;/li&gt;&#xD;
30
- &lt;li&gt;Fully modifiable and extensible list of environments&lt;/li&gt;&#xD;
31
- &lt;li&gt;Use safety colours (defaults to traffic lights) or set your own&lt;/li&gt;&#xD;
32
  &lt;/ul&gt;</notes>
33
  <authors><author><name>C3 Media</name><user>c3media_ltd</user><email>hello@c3media.co.uk</email></author></authors>
34
- <date>2014-10-01</date>
35
- <time>15:59:30</time>
36
- <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="bf310c888e9305078db2d9afbaad95a6"/></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="2fb5086ba8f7129663a72b9eab4a4e62"/></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="1667bdc1fb1bf77c963280aba36c8c7e"/></dir></dir><dir name="layout"><file name="c3_environmentbanner.xml" hash="f080e3fefdd423257212a8ac9e6f1084"/></dir></dir></dir></dir></target></contents>
37
  <compatible/>
38
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>Core</name><min/><max/></extension></required></dependencies>
39
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>c3-environment-banner</name>
4
+ <version>1.1.1</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License</license>
7
  <channel>community</channel>
24
  &lt;p&gt;Tested in EE 1.13.0.0 to 1.14.0.1&lt;/p&gt;&#xD;
25
  &lt;p&gt;Developed by C3 Media, a full service &lt;a href="http://www.c3media.co.uk"&gt;Magento agency&lt;/a&gt;&lt;/p&gt;</description>
26
  <notes>&lt;ul&gt;&#xD;
27
+ &lt;li&gt;Bug fix: Admin displays incorrectly if no env var or colour set&lt;/li&gt;&#xD;
 
 
 
 
28
  &lt;/ul&gt;</notes>
29
  <authors><author><name>C3 Media</name><user>c3media_ltd</user><email>hello@c3media.co.uk</email></author></authors>
30
+ <date>2014-10-07</date>
31
+ <time>09:00:20</time>
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="da3ab0b8d4cc90862249c94e27b5afc6"/></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="1667bdc1fb1bf77c963280aba36c8c7e"/></dir></dir><dir name="layout"><file name="c3_environmentbanner.xml" hash="f080e3fefdd423257212a8ac9e6f1084"/></dir></dir></dir></dir></target></contents>
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>