function advagg_admin_settings_form

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 advagg.admin.inc advagg_admin_settings_form($form, $form_state)
cle7 advagg.admin.inc advagg_admin_settings_form($form, $form_state)
elmsmedia7 advagg.admin.inc advagg_admin_settings_form($form, $form_state)
icor7 advagg.admin.inc advagg_admin_settings_form($form, $form_state)
meedjum_blog7 advagg.admin.inc advagg_admin_settings_form($form, $form_state)
mooc7 advagg.admin.inc advagg_admin_settings_form($form, $form_state)

Form builder; Configure advagg settings.

See also

system_settings_form()

Related topics

1 string reference to 'advagg_admin_settings_form'
advagg_menu in sites/all/modules/ulmus/advagg/advagg.module
Implements hook_menu().

File

sites/all/modules/ulmus/advagg/advagg.admin.inc, line 14
Admin page callbacks for the advanced CSS/JS aggregation module.

Code

function advagg_admin_settings_form($form, $form_state) {
  drupal_set_title(t('AdvAgg: Configuration'));
  $config_path = advagg_admin_config_root_path();

  // Simple checkbox settings.
  $form['global'] = array(
    '#type' => 'fieldset',
    '#title' => t('Global Options'),
  );
  $form['global']['advagg_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable advanced aggregation'),
    '#default_value' => variable_get('advagg_enabled', ADVAGG_ENABLED),
    '#description' => t('Uncheck this box to completely disable AdvAgg functionality.'),
  );
  $form['global']['advagg_gzip'] = array(
    '#type' => 'checkbox',
    '#title' => t('Create .gz files'),
    '#default_value' => variable_get('advagg_gzip', ADVAGG_GZIP),
    '#description' => t('All aggregated files can be pre-compressed into a .gz file and
   served from Apache. This is faster then gzipping the file on each request.'),
  );
  $form['global']['advagg_core_groups'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use cores grouping logic'),
    '#default_value' => variable_get('advagg_combine_css_media', ADVAGG_COMBINE_CSS_MEDIA) || variable_get('advagg_ie_css_selector_limiter', ADVAGG_IE_CSS_SELECTOR_LIMITER) ? FALSE : variable_get('advagg_core_groups', ADVAGG_CORE_GROUPS),
    '#description' => t('Will group files just like core does.'),
    '#states' => array(
      'enabled' => array(
        '#edit-advagg-combine-css-media' => array('checked' => FALSE),
        '#edit-advagg-ie-css-selector-limiter' => array('checked' => FALSE),
      ),
    ),
  );
  $form['global']['advagg_use_httprl'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use HTTPRL to generate aggregates.'),
    '#default_value' => module_exists('httprl') ? variable_get('advagg_use_httprl', ADVAGG_USE_HTTPRL) : FALSE,
    '#disabled' => module_exists('httprl') ? FALSE : TRUE,
    '#description' => t('If <a href="@link">HTTPRL</a> is installed, advagg will use it to generate aggregates on the fly in a background parallel process.', array('@link' => 'http://drupal.org/project/httprl')),
  );
  $options = array(
    -1 => t('Development ~ 100ms'),
    
    //     0 => t('Disabled ~ 70ms'),
    1 => t('Normal ~ 10ms'),
    3 => t('Aggressive ~ 4ms'),
  );
  $form['global']['advagg_cache_level'] = array(
    '#type' => 'radios',
    '#title' => t('AdvAgg Cache Settings'),
    '#default_value' => variable_get('advagg_cache_level', ADVAGG_CACHE_LEVEL),
    '#options' => $options,
    '#description' => t("As a reference, core takes about 7 ms to run. Development will scan all files for a change on every page load. Normal is should be fine for all use cases. Aggressive might break depending on how various hook_alter's for CSS/JS are implemented; to see what modules are using css/js_alter you can go to the <a href='@information'>Information Page</a> and under 'AdvAgg CSS/JS hooks implemented by modules' modules using both of these hooks will be listed near the bottom of that section; more information about the Aggressive setting can be found in the advagg README.txt file.", array(
      '@information' => url($config_path . '/advagg/info', array(
        'fragment' => 'edit-hooks-implemented',
      )),
    )),
  );
  // Show msg about the jquery update compression setting.
  if (module_exists('jquery_update')) {
    if (variable_get('jquery_update_compression_type', 'min') == 'min') {
      $form['global']['dev_container'] = array(
        '#type' => 'container',
        '#states' => array(
          'visible' => array(
            ':input[name="advagg_cache_level"]' => array('value' => '-1'),
          ),
        ),
      );
      $form['global']['dev_container']['advagg_jquery_update_development'] = array(
        '#markup' => '<p>' . t('You might want to change the <a href="!url">jQuery update compression level</a> to "Development" as well. ', array(
          '!url' => url('admin/config/development/jquery_update'),
        )) . '</p>',
      );
    }
    else {
      $form['global']['prod_container'] = array(
        '#type' => 'container',
        '#states' => array(
          'visible' => array(
            ':input[name="advagg_cache_level"]' => array('!value' => '-1'),
          ),
        ),
      );
      $form['global']['prod_container']['advagg_jquery_update_development'] = array(
        '#markup' => '<p>' . t('You might want to change the <a href="!url">jQuery update compression level</a> to "Production" as well. ', array(
          '!url' => url('admin/config/development/jquery_update'),
        )) . '</p>',
      );
    }
  }

  $form['css'] = array(
    '#type' => 'fieldset',
    '#title' => t('CSS Options'),
  );
  $form['css']['advagg_combine_css_media'] = array(
    '#type' => 'checkbox',
    '#title' => t('Combine CSS files by using media queries'),
    '#default_value' => variable_get('advagg_combine_css_media', ADVAGG_COMBINE_CSS_MEDIA),
    '#description' => t('Will combine more CSS files together because different CSS media types can be used in the same file by using media queries. Use cores grouping logic needs to be unchecked in order for this to work. Also noted is that due to an issue with IE9, compatibility mode is forced off if this is enabled.'),
    '#states' => array(
      'disabled' => array(
        '#edit-advagg-core-groups' => array('checked' => TRUE),
      ),
    ),
  );
  $form['css']['advagg_ie_css_selector_limiter'] = array(
    '#type' => 'checkbox',
    '#title' => t('Prevent more than %limit CSS selectors in an aggregated CSS file', array('%limit' => variable_get('advagg_ie_css_selector_limiter_value', ADVAGG_IE_CSS_SELECTOR_LIMITER_VALUE))),
    '#default_value' => variable_get('advagg_ie_css_selector_limiter', ADVAGG_IE_CSS_SELECTOR_LIMITER),
    '#description' => t('Internet Explorer before version 10; IE9, IE8, IE7, & IE6 all have 4095 as the limit for the maximum number of css selectors that can be in a file. Enabling this will prevent CSS aggregates from being created that exceed this limit. <a href="@link">More info</a>. Use cores grouping logic needs to be unchecked in order for this to work.', array('@link' => 'http://blogs.msdn.com/b/ieinternals/archive/2011/05/14/10164546.aspx')),
    '#states' => array(
      'disabled' => array(
        '#edit-advagg-core-groups' => array('checked' => TRUE),
      ),
    ),
  );
  $form['css']['advagg_ie_css_selector_limiter_value'] = array(
    '#type' => 'textfield',
    '#title' => t('The selector count the IE CSS limiter should use'),
    '#default_value' => variable_get('advagg_ie_css_selector_limiter_value', ADVAGG_IE_CSS_SELECTOR_LIMITER_VALUE),
    '#description' => t('Internet Explorer before version 10; IE9, IE8, IE7, & IE6 all have 4095 as the limit for the maximum number of css selectors that can be in a file. Use this field to modify the value used 4095 sometimes may be still be too many with media queries.'),
    '#states' => array(
      'visible' => array(
        '#edit-advagg-ie-css-selector-limiter' => array('checked' => TRUE),
      ),
      'disabled' => array(
        '#edit-advagg-ie-css-selector-limiter' => array('checked' => FALSE),
      ),
    ),
  );
  $form['css']['advagg_css_fix_type'] = array(
    '#type' => 'checkbox',
    '#title' => t('Fix improperly set type'),
    '#default_value' => variable_get('advagg_css_fix_type', ADVAGG_CSS_FIX_TYPE),
    '#description' => t('If type is external but does not start with http, https, or // change it to be type file. If type is file but it starts with http, https, or // change type to be external.'),
  );
  $form['js'] = array(
    '#type' => 'fieldset',
    '#title' => t('JS Options'),
  );
  $form['js']['advagg_js_fix_type'] = array(
    '#type' => 'checkbox',
    '#title' => t('Fix improperly set type'),
    '#default_value' => variable_get('advagg_js_fix_type', ADVAGG_JS_FIX_TYPE),
    '#description' => t('If type is external but does not start with http, https, or // change it to be type file. If type is file but it starts with http, https, or // change type to be external.'),
  );

  // Clear the cache bins on submit.
  $form['#submit'][] = 'advagg_admin_settings_form_submit';

  return system_settings_form($form);
}