You are here

function fontyourface_add_css_in_preprocess in @font-your-face 7.2

Same name and namespace in other branches
  1. 6.2 fontyourface.module \fontyourface_add_css_in_preprocess()
  2. 6 fontyourface.module \fontyourface_add_css_in_preprocess()
  3. 7 fontyourface.module \fontyourface_add_css_in_preprocess()

Adds a stylesheet in preprocess

6 calls to fontyourface_add_css_in_preprocess()
fontdeck_preprocess_html in modules/fontdeck/fontdeck.module
Implements template_preprocess_html().
fontsquirrel_preprocess_html in modules/fontsquirrel/fontsquirrel.module
Implements template_preprocess_html().
fontyourface_preprocess_html in ./fontyourface.module
Implements template_preprocess_html().
fontyourface_wysiwyg_preprocess_page in modules/fontyourface_wysiwyg/fontyourface_wysiwyg.module
Implements template_preprocess_page().
google_fonts_api_preprocess_html in modules/google_fonts_api/google_fonts_api.module
Implements template_preprocess_html().

... See full list

File

./fontyourface.module, line 236

Code

function fontyourface_add_css_in_preprocess(&$vars, $css_path, $type = 'public') {
  if ($type == 'remote') {
    drupal_add_css($css_path, array(
      'type' => 'external',
      'group' => CSS_THEME,
    ));
  }
  else {
    if ($type == 'public') {
      $css_path = file_stream_wrapper_get_instance_by_scheme('public')
        ->getDirectoryPath() . '/' . $css_path;
    }

    // if
    drupal_add_css($css_path, array(
      'group' => CSS_THEME,
      'basename' => 'fontyourface-' . md5($css_path),
    ));
  }

  // else
}