You are here

function _styleswitcher_add_css in Style Switcher 6

Similar to drupal_add_css. This function keeps a list of css files for use as alternate stylesheets.

Parameters

$path:

$title:

2 calls to _styleswitcher_add_css()
styleswitcher_block in ./styleswitcher.module
Implementation of hook_block().
styleswitcher_preprocess_page in ./styleswitcher.module
Implementation of hook_preprocess_page(). Add styles and scripts in the specific way necessary for this to work.

File

./styleswitcher.module, line 51
Framework for themes to easily add stylesheet switching functionality.

Code

function _styleswitcher_add_css($path = NULL, $title = NULL) {
  static $css = array();
  global $theme;
  if (isset($path) && isset($title)) {
    $attr = array(
      'href' => base_path() . drupal_get_path('theme', $theme) . '/' . $path,
      'title' => $title,
    );
    $css[] = '<link type="text/css" rel="alternate stylesheet" ' . drupal_attributes($attr) . ' />';
  }
  return $css;
}