Révision a60304ed
Ajouté par Assos Assos il y a plus de 7 ans
drupal7/sites/all/modules/flexslider/flexslider_views/theme/flexslider_views.theme.inc | ||
---|---|---|
8 | 8 |
*/ |
9 | 9 |
|
10 | 10 |
/** |
11 |
* Add a preprocessor to prepare data from FlexSlider Views |
|
11 |
* Prepares variables for flexslider views templates. |
|
12 |
* |
|
13 |
* @see flexslider-views.tpl.php. |
|
12 | 14 |
*/ |
13 |
function template_process_flexslider_views(&$vars) { |
|
15 |
function template_process_flexslider_views(&$variables) {
|
|
14 | 16 |
// Only run the preprocessor if it is a view |
15 |
if (!empty($vars['view'])) { |
|
17 |
if (!empty($variables['view'])) {
|
|
16 | 18 |
// Prepare all data to be passed to theme_flexslider(). |
17 | 19 |
$items = array(); |
18 |
$view = $vars['view']; |
|
20 |
$view = $variables['view'];
|
|
19 | 21 |
$settings = array(); |
20 |
$settings['optionset'] = $vars['options']['optionset']; |
|
22 |
$settings['optionset'] = $variables['options']['optionset'];
|
|
21 | 23 |
|
22 | 24 |
$row_plugin = $view->style_plugin->row_plugin; |
23 | 25 |
|
24 |
foreach ($vars['rows'] as $id => $row) { |
|
26 |
foreach ($variables['rows'] as $id => $row) {
|
|
25 | 27 |
// Render the row into a slide |
26 | 28 |
$view->row_index = $id; |
27 | 29 |
$item['slide'] = $row_plugin->render($row); |
... | ... | |
30 | 32 |
} |
31 | 33 |
|
32 | 34 |
// Add the slide items to the variables |
33 |
$vars['items'] = $items; |
|
35 |
$variables['items'] = $items;
|
|
34 | 36 |
|
35 | 37 |
// Add the attributes |
36 |
$settings['attributes']['id'] = $vars['options']['id']; |
|
38 |
$settings['attributes']['id'] = $variables['options']['id'];
|
|
37 | 39 |
|
38 | 40 |
// Reset the options to the processed values |
39 |
$vars['settings'] = $settings; |
|
41 |
$variables['settings'] = $settings;
|
|
40 | 42 |
} |
41 |
return $vars; |
|
43 |
return $variables;
|
|
42 | 44 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules