You are here

function bootstrap_library_init in Bootstrap Library 7

Implements hook_init().

File

./bootstrap_library.module, line 62
Primarily Drupal hooks.

Code

function bootstrap_library_init() {
  $settings = variable_get('bootstrap_library_settings');
  if (bootstrap_library_check_path($settings['visibility']['visibility'], $settings['visibility']['pages']) && bootstrap_library_check_theme()) {
    $types = array_filter($settings['files']['types']);

    // Load default if both types are selected.
    if (isset($types['css']) && isset($types['js'])) {
      libraries_load('bootstrap');
    }
    else {

      // Load the variant.
      $type = key($types);
      libraries_load('bootstrap', $type);
    }
  }
}