You are here

function override_css_init in Override css 7

Implements hook_init().

File

./override_css.module, line 63

Code

function override_css_init() {
  global $theme;
  if (($theme != variable_get('admin_theme', 'seven') || variable_get('override_css_admin_theme', FALSE)) && variable_get('override_css_settings_enabled', TRUE)) {

    //add ctools css
    ctools_include('css');
    $override_css = ctools_css_retrieve('override-css');
    if (!empty($override_css)) {
      drupal_add_css($override_css, array(
        'group' => CSS_THEME,
        'every_page' => TRUE,
        'weight' => 10,
      ));
    }
    else {
      drupal_add_css(override_css_generate_css(), array(
        'type' => 'inline',
        'group' => CSS_THEME,
        'every_page' => FALSE,
        'weight' => 10,
        'media' => 'all',
      ));
    }

    //add fonts
    $fonts = fontyourface_get_fonts('enabled = 1');
    foreach ($fonts as $font) {
      fontyourface_font_registry($font);
    }
  }
}