You are here

function javascript_aggregator_form_alter in Javascript Aggregator 6

Same name and namespace in other branches
  1. 5 javascript_aggregator.module \javascript_aggregator_form_alter()

Implementation of hook_form_alter().

File

./javascript_aggregator.module, line 17

Code

function javascript_aggregator_form_alter(&$form, $form_state, $form_id) {
  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'] = 2;
    $form['bandwidth_optimizations']['javascript_aggregator_gzip'] = array(
      '#type' => 'checkbox',
      '#title' => t('GZip JavaScript'),
      '#description' => t('Once minified, optionally <a href="@gzip">GZip</a> 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' => 3,
    );
    $form['bandwidth_optimizations']['javascript_aggregator_no_htaccess'] = array(
      '#type' => 'checkbox',
      '#title' => t('Do not auto generate .htaccess file (experts only)'),
      '#description' => t("If you want to use GZipping and your host doesn't like multiple .htaccess files check this option, together with the option above to bypass htaccess file generation and follow directions in the README.txt."),
      '#default_value' => variable_get('javascript_aggregator_no_htaccess', FALSE),
      '#weight' => 5,
    );
    $form['bandwidth_optimizations']['javascript_aggregator_jsminplus'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use JSMin+ instead of JSMin'),
      '#description' => t('Check this option to use <a href="@jsminplus">JSMin+</a> instead of JSMin.', array(
        '@jsminplus' => 'http://crisp.tweakblogs.net/blog/1665/a-new-javascript-minifier-jsmin+.html',
      )),
      '#default_value' => variable_get('javascript_aggregator_jsminplus', FALSE),
      '#weight' => 4,
    );
  }
}