Pathologic was missing because of a .git folder inside.
[yaffs-website] / web / modules / contrib / slick / slick.module
1 <?php
2
3 /**
4  * @file
5  * Slick carousel integration, the last carousel you'll ever need.
6  */
7
8 use Drupal\blazy\Blazy;
9 use Drupal\slick\SlickDefault;
10
11 /**
12  * Implements hook_theme().
13  */
14 function slick_theme() {
15   $themes = [];
16   $all = ['slick', 'slide', 'grid', 'image', 'thumbnail', 'vanilla', 'wrapper'];
17   foreach ($all as $item) {
18     $key = $item == 'slick' ? $item : 'slick_' . $item;
19     $themes[$key] = [
20       'render element' => 'element',
21       'file' => 'templates/slick.theme.inc',
22     ];
23   }
24   return $themes;
25 }
26
27 /**
28  * Implements hook_library_info_build().
29  */
30 function slick_library_info_build() {
31   return \Drupal::service('slick.manager')->libraryInfoBuild();
32 }
33
34 /**
35  * Implements hook_config_schema_info_alter().
36  */
37 function slick_config_schema_info_alter(array &$definitions) {
38   Blazy::configSchemaInfoAlter($definitions, 'slick_base', SlickDefault::extendedSettings());
39 }
40
41 /**
42  * Implements hook_field_formatter_info_alter().
43  */
44 function slick_field_formatter_info_alter(array &$info) {
45   // Supports Media Entity via VEM within VEF if available.
46   if (function_exists('video_embed_media_media_bundle_insert')) {
47     $info['slick_file'] = [
48       'id'          => 'slick_file',
49       'label'       => t('Slick Image with Media'),
50       'description' => t('Display the images associated to VEM/ME as a simple mix of Slick image/video carousel.'),
51       'class'       => 'Drupal\slick\Plugin\Field\FieldFormatter\SlickFileFormatter',
52       'field_types' => ['entity_reference', 'image'],
53       'quickedit'   => ['editor' => 'disabled'],
54       'provider'    => 'slick',
55     ];
56   }
57 }
58
59 /**
60  * Implements hook_hook_info().
61  */
62 function slick_hook_info() {
63   $hooks['slick_skins_info'] = ['group' => 'slick'];
64   return $hooks;
65 }
66
67 /**
68  * Implements hook_library_info_alter().
69  */
70 function slick_library_info_alter(&$libraries, $extension) {
71   if ($extension === 'slick' && function_exists('libraries_get_path')) {
72     $library_path = libraries_get_path('slick') ? libraries_get_path('slick') : libraries_get_path('slick-carousel');
73     if ($library_path) {
74       $libraries['slick']['js'] = ['/' . $library_path . '/slick/slick.min.js' => ['weight' => -3]];
75       $libraries['slick']['css']['base'] = ['/' . $library_path . '/slick/slick.css' => []];
76       $libraries['slick.css']['css']['theme'] = ['/' . $library_path . '/slick/slick-theme.css' => []];
77     }
78   }
79 }