function css_gzip_form_alter in CSS Gzip 6
Implementation of hook_form_alter().
Parameters
&$form: Nested array of form elements that comprise the form.
$form_state: A keyed array containing the current state of the form.
$form_id: String representing the name of the form itself. Typically this is the name of the function that generated the form.
File
- ./
css_gzip.module, line 34 - Gzips aggregated CSS files if CSS Optimization is turned on.
Code
function css_gzip_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'system_performance_settings') {
$form['bandwidth_optimizations']['preprocess_css']['#weight'] = -10;
$form['bandwidth_optimizations']['css_gzip'] = array(
'#type' => 'checkbox',
'#title' => t('GZip CSS'),
'#description' => t('Optionally <a href="@gzip">GZip</a> the aggregated CSS file to dramatically decrease its size.', array(
'@gzip' => 'http://en.wikipedia.org/wiki/Gzip',
)),
'#default_value' => variable_get('css_gzip', FALSE),
'#weight' => -9,
);
$form['bandwidth_optimizations']['css_gzip_no_htaccess'] = array(
'#type' => 'checkbox',
'#title' => t('GZip CSS: Do not generate .htaccess file'),
'#description' => t('Sometimes your host does not like multiple .htaccess files. Enable this to bypass htaccess file generation. Follow directions in the README.txt if this is effecting you.'),
'#default_value' => variable_get('css_gzip_no_htaccess', FALSE),
'#weight' => -8,
);
$form['bandwidth_optimizations']['css_gzip_exit'] = array(
'#type' => 'checkbox',
'#title' => t('GZip CSS: Use hook exit as well.'),
'#description' => t("If you're using a recolorable theme, you should probably use this."),
'#default_value' => variable_get('css_gzip_exit', FALSE),
'#weight' => -7,
);
}
}