You are here

function advagg_css_in_js in Advanced CSS/JS Aggregation 7.2

Same name and namespace in other branches
  1. 8.2 advagg.module \advagg_css_in_js()

Returns TRUE if the CSS is being loaded via JavaScript.

Parameters

object $css_cache: Cache object from cache_get().

Return value

bool TRUE if CSS loaded via JS. FALSE if not.

2 calls to advagg_css_in_js()
advagg_get_render_cache in ./advagg.module
Given the full css and js scope array return back the render cache.
_advagg_process_html in ./advagg.module
Replacement for template_process_html().

File

./advagg.module, line 1858
Advanced CSS/JS aggregation module.

Code

function advagg_css_in_js($css_cache = NULL) {
  if (module_exists('advagg_mod') && variable_get('advagg_mod_css_defer', ADVAGG_MOD_CSS_DEFER)) {
    return TRUE;
  }
  if (module_exists('css_delivery') && css_delivery_enabled()) {
    return TRUE;
  }

  // Critical css added by another means.
  if (!empty($css_cache->data[1]['#items'])) {
    foreach ($css_cache->data[1]['#items'] as $values) {
      if (!empty($values['critical-css'])) {
        return TRUE;
      }
    }
  }
  return variable_get('advagg_css_in_js', ADVAGG_CSS_IN_JS);
}