Révision 18596a08
Ajouté par Assos Assos il y a presque 7 ans
drupal7/sites/all/modules/views_slideshow/contrib/views_slideshow_cycle/theme/views_slideshow_cycle.theme.inc | ||
---|---|---|
8 | 8 |
/** |
9 | 9 |
* Views Slideshow: Theme the main frame wrapper. |
10 | 10 |
* |
11 |
* @param array $vars |
|
12 |
* Theme variables. |
|
13 |
* |
|
11 | 14 |
* @ingroup vss_theme |
12 | 15 |
*/ |
13 | 16 |
function template_preprocess_views_slideshow_cycle_main_frame(&$vars) { |
... | ... | |
67 | 70 |
$settings['vss_id'] = $vss_id; |
68 | 71 |
} |
69 | 72 |
|
73 |
$module_path = drupal_get_path('module', 'views_slideshow_cycle'); |
|
74 |
|
|
70 | 75 |
// Don't load JavaScript unless libraries module is present. |
71 | 76 |
if (module_exists('libraries')) { |
72 | 77 |
// Load jQuery Cycle. |
... | ... | |
97 | 102 |
} |
98 | 103 |
|
99 | 104 |
// Load our cycle js. |
100 |
$module_path = drupal_get_path('module', 'views_slideshow_cycle'); |
|
101 | 105 |
drupal_add_js($module_path . '/js/views_slideshow_cycle.js'); |
102 | 106 |
|
103 | 107 |
// Load the pause library. |
... | ... | |
114 | 118 |
// Add the slideshow elements. |
115 | 119 |
$vars['classes_array'][] = 'views_slideshow_cycle_teaser_section'; |
116 | 120 |
|
117 |
$styles = '';
|
|
121 |
$styles = array();
|
|
118 | 122 |
if (isset($view->display_handler->display->display_options['style_options']['views_slideshow_cycle'])) { |
119 | 123 |
$styles = $view->display_handler->display->display_options['style_options']['views_slideshow_cycle']; |
120 | 124 |
} |
121 | 125 |
|
122 |
$styles_default = '';
|
|
126 |
$styles_default = array();
|
|
123 | 127 |
if (isset($view->display['default']->display_options['style_options']['views_slideshow_cycle'])) { |
124 | 128 |
$styles_default = $view->display['default']->display_options['style_options']['views_slideshow_cycle']; |
125 | 129 |
} |
126 | 130 |
|
127 |
// Retrive the number of items per frame. |
|
131 |
// Retrieve the number of items per frame.
|
|
128 | 132 |
if (isset($styles['items_per_slide']) && $styles['items_per_slide'] > 0) { |
129 | 133 |
$items_per_slide = $styles['items_per_slide']; |
130 | 134 |
} |
... | ... | |
138 | 142 |
$vars['items_per_slide'] = $items_per_slide; |
139 | 143 |
|
140 | 144 |
$widgets = $vars['options']['widgets']; |
141 |
if (isset($options['top']['views_slideshow_pager']['enabled']) && $options['top']['views_slideshow_pager']['enabled']) {
|
|
145 |
if (isset($widgets['top']['views_slideshow_pager']['enable']) && $widgets['top']['views_slideshow_pager']['enable']) {
|
|
142 | 146 |
$aria = "aria-labelledby='views_slideshow_pager_field_item_top_${vss_id}_"; |
143 | 147 |
} |
144 |
else { |
|
148 |
elseif (isset($widgets['bottom']['views_slideshow_pager']['enable']) && $widgets['bottom']['views_slideshow_pager']['enable']) {
|
|
145 | 149 |
$aria = "aria-labelledby='views_slideshow_pager_field_item_bottom_${vss_id}_"; |
146 | 150 |
} |
151 |
else { |
|
152 |
$aria = ""; |
|
153 |
} |
|
147 | 154 |
|
148 | 155 |
|
149 | 156 |
$items = array(); |
... | ... | |
153 | 160 |
foreach ($rows as $count => $item) { |
154 | 161 |
$items[] = $item; |
155 | 162 |
if (count($items) == $items_per_slide || $count == (count($rows) - 1)) { |
156 |
$rendered_rows .= theme(views_theme_functions('views_slideshow_cycle_main_frame_row', $vars['view'], $vars['view']->display[$vars['view']->current_display]), array(
|
|
163 |
$slide = array(
|
|
157 | 164 |
'vss_id' => $vss_id, |
158 | 165 |
'items' => $items, |
159 | 166 |
'count' => $slideshow_count, |
160 | 167 |
'view' => $vars['view'], |
161 |
'aria' => $aria . $slideshow_count . "'", |
|
162 | 168 |
'last_slide' => $last_slide, |
163 |
)); |
|
169 |
); |
|
170 |
if ($aria) { |
|
171 |
$slide['aria'] = $aria . $slideshow_count . "'"; |
|
172 |
} |
|
173 |
else { |
|
174 |
$slide['aria'] = ''; |
|
175 |
} |
|
176 |
$rendered_rows .= theme(views_theme_functions('views_slideshow_cycle_main_frame_row', $vars['view'], $vars['view']->display[$vars['view']->current_display]), $slide); |
|
164 | 177 |
$items = array(); |
165 | 178 |
$slideshow_count++; |
166 | 179 |
} |
... | ... | |
172 | 185 |
/** |
173 | 186 |
* Views Slideshow slideshow rows. |
174 | 187 |
* |
188 |
* @param array $vars |
|
189 |
* Theme variables. |
|
190 |
* |
|
175 | 191 |
* @ingroup vss_theme |
176 | 192 |
*/ |
177 | 193 |
function template_preprocess_views_slideshow_cycle_main_frame_row(&$vars) { |
... | ... | |
205 | 221 |
/** |
206 | 222 |
* Implements hook_preprocess_views_slideshow_cycle_main_frame_row_item(). |
207 | 223 |
* |
224 |
* @param array $vars |
|
225 |
* Theme variables. |
|
226 |
* |
|
208 | 227 |
* @ingroup vss_theme |
209 | 228 |
*/ |
210 | 229 |
function template_preprocess_views_slideshow_cycle_main_frame_row_item(&$vars) { |
... | ... | |
226 | 245 |
/** |
227 | 246 |
* Implements hook_preprocess_views_slideshow_pager_fields(). |
228 | 247 |
* |
248 |
* @param array $vars |
|
249 |
* Theme variables. |
|
250 |
* |
|
229 | 251 |
* @ingroup vss_theme |
230 | 252 |
*/ |
231 | 253 |
function views_slideshow_cycle_preprocess_views_slideshow_pager_fields(&$vars) { |
... | ... | |
266 | 288 |
/** |
267 | 289 |
* Implements hook_preprocess_views_slideshow_slide_counter(). |
268 | 290 |
* |
291 |
* @param array $vars |
|
292 |
* Theme variables. |
|
293 |
* |
|
269 | 294 |
* @ingroup vss_theme |
270 | 295 |
*/ |
271 | 296 |
function views_slideshow_cycle_preprocess_views_slideshow_slide_counter(&$vars) { |
... | ... | |
276 | 301 |
} |
277 | 302 |
|
278 | 303 |
/** |
279 |
* Backwards compatability wrapper. |
|
304 |
* Backwards comparability wrapper. |
|
305 |
* |
|
306 |
* @param array $vars |
|
307 |
* Theme variables. |
|
280 | 308 |
* |
281 | 309 |
* @deprecated Removed in 3.5 when the hook_theme() implementation was fixed. |
282 | 310 |
* |
... | ... | |
289 | 317 |
} |
290 | 318 |
|
291 | 319 |
/** |
292 |
* Backwards compatability wrapper. |
|
320 |
* Backwards compatibility wrapper. |
|
321 |
* |
|
322 |
* @param array $vars |
|
323 |
* Theme variables. |
|
293 | 324 |
* |
294 | 325 |
* @deprecated Removed in 3.5 when the hook_theme() implementation was fixed. |
295 | 326 |
* |
... | ... | |
302 | 333 |
} |
303 | 334 |
|
304 | 335 |
/** |
305 |
* Backwards compatability wrapper. |
|
336 |
* Backwards compatibility wrapper. |
|
337 |
* |
|
338 |
* @param array $vars |
|
339 |
* Theme variables. |
|
306 | 340 |
* |
307 | 341 |
* @deprecated Removed in 3.5 when the hook_theme() implementation was fixed. |
308 | 342 |
* |
Formats disponibles : Unified diff
Weekly update of contrib modules