You are here

function _prod_check_preprocess_css in Production check & Production monitor 7

Same name and namespace in other branches
  1. 6 prod_check.module \_prod_check_preprocess_css()

File

./prod_check.module, line 1228

Code

function _prod_check_preprocess_css($caller = 'internal') {
  $check = array();
  $state = TRUE;
  $title = 'Aggregate and compress CSS files.';
  $path = 'admin/config/development/performance';

  // Check settings.
  if (variable_get('preprocess_css', 0) == 0) {
    $state = FALSE;

    // TODO: In D6 there was an extra check on the 'advagg' module. Keep an eye out for a D7 port or a D7 alternative!
  }
  if ($caller != 'internal') {
    $path = PRODCHECK_BASEURL . $path;
  }
  $check['prod_check_preprocess_css'] = array(
    '#title' => t($title),
    '#state' => $state,
    '#severity' => $caller == 'nagios' ? NAGIOS_STATUS_CRITICAL : PROD_CHECK_REQUIREMENT_ERROR,
    '#value_ok' => t('Enabled'),
    '#value_nok' => t('Disabled'),
    '#description_ok' => prod_check_ok_title($title, $path),
    '#description_nok' => t('Your !link settings are disabled, they should be enabled on a producion environment! This should not cause trouble if you steer clear of @import statements.', prod_check_link_array($title, $path)),
    '#nagios_key' => 'CCOMP',
    '#nagios_type' => 'state',
  );
  return prod_check_execute_check($check, $caller);
}