--- javascript_aggregator/javascript_aggregator.module Sun Mar 22 12:57:12 2009
+++ javascript_aggregator/javascript_aggregator.module Mon Mar 23 21:12:29 2009
@@ -19,15 +19,23 @@
if ($form_id == 'system_performance_settings') {
$form['bandwidth_optimizations']['preprocess_js']['#title'] = t('Optimize and Minify JavaScript files');
$form['bandwidth_optimizations']['preprocess_js']['#description'] .= t(' Once the JavaScript files have been aggregated, they will be minified.');
- $form['bandwidth_optimizations']['preprocess_js']['#weight'] = 1;
+ $form['bandwidth_optimizations']['preprocess_js']['#weight'] = 4;
$form['bandwidth_optimizations']['javascript_aggregator_gzip'] = array(
'#type' => 'checkbox',
'#title' => t('GZip JavaScript'),
'#description' => t('Once minified, optionally GZip the aggregated JavaScript file to dramatically decrease its size.', array('@gzip' => 'http://en.wikipedia.org/wiki/Gzip')),
'#default_value' => variable_get('javascript_aggregator_gzip', FALSE),
- '#weight' => 2,
+ '#weight' => 5,
);
+
+ $form['bandwidth_optimizations']['javascript_aggregator_gzip_no_htaccess'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('GZip JavaScript: Do not generate .htaccess file'),
+ '#description' => t('Sometimes your host does not like mutiple .htaccess files. Enable this to bypass htaccess file generation. Follow directions in the README.txt if this is effecting you.'),
+ '#default_value' => variable_get('javascript_aggregator_gzip_no_htaccess', FALSE),
+ '#weight' => 6,
+ );
}
}
@@ -67,7 +75,7 @@
}
// Make sure the .htaccess file is active to handle GZipped JavaScript files.
- if (!file_exists($htaccess)) {
+ if (variable_get('javascript_aggregator_gzip_no_htaccess', FALSE)==TRUE || !file_exists($htaccess)) {
$htaccess_contents = <<
AddEncoding x-gzip .gz
@@ -84,7 +92,7 @@
file_save_data($htaccess_contents, $htaccess, FILE_EXISTS_REPLACE);
}
}
- else {
+ if (variable_get('javascript_aggregator_gzip', FALSE)==FALSE || variable_get('javascript_aggregator_gzip_no_htaccess', FALSE)==TRUE) {
// Delete .htaccess file so *.gz files do not get served.
if (file_exists($htaccess)) {
file_delete($htaccess);