You are here

function template_preprocess_views_slideshow in Views Slideshow 6.2

Same name and namespace in other branches
  1. 6.3 views_slideshow.module \template_preprocess_views_slideshow()
  2. 7.3 theme/views_slideshow.theme.inc \template_preprocess_views_slideshow()

Views Slideshow: preprocess function for the slideshow.

File

./views_slideshow.module, line 48
Provides Slideshow style options for Views.

Code

function template_preprocess_views_slideshow(&$vars) {
  $vars['slideshow'] = '';
  $rows = $vars['rows'];

  // Remove empty rows.
  if (!empty($rows)) {
    foreach ($rows as $key => $data) {
      if (empty($data)) {
        unset($rows[$key]);
      }
    }
  }
  if (!empty($rows)) {
    $options = $vars['options'];
    if (in_array($options['mode'], array(
      'singleframe',
      'thumbnailhover',
      'menu',
      'ddblock',
      'slider',
    ))) {
      $options['mode'] = 'views_slideshow_' . $options['mode'];
    }
    $vars['slideshow'] = theme($options['mode'], $vars['view'], $options, $rows, $vars['title']);
  }
}