Loving the new 2.x branch of environment indicator, and now that you can programatically provide the colors in the settings file, this is a winner over the 1.x branch.

We do however need to change the toolbar drawer color, as by default JavaScript programatically makes this 25% lighter then the main color used for the toolbar. This leads to really ugly color combinations, and essentially limits your choice of color palette.

Attached is a patch that optionally adds a new variable, that if not provided will default to the old behavior (so no need to provide any upgrade path).

Also patched the README file to explain this.

Example settings.php file with the new variable:

// Configure environment module.
$conf['environment_indicator_overwrite'] = TRUE;
$conf['environment_indicator_overwritten_name'] = 'DEVELOPMENT';
$conf['environment_indicator_overwritten_color'] = '#9bb03b';
$conf['environment_indicator_overwritten_drawer_color'] = '#333333';
$conf['environment_indicator_overwritten_text_color'] = '#ffffff';
$conf['environment_indicator_overwritten_position'] = 'top';
$conf['environment_indicator_overwritten_fixed'] = FALSE;
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

wiifm’s picture

FileSize
5.76 KB

Whoops, patch against the git root, try this.

wiifm’s picture

OK, one more shot.

Gold’s picture

Status: Needs review » Reviewed & tested by the community

This looks much better. I have this patch running and it doesn't appear to introduce any extra issues.

e0ipso’s picture

Status: Reviewed & tested by the community » Needs work

Thanks a lot for the patch! It looks great, but it's missing some features.

This should be accompanied by the possibility to choose the drawer color also using the UI environment indicators.

wiifm’s picture

Status: Needs work » Needs review
FileSize
9.88 KB

Alright, I have added the ability to control the drawer color through the UI, also this is now saved with the ctools exportables. Also added in farbtastic support for the color picker.

Example export:

$environment = new stdClass();
$environment->disabled = FALSE; /* Edit this to true to make a default environment disabled initially */
$environment->api_version = 1;
$environment->machine = 'default_environment';
$environment->name = 'Default environment';
$environment->regexurl = '.*';
$environment->settings = array(
  'color' => '#fcff33',
  'drawer_color' => '#f00000',
  'text_color' => '#1d0101',
  'weight' => '99',
  'position' => 'bottom',
  'fixed' => 0,
);
Juterpillar’s picture

Status: Needs review » Reviewed & tested by the community

The colour picker in the UI for the drawer works as specified without any obvious bugs. Great patch, thanks wiifm.

e0ipso’s picture

Status: Reviewed & tested by the community » Needs work

In my opinion this adds a great deal of control to the appearance of the indicator, but it adds more complexity to the indicator configuration.

Would you be up to add the farbtastic picker in a collapsed fieldset (maybe labelled More options) and make it optional? If nothing is selected there, then the current behavior is applied.

Thanks for this great patch!

jweowu’s picture

FileSize
9.22 KB

Re-rolled #5 against HEAD. No other changes.

e0ipso’s picture

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

Version for D7 is unmaintained. I am sorry for the inconvenience.