You are here

function template_preprocess_views_slideshow_xtra_image in Views Slideshow Xtra 7.2

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

Image element template_preprocess.

File

theme/views_slideshow_xtra.theme.inc, line 180
Views Slideshow Xtra theming functions.

Code

function template_preprocess_views_slideshow_xtra_image(&$vars) {

  // Classes
  $vars['classes_array'][] = 'views-slideshow-xtra-element';
  $vars['classes_array'][] = 'views-slideshow-xtra-image-' . $vars['slide_count'] . '-' . $vars['field_item_count'];
  if (!empty($vars['vsx']['classes'])) {
    $vars['classes_array'][] = $vars['vsx']['classes'];
  }

  // Styles variable
  $vars['styles'] = $vars['vsx']['styles'];

  // Text variable
  $vars['text'] = $vars['vsx']['text'];

  // url variable
  $vars['url'] = $vars['vsx']['url'];

  // src variable
  $vars['src'] = $vars['vsx']['src'];

  // target variable
  $vars['target'] = $vars['vsx']['target'];
  $js_vars = array(
    'viewsSlideshowXtra' => array(
      $vars['vss_id'] => array(
        'slideInfo' => array(
          'image' => array(
            'slide-' . $vars['slide_count'] => array(
              'item-' . $vars['field_item_count'] => array(
                'left' => $vars['vsx']['left'],
                'top' => $vars['vsx']['top'],
              ),
            ),
          ),
        ),
      ),
    ),
  );
  drupal_add_js($js_vars, 'setting');
}