You are here

function jcarousel_library_info_alter in jCarousel 8.4

Same name and namespace in other branches
  1. 8.5 jcarousel.module \jcarousel_library_info_alter()

Implements hook_library_info_alter().

Add skins as libraries.

File

./jcarousel.module, line 513
Provides integration with 3rd party modules and the jCarousel library.

Code

function jcarousel_library_info_alter(&$libraries, $extension) {
  if ($extension == 'jcarousel') {
    $skins = \Drupal::service('jcarousel.skins.manager')
      ->getDefinitions();
    foreach ($skins as $key => $data) {
      $libraries["skin.{$key}"] = [
        'version' => 'VERSION',
        'css' => [
          'theme' => [
            $data['file'] => [],
          ],
        ],
      ];
    }
  }
}