Updated all the contrib modules to their latest versions.
[yaffs-website] / web / modules / contrib / blazy / blazy.views.inc
1 <?php
2
3 /**
4  * @file
5  * Provides views data for blazy.module.
6  */
7
8 /**
9  * Implements hook_views_data_alter().
10  */
11 function blazy_views_data_alter(&$data) {
12   $data['file_managed']['blazy_file'] = [
13     'title' => 'Blazy',
14     'help'  => t('Displays a preview of a File using Blazy, if applicable.'),
15     'field' => [
16       'id' => 'blazy_file',
17       'click sortable' => FALSE,
18     ],
19   ];
20   if (\Drupal::moduleHandler()->moduleExists('video_embed_media')) {
21     $data['media_field_data']['blazy_media'] = [
22       'title' => 'Blazy',
23       'help'  => t('Displays a preview of a Media using Blazy, if applicable.'),
24       'field' => [
25         'id' => 'blazy_media',
26         'click sortable' => FALSE,
27       ],
28     ];
29   }
30 }
31
32 /**
33  * Implements hook_views_plugins_style_alter().
34  */
35 function blazy_views_plugins_style_alter(array &$plugins) {
36   $plugins['blazy'] = [
37     'id'             => 'blazy',
38     'label'          => 'Blazy Grid',
39     'description'    => t('Display the results in a Blazy grid.'),
40     'class'          => 'Drupal\blazy\Plugin\views\style\BlazyViews',
41     'display_types'  => ['normal'],
42     'help'           => t('Works best with Views field containing Blazy.'),
43     'parent'         => 'parent',
44     'plugin_type'    => 'style',
45     'register_theme' => FALSE,
46     'short_title'    => 'Blazy',
47     'title'          => 'Blazy Grid',
48     'provider'       => 'blazy',
49   ];
50 }