You are here

function opigno_learning_path_library_info_alter in Opigno Learning path 8

Same name and namespace in other branches
  1. 3.x opigno_learning_path.module \opigno_learning_path_library_info_alter()

Implements hook_library_info_alter().

File

./opigno_learning_path.module, line 3933
Contains opigno_learning_path.module.

Code

function opigno_learning_path_library_info_alter(&$libraries, $extension) {

  // Make possible to load Dropzone library from profile folder.
  if ($extension == 'dropzonejs' && \Drupal::moduleHandler()
    ->moduleExists('dropzonejs')) {
    $js = drupal_get_path("profile", "opigno_lms") . '/libraries/dropzone/dist/min/dropzone.min.js';
    $css = drupal_get_path("profile", "opigno_lms") . '/libraries/dropzone/dist/min/dropzone.min.css';
    if (file_exists($js) && file_exists($css)) {
      $libraries['dropzonejs']['js'] = [
        '/' . $js => [],
      ];
      $libraries['dropzonejs']['css']['theme'] = [
        '/' . $css => [],
      ];
    }
  }
}