Same name and namespace in other branches
  1. 5.0.x advagg_mod/advagg_mod.module \advagg_mod_css_defer_active() 1 commentaire
  2. 6.0.x advagg_mod/advagg_mod.module \advagg_mod_css_defer_active() 1 commentaire
  3. 8.x-3.x advagg_mod/advagg_mod.module \advagg_mod_css_defer_active() 1 commentaire
  4. 8.x-4.x advagg_mod/advagg_mod.module \advagg_mod_css_defer_active() 1 commentaire

Determines whether css defering should be active for the current request.

3 calls to advagg_mod_css_defer_active()
advagg_mod_advagg_asset_render_alter dans advagg_mod/advagg_mod.module
Implements hook_advagg_asset_render_alter().
advagg_mod_js_alter dans advagg_mod/advagg_mod.module
Implements hook_js_alter().
advagg_mod_page_attachments_alter dans advagg_mod/advagg_mod.module
Implements hook_page_attachments_alter().

Fichier

advagg_mod/advagg_mod.module, line 438

Code

function advagg_mod_css_defer_active() {
    $config = \Drupal::config('advagg_mod.settings');
    if (!$config->get('css_defer')) {
        return FALSE;
    }
    $admin_route = \Drupal::service('router.admin_context')->isAdminRoute();
    if ($admin_route && !$config->get('css_defer_admin')) {
        return FALSE;
    }
    return TRUE;
}