diff --git a/sh_environment/acc.sh_environment.php b/sh_environment/acc.sh_environment.php old mode 100755 new mode 100644 index c2613b1..9bad59f --- a/sh_environment/acc.sh_environment.php +++ b/sh_environment/acc.sh_environment.php @@ -25,13 +25,13 @@ */ class Sh_environment_acc { - + public $name = 'SH Environment'; public $id = 'sh_environment'; - public $version = '1.0'; + public $version = '1.1'; public $description = 'Display which environment you are on at all times in the CP. Fork from https://github.com/davist11/Environment-EE-Addon'; public $sections = array(); - + /** * Set Sections */ @@ -39,15 +39,22 @@ public function set_sections() { $EE =& get_instance(); $js = ''; - - if ($EE->session->userdata('group_id') == 1 && defined('NSM_ENV')) { + + // FocusLab Master Config uses the ENV constant + // If that's not set check for NSM Bootstrap NSM_ENV + if( !defined('ENV') && defined('NSM_ENV')) + { + define('ENV', NSM_ENV); + } + + if ($EE->session->userdata('group_id') == 1 && defined('ENV')) { $js = 'var $body = $("body"); var $siteName = $("#navigationTabs").find(".msm_sites"); var siteNameOffset = $siteName.offset(); var rightPos = $body.width() - siteNameOffset.left + 20; - $body.append("
' . NSM_ENV . ' environment
");'; - + $body.append("
' . ENV . ' environment
");'; + $css = ''; - + $EE->cp->add_to_head($css); } - + $this->sections[] = ''; - + } - + // ---------------------------------------------------------------- - + } /* End of file acc.environment.php */