Environment bar

General plugins (Local) ::: local_envbar
Maintained by Catalyst IT, Nicholas Hoobin, Brendan Heywood, Dmitrii Metelkin
Warn users with a notification block across the top of the screen when you're browsing a non-production server like staging or a local development box.
Latest release:
251 sites
196 downloads
21 fans
Current versions available: 3

Environment bar - Moodle local plugin

This displays a configurable fixed div across across the top of your Moodle site which can change depending on where it has been deployed.

This is useful with development and production for identifying which server you currently reside on based on the URL.

Principals

Showing what environment you are in needs to be reliable. If it doesn't work for any reason then you may as well not have it. The way this plugin works is that in your production system you specify what your different environments are. Then after a refresh of production data back to a staging environment it can auto detect that it is no longer in production and warn the end user. Further more if there isn't any config at all, then it will assume you are in a development environment.

By doing it this way, by saying 'Are we not in production' vs 'Are we in a dev environment' the logic becomes much more resilient to mistakes, refreshed databases, and still works even if you forget to do anything and just have a fresh database. ie it is the only near perfect fail safe way to detect a non-production environment.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2

Contributors

Catalyst IT (Lead maintainer)
Dmitrii Metelkin
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Plugins bot
    Fri, 11 Mar 2016, 8:01 PM
    Prechecker results: 28 errors/1 warnings
    http://integration.moodle.org/job/Precheck%20remote%20branch/21879/artifact/work/smurf.html

    Please consider adding a full description of the plugin. You can describe the plugin's features, purpose and typical usage scenarios there, for example.
  • David Mudrák
    Fri, 11 Mar 2016, 8:10 PM

    Thanks guys for sharing the plugin with the community. I can see its potential usefulness in certain Moodle development setups. Although I personally prefer injecting these things directly via the main config.php, rather than having a plugin installed for it.

    I have to ask you for better description of the plugin here prior to approving it. It should be clear that this plugin is intended for developers and development installations only. I do not think it is intended for production environments is it?

  • Dan Marsden
    Wed, 6 Apr 2016, 7:34 AM
    Thanks for updating the description - good to see the travis-ci checks passing too! - I've tested this plugin and it appears to work well.

    I like the fact that this code-base and configuration can sit on both development and production branches - allowing you to duplicate the production database and display the correct bar on the development/testing systems. I can see it being a useful plugin and I think this is ready for approval in the plugins db

    I agree with David though - I prefer to manage this sort of thing from config.php (preventing changes to the config by normal Moodle admins) - I wonder if an idea for future development of this would be to allow hard-coding values for this plugin in config.php
  • Brendan Heywood
    Wed, 6 Apr 2016, 8:30 AM
    Thanks Dan, we are adding an optional $CFG->local_envbar_items config item so you can do it either way.
  • Yezi Yang
    Wed, 22 June 2016, 2:58 PM
    Hi,

    I really like this plugin. The institution I work in will start to use it in the coming September semester. However, there is a bug that when the message in the environment bar is long, the envbar will cover the user name. It is a big problem since users need to click their user name in the banner for dashboard, grade and logout. Here is an screen shot of the bug. Since it does not support to upload images in the message forums, I uploaded the screen shots to a cloud storage. http://yun.baidu.com/share/link?shareid=774456671&uk=3526299744

    I am really looking forward that you can solve the problem as soon as possible. Thank you very much.
  • Brendan Heywood
    Wed, 22 June 2016, 3:33 PM
    hi Yezi,

    I think you have misunderstood the intent of this plugin, it's not for giving messages to students in a real site. It should only ever show a warning in non-production environments.

    If you want to show a warning for impending outages or similar to students I'd suggest try experimenting with the 'additionalhtml' config item, or investigate another plugin better suited to this task.

    cheers Brendan
  • Yezi Yang
    Wed, 22 June 2016, 5:05 PM
    Hi Brendan,

    Thank you very much for your suggestion! The "additional html" item is quite useful.
  • Pia Liersch
    Fri, 7 Apr 2017, 3:31 PM
    Hi,

    we search a Plugin to Display a Maintenance Date and Info, to a lot of Moodle Installations on the same Server.
    is this realizable with this Plugin?
  • Brendan Heywood
    Mon, 10 Apr 2017, 12:12 PM
    hi Patrick,

    No, the use case for this plugin is to help manage different environments of the same moodle, it's not for general purpose outage notifications.

    Recent versions of moodle have a simple built in outage notification message, have a look at:

    php admin/cli/maintenance.php -h
    --enablelater=MINUTES Number of minutes before entering CLI maintenance mode

    Or if you want a full blown outage manager solution have a look at this other plugin we maintain:

    https://github.com/catalyst/moodle-auth_outage
  • Yuriy Alekhnovich
    Thu, 12 Oct 2023, 3:10 PM
    Screenshots pictures are too small, nothing is visible.
Please login to post comments