You are here

views_slideshow_slider.module in Views Slideshow Slider 6.3

Same filename and directory in other branches
  1. 6.2 views_slideshow_slider.module
  2. 7.3 views_slideshow_slider.module

Views Slideshow: slider has options for working with node views.

The slider mode adds two parts to the view: the first part is a series of items displayed as a list, the second part is either a full node or a node teaser. The slideshow will synchronize the two, so that the 'active' item will correspond to the single full/teaser item. The slide show can be set to advance automatically or on mouse hover/click.

File

views_slideshow_slider.module
View source
<?php

/**
 * @file
 * Views Slideshow: slider has options for working with node views.
 *
 * The slider mode adds two parts to the view: the first part is a
 * series of items displayed as a list, the second part is either a full node
 * or a node teaser. The slideshow will synchronize the two, so that the
 * 'active' item will correspond to the single full/teaser item. The slide show
 * can be set to advance automatically or on mouse hover/click.
 */

/**
 * Minimal jQuery UI version the slider is compatible with.
 **/
define('VIEWS_SLIDESHOW_SLIDER_JQUERY_UI_VERSION', 1.7);

/**
 * Implementation of hook_requirements().
 */
function views_slideshow_slider_requirements($phase) {
  $requirements = array();
  $t = get_t();
  $version = jquery_ui_get_version();
  $requirements['slider_jquery_ui'] = array(
    'title' => $t('Slider jQuery UI compatibility'),
    'value' => $version,
  );
  if (version_compare($version, VIEWS_SLIDESHOW_SLIDER_JQUERY_UI_VERSION) < 0) {
    $requirements['slider_jquery_ui']['descripion'] = $t('Views Slideshow Slider needs at least 1.7 version of the jQuery UI.');
    $requirements['slider_jquery_ui']['severity'] = REQUIREMENT_ERROR;
  }
  return $requirements;
}

/**
 * Implements hook_theme().
 */
function views_slideshow_slider_theme($existing, $type, $theme, $path) {
  return array(
    'views_slideshow_slider_widget_render' => array(
      'arguments' => array(
        'vss_id' => NULL,
      ),
      'template' => 'theme/templates/views-slideshow-slider',
      'file' => 'theme/views_slideshow_slider.theme.inc',
    ),
  );
}

/**
 * Implements hook_help().
 */
function views_slideshow_slider_help($path, $arg) {
  switch ($path) {
    case 'admin/help#views_slideshow_slider':
      if (module_exists('advanced_help')) {
        $output = '<p>' . l(t('Click here to view the documentation for Views Slideshow slider'), 'admin/advanced_help/views_slideshow_slider') . '</p>';
      }
      else {
        $output = '<p>' . t('Views Slideshow slider help can be found by installing and enabling the !advanced_help.', array(
          '!advanced_help' => l(t('Advanced Help module'), 'http://drupal.org/project/advanced_help'),
        )) . '</p>';
      }
      return $output;
  }
}

/**
 * Implements hook_views_slideshow_widget_info().
 */
function views_slideshow_slider_views_slideshow_widget_info() {
  return array(
    'views_slideshow_slider' => t('Slider'),
  );
}

/**
 * Implements WIDGET_views_slideshow_widget_form_options().
 */
function views_slideshow_slider_views_slideshow_widget_form_options(&$form, $form_state, $view, $defaults, $dependency) {
}

Functions

Constants

Namesort descending Description
VIEWS_SLIDESHOW_SLIDER_JQUERY_UI_VERSION Minimal jQuery UI version the slider is compatible with.