You are here

function theme_views_slideshow_singleframe_no_display_section in Views Slideshow 6.2

Add the HTML for the hidden slideshow elements.

1 theme call to theme_views_slideshow_singleframe_no_display_section()
template_preprocess_views_slideshow_singleframe in contrib/views_slideshow_singleframe/views_slideshow_singleframe.theme.inc
Implements template_preprocess_hook_THEMENAME().

File

contrib/views_slideshow_singleframe/views_slideshow_singleframe.theme.inc, line 110
Theme & preprocess functions for the Views Slideshow: SingleFrame module.

Code

function theme_views_slideshow_singleframe_no_display_section($view, $rows, $vss_id, $mode) {

  // Retrive the number of itmes per frame
  if (isset($view->display_handler->display->display_options['style_options']['views_slideshow_singleframe']['items_per_slide']) && $view->display_handler->display->display_options['style_options']['views_slideshow_singleframe']['items_per_slide'] > 0) {
    $items_per_slide = $view->display_handler->display->display_options['style_options']['views_slideshow_singleframe']['items_per_slide'];
  }
  elseif (isset($view->display['default']->display_options['style_options']['views_slideshow_singleframe']['items_per_slide']) && $view->display['default']->display_options['style_options']['views_slideshow_singleframe']['items_per_slide'] > 0) {
    $items_per_slide = $view->display['default']->display_options['style_options']['views_slideshow_singleframe']['items_per_slide'];
  }
  else {
    $items_per_slide = 1;
  }

  // Add the slideshow elements.
  $attributes['id'] = "views_slideshow_singleframe_teaser_section_" . $vss_id;
  $attributes['class'] = 'views_slideshow_singleframe_teaser_section';
  $attributes = drupal_attributes($attributes);
  $output = "<div{$attributes}>";
  $items = array();
  $slideshow_count = 0;
  foreach ($rows as $count => $item) {
    $items[] = $item;
    if (count($items) == $items_per_slide || $count == count($rows) - 1) {
      $output .= theme('views_slideshow_singleframe_no_display_teaser', $items, $vss_id, $slideshow_count, count($rows));
      $items = array();
      $slideshow_count++;
    }
  }
  $output .= "</div>\n";
  return $output;
}