-
Notifications
You must be signed in to change notification settings - Fork 0
/
views_slideshow.module
164 lines (159 loc) · 4.57 KB
/
views_slideshow.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php
/**
* @file
* Provides Slideshow style options for Views.
*/
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function views_slideshow_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the gss module.
case 'help.page.views_slideshow':
$output = '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Views Slideshow can be used to create a slideshow of any content (not just images) that can appear in a View. Powered by jQuery, it is heavily customizable: you may choose slideshow settings for each View you create.') . '</p>';
$output .= '<h3>' . t('More Information') . '</h3>';
$output .= '<p>' . t('For more information about this module visit the <a href="@link">Views Slideshow</a> module page.', ['@link' => 'https://www.drupal.org/project/views_slideshow']) . '</p>';
return $output;
}
}
/**
* Implements hook_theme().
*/
function views_slideshow_theme() {
return [
'views_slideshow_main_section' => [
'variables' => [
'vss_id' => NULL,
'slides' => NULL,
'plugin' => NULL,
],
'file' => 'views_slideshow.theme.inc',
],
'views_slideshow_pager_widget_render' => [
'variables' => [
'vss_id' => NULL,
'view' => NULL,
'settings' => [],
'location' => NULL,
'rows' => [],
],
'file' => 'views_slideshow.theme.inc',
'function' => 'template_preprocess_views_slideshow_pager_widget_render',
],
'views_slideshow_pager_fields' => [
'variables' => [
'vss_id' => NULL,
'view' => NULL,
'settings' => [],
'location' => NULL,
'attributes' => [],
],
'file' => 'views_slideshow.theme.inc',
],
'views_slideshow_pager_field_field' => [
'variables' => [
'view' => NULL,
'css_identifier' => NULL,
'label' => NULL,
'output' => NULL,
],
'file' => 'views_slideshow.theme.inc',
],
'views_slideshow_pager_field_item' => [
'variables' => [
'vss_id' => NULL,
'item' => NULL,
'count' => NULL,
'location' => NULL,
'length' => NULL,
],
],
'views_slideshow_pager_bullets' => [
'variables' => [
'vss_id' => NULL,
'view' => NULL,
'settings' => [],
'location' => NULL,
'attributes' => [],
],
'file' => 'views_slideshow.theme.inc',
],
'views_slideshow_controls_widget_render' => [
'variables' => [
'vss_id' => NULL,
'view' => NULL,
'settings' => [],
'location' => NULL,
'rows' => [],
],
'file' => 'views_slideshow.theme.inc',
'function' => 'template_preprocess_views_slideshow_controls_widget_render',
],
'views_slideshow_controls_text' => [
'variables' => [
'vss_id' => NULL,
'view' => NULL,
'settings' => [],
'location' => NULL,
'rows' => [],
],
'file' => 'views_slideshow.theme.inc',
],
'views_slideshow_controls_text_previous' => [
'variables' => [
'vss_id' => NULL,
'view' => NULL,
'settings' => [],
],
'file' => 'views_slideshow.theme.inc',
],
'views_slideshow_controls_text_pause' => [
'variables' => [
'vss_id' => NULL,
'view' => NULL,
'settings' => [],
],
'file' => 'views_slideshow.theme.inc',
],
'views_slideshow_controls_text_next' => [
'variables' => [
'vss_id' => NULL,
'view' => NULL,
'settings' => [],
],
'file' => 'views_slideshow.theme.inc',
],
'views_slideshow_slide_counter_widget_render' => [
'variables' => [
'vss_id' => NULL,
'view' => NULL,
'settings' => [],
'location' => NULL,
'rows' => [],
],
'file' => 'views_slideshow.theme.inc',
'function' => 'template_preprocess_views_slideshow_slide_counter_widget_render',
],
'views_slideshow_slide_counter' => [
'variables' => [
'vss_id' => NULL,
'view' => NULL,
'settings' => [],
'location' => NULL,
'rows' => [],
],
'file' => 'views_slideshow.theme.inc',
],
];
}
/**
* Views Slideshow: Slideshow.
*
* As it is a preprocess function, store it with other functions in theme.inc.
*/
function template_preprocess_views_view_slideshow(&$vars) {
\Drupal::moduleHandler()->loadInclude('views_slideshow', 'inc', 'views_slideshow.theme');
_views_slideshow_preprocess_views_view_slideshow($vars);
}