You are here

function fontawesome_preprocess_html in Font Awesome Icons 7.2

Same name and namespace in other branches
  1. 7.3 fontawesome.module \fontawesome_preprocess_html()

Implements hook_preprocess_html().

Purposefully only load on page requests and not hook_init(). This is required so it does not increase the bootstrap time of Drupal when it isn't necessary.

File

./fontawesome.module, line 60
fontawesome.module Drupal integration with Font Awesome, the iconic font for use with Bootstrap.

Code

function fontawesome_preprocess_html() {
  if (variable_get('fontawesome_use_cdn', FALSE)) {
    drupal_add_css(FONTAWESOME_CDN_URL, array(
      'type' => 'external',
    ));
  }
  else {
    $library = libraries_load(FONTAWESOME_LIBRARY);
    if (!$library['loaded']) {
      drupal_set_message($library['error message'] . t('Please make sure that ' . 'fontawesome was download & extracted at sites/all/libraries/fontawesome directory.' . 'Please check README.txt for more details.'), 'warning');
    }
  }
}