How to disable the notification of CSSTidy compression to non-administrators? I don't want this shown to all users as it's not relevant to most. It shows even when not logged in. Refreshing the page can make it go away but sometimes comes back.

Comments

zarudnyi’s picture

Subscribe

canyonbreeze’s picture

I commented out the following line in csstidy.module to disable the message...

//drupal_set_message('Stylesheet compressed '.$ratio.' by CSSTidy', 'status');

This should be a configurable option rather than a code hack. Most end users of a site don't need this information.

zarudnyi’s picture

Yes, thanks.

philbar’s picture

I'm not having this issue, but maybe I disabled Drupal messages through my Boost settings.

global $user;
if ($user->uid==1) drupal_set_message('Stylesheet compressed '.$ratio.' by CSSTidy', 'status');

I believe that will only display the message for the first user of the site: the administrator.

philbar’s picture

Status: Active » Needs review
philbar’s picture

Status: Needs review » Fixed
philbar’s picture

I believe this is fixed in Dev

zarudnyi’s picture

Thank You!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Mac Clemmens’s picture

Status: Closed (fixed) » Active

Two suggestions:

1) Can you use the t() function to display the message?

2) Can you add a variable_get check that defaults to zero if unset. This would allow users two ways to mute the messages by running variable_set("csstidy_mute_messages", 1); or by editing their settings.php, all without needing to patch the module.


      if (variable_get("csstidy_mute_messages", 0) == 0) {
	      drupal_set_message(t('Stylesheet compressed !ratio by CSSTidy', array('!ratio' => $ratio)), 'status'); 
      }

philbar’s picture

Status: Active » Fixed
philbar’s picture

I'm going to change csstidy_mute_messages to csstidy_messages and have it default to TRUE and if you don't want these messages you would set it to FALSE.

philbar’s picture

This is in the latest -dev and will be in CSSTidy 1.4

philbar’s picture

Status: Fixed » Needs work

After adding $csstidy_messages = FALSE; to my settings.php file, the messages still persist.

This needs some more investigation.

Does anyone know if I'm using variable_get correctly?

if (variable_get("csstidy_messages", 1) == 1) {
    drupal_set_message(t('Stylesheet compressed !ratio by CSSTidy', array('!ratio' => $ratio)), 'status');
}
philbar’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.