This is a simple administration utility module that adds the server name to various places that are useful to Drupal administrators who have sites on different servers.

The module uses Drupal hooks to add a short paragraph containing the server name (from PHP's php_uname('n') function) to these places:

  • Status Report page at /admin/reports/status
  • Modules list at /admin/build/modules
  • Updates list at /admin/reports/updates
  • Update notification emails

This addition makes it much easier to see which server the administrator needs to add or update modules on.

I have the module running on all my live and development Drupal sites, both Drupal 6 and Drupal 7. The module includes help text and HTML for the advanced_help module if it is installed.

Sandbox: http://drupal.org/sandbox/Fonant/1705236

Drupal core 6.x and 7.x versions are included.

git clone --recursive --branch 6.x-1.x http://git.drupal.org/sandbox/Fonant/1705236.git whichserver
git clone --recursive --branch 7.x-1.x http://git.drupal.org:sandbox/Fonant/1705236.git whichserver

Comments

drunken monkey’s picture

Assigned: Unassigned » drunken monkey
drunken monkey’s picture

Status: Needs review » Needs work

Thanks for uploading this module on drupal.org!

It seems that Environment Indicator provides very similar functionality. Actually, it looks more practical as it gives you the indicator on every page, and across the whole page, and the color also helps to keep track of where you are. Does your module really add any benefits over that?
If you think having the internal server name instead of those custom ones is more useful, maybe you should just post a patch to the Environment Indicator module.

Also, the note doesn't appear on the Updates list for 7.x.
Why did you alter the theme registry instead of using hook_help(), anyways?

In whichserver_mail_alter() you have an untranslated “Server” string.

Other than that your code looks great, but as said, I doubt whether it will be useful enough to justify a whole new module.

drunken monkey’s picture

Assigned: drunken monkey » Unassigned
fonant’s picture

Thanks drunken monkey. The differences compared to Environment Indicator (which I've also used) are:

  • Environment indicator is for the same site in different environments (e.g. test versus staging versus live), while my module is for multiple sites (live or test or staging) installed on a range of different servers.
  • My module is to assist site administrators with installing and updating modules, where the administrator has Drupal sites installed on several servers. It is not a testing/live environment indicator, it's a module maintenance tool to improve the core Update manager module.
  • My module requires no configuration, you just enable it and it does its work. I host many Drupal sites on several servers, and this module is very useful to me :) Perhaps not so useful for people who only have one server, or only one or two sites.

I'll have a look at possibly submitting patches for Drupal core's Update manager module. That seems to me to be a better place than the Environment Indicator module, which is intended for something quite different. The only thing is that my additions aren't needed for most people, so probably don't need to live in core either...

I used a theme override as that seemed to be a quick way to add to the updates table, but then found that this didn't work in Drupal 6, so resorted to hook_help() instead. Should have used hook_help() instead, I'll re-write that. I'll also add t() to the untranslated string, well spotted :)

fonant’s picture

Status: Needs work » Needs review

I've modified the code as suggested by drunken monkey, so it uses hook_help() instead of modifying the themeing of the updates list, and to add the missing t().

Set back to "needs review" as I personally find this module provides useful functionality that isn't likely to be available elsewhere (it's not really relevant for core, and solves a different need to the environment indicator module).

bhosmer’s picture

Status: Needs review » Needs work

I'd say this would be useful as a lighter-weight alternative to environment indicator. It may offer some duplicate functionality, but what if a user is developing for a site or browser that doesn't support javascript? Environment indicator uses js, but this module doesn't.

There is a /help folder in the 7.x-1.x branch that probably should be removed, and the help callbacks take me to /admin/reports/status for example instead of admin/reports/status, so a 404 error.

klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.