Same name in other branches
  1. 7.x-2.x advagg_bundler/advagg_bundler.module \advagg_bundler_enabled()

Returns TRUE if the bundler will run.

Parameters

string $type: (optional) The type to check for - either 'css' or 'js'.

3 calls to advagg_bundler_enabled()
advagg_bundler_advagg_aggregate_grouping_alter in advagg_bundler/advagg_bundler.advagg.inc
Implements hook_advagg_aggregate_grouping_alter().
advagg_bundler_form_advagg_settings_alter in advagg_bundler/advagg_bundler.module
Implements hook_form_FORM_ID_alter().
InitSubscriber::onEvent in advagg_bundler/src/EventSubscriber/InitSubscriber.php
Event Response.

File

advagg_bundler/advagg_bundler.module, line 43

Code

function advagg_bundler_enabled($type = NULL) {
    $config = \Drupal::config('advagg_bundler.settings');
    if (!$config->get('active')) {
        return FALSE;
    }
    if ($type) {
        return $config->get('max_' . $type);
    }
    if ($config->get('max_css') || $config->get('max_js')) {
        return TRUE;
    }
}