You are here

function views_fractionslider_preprocess_views_view_fields in Views FractionSlider 7.2

Preprocess theme function to print a single record from a row, with fields.

File

views/views_fractionslider.module, line 50
Provide an fractionslider display style for Views.

Code

function views_fractionslider_preprocess_views_view_fields(&$vars) {
  $view = $vars['view'];
  if ($view->style_plugin->plugin_name == 'views_fractionslider') {
    foreach ($vars['fields'] as $id => $field) {
      $options = $view->style_options[$id];
      $position = 'data-position="' . $options['space'] . ',' . $options['lspace'] . '"';
      $in = ' data-in="' . $options['data-in'] . '"';
      $out = ' data-out="' . $options['data-out'] . '"';
      $step = ' data-step="' . $options['data-step'] . '"';
      $time = ' data-time="' . $options['data-time'] . '"';
      $easein = ' data-ease-in="' . $options['data-ease-in'] . '"';
      $easeout = ' data-ease-out="' . $options['data-ease-out'] . '"';
      $attributes = $position . $in . $out . $step . $time . $easein . $easeout;
      $frac_wrap = '<div class="slide-in views-fraction-' . $id . '" ' . $attributes . '>';
      $field->wrapper_prefix = $frac_wrap . $field->wrapper_prefix;
      $field->wrapper_suffix = $field->wrapper_suffix . '</div>';
    }
  }
}