You are here

function advagg_add_css_inline in Advanced CSS/JS Aggregation 7

Same name and namespace in other branches
  1. 6 advagg.module \advagg_add_css_inline()

Adds a CSS file to the stylesheet queue.

Parameters

$data: (optional) The CSS data that will be set. If not set then the inline CSS array will be passed back.

$media: (optional) The media type for the stylesheet, e.g., all, print, screen.

$prefix: (optional) prefix to add before the inlined css.

$suffix: (optional) suffix to add after the inlined css.

Return value

An array of CSS files.

2 calls to advagg_add_css_inline()
advagg_get_js_css_get_array in ./advagg.module
Return a large array of the CSS & JS files loaded on this page.
advagg_process_html_css in includes/css.inc

File

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

Code

function advagg_add_css_inline($data = NULL, $media = 'all', $prefix = NULL, $suffix = NULL) {
  static $css = array();

  // Store inline data in a static.
  if (isset($data)) {
    if (!isset($css[$media]['inline'][$prefix][$suffix])) {
      $css[$media]['inline'][$prefix][$suffix] = $data;
    }
    else {
      $css[$media]['inline'][$prefix][$suffix] .= "\n" . $data;
    }
    return;
  }
  else {
    return $css;
  }
}