You are here

function template_preprocess_views_slideshow_xtra_link 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_link()
  2. 7.3 theme/views_slideshow_xtra.theme.inc \template_preprocess_views_slideshow_xtra_link()
  3. 7 theme/views_slideshow_xtra.theme.inc \template_preprocess_views_slideshow_xtra_link()

Link element template_preprocess.

File

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

Code

function template_preprocess_views_slideshow_xtra_link(&$vars) {

  // Classes
  $vars['classes_array'][] = 'views-slideshow-xtra-element';
  $vars['classes_array'][] = 'views-slideshow-xtra-link-' . $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'];
  $js_vars = array(
    'viewsSlideshowXtra' => array(
      $vars['vss_id'] => array(
        'slideInfo' => array(
          'link' => 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');

  // Lightbox
  if ($vars['vsx']['lightbox']) {
    $vars['url'] .= '?width=' . $vars['vsx']['width'] . '&height=' . $vars['vsx']['height'] . '&iframe=true';
  }
}