You are here

function template_preprocess_views_bootstrap_carousel_plugin_style in Views Bootstrap 7.2

Same name and namespace in other branches
  1. 7.3 templates/carousel/theme.inc \template_preprocess_views_bootstrap_carousel_plugin_style()
  2. 7 templates/carousel/theme.inc \template_preprocess_views_bootstrap_carousel_plugin_style()

Implementation of template preprocess for the view.

File

templates/carousel/theme.inc, line 6

Code

function template_preprocess_views_bootstrap_carousel_plugin_style(&$vars) {
  drupal_add_js(array(
    'viewsBootstrap' => array(
      'carousel' => array(
        $vars['id'] => array(
          'id' => $vars['id'],
          'name' => $vars['view']->name,
          'attributes' => array(
            'interval' => $vars['options']['interval'] ? (int) $vars['options']['interval'] : FALSE,
            'pause' => $vars['options']['pause'] ? 'hover' : FALSE,
          ),
        ),
      ),
    ),
  ), 'setting');
  drupal_add_js(drupal_get_path('module', 'views_bootstrap') . '/js/views-bootstrap-carousel.js');
  $vars['classes_array'][] = 'carousel slide';
  $vars['navigation'] = (bool) $vars['options']['navigation'];
  $vars['indicators'] = (bool) $vars['options']['indicators'];
  $keys = array_keys($vars['rows']);
  $vars['first_key'] = reset($keys);
}