You are here

function ctools_css_add_css in Chaos Tool Suite (ctools) 6

Add a CTools CSS file to the page.

Because drupal_add_css() does not handle files that it cannot stat, it can't add files that are stored in a private file system. This will will check to see if we're using the private file system and use drupal_set_html_head() instead if that is the case.

Sadly that will preclude aggregation of any sort, but there doesn't seem to be any ways around that. Also it will screw with stylesheet order. Again, sorry.

2 calls to ctools_css_add_css()
ctools_stylizer_add_css in includes/stylizer.inc
Add the necessary CSS for a stylizer plugin to the page.
ctools_stylizer_build_style in includes/stylizer.inc
Build the files for a stylizer given the proper settings.

File

includes/css.inc, line 187

Code

function ctools_css_add_css($filename = NULL, $type = 'module', $media = 'all', $preprocess = TRUE) {
  switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) {
    case FILE_DOWNLOADS_PUBLIC:
      drupal_add_css($filename, $type, $media, $preprocess);
      break;
    case FILE_DOWNLOADS_PRIVATE:
      $path = file_create_path($filename);
      if ($path) {
        $url = file_create_url($path);
      }
      else {
        $url = $filename;
      }
      $output = '<link type="text/css" rel="stylesheet" media="' . $media . '" href="' . $url . '" />' . "\n";
      drupal_set_html_head($output);
  }
}