View source
<?php
function views_slideshow_xtra_overlay_views_slideshow_widget_info() {
return array(
'views_slideshow_xtra_overlay' => array(
'name' => t('Views Slideshow Xtra Overlay'),
'accepts' => array(
'transitionBegin' => array(
'required' => TRUE,
),
),
'calls' => array(),
),
);
}
function views_slideshow_xtra_overlay_views_slideshow_option_definition() {
$locations = array(
'top',
'bottom',
);
foreach ($locations as $location) {
$options['widgets']['contains'][$location]['contains']['views_slideshow_xtra_overlay']['contains']['fields'] = array();
$options['widgets']['contains'][$location]['contains']['views_slideshow_xtra_overlay']['contains']['pause_after_mouse_move'] = array(
'default' => 2000,
);
}
return $options;
}
function views_slideshow_xtra_overlay_views_slideshow_widget_form_options(&$form, &$form_state, &$view, $defaults, $dependency) {
$options = array();
$form['views_slideshow_xtra_overlay_wrapper'] = array(
'#markup' => '<div class="vs-dependent">',
);
$form['pause_after_mouse_move'] = array(
'#type' => 'textfield',
'#title' => t('Pause After Mouse Movement'),
'#default_value' => $defaults['pause_after_mouse_move'],
'#size' => 10,
'#description' => t('Number of milliseconds to pause slide transition after mouse movement. This allows the user time to click a slide overlay element if the mouse is in motion. This setting has no effect if "Pause on hover" is checked above.'),
'#states' => array(
'visible' => array(
':input[name="' . $dependency . '[enable]"]' => array(
'checked' => TRUE,
),
),
),
);
$form['views_slideshow_xtra_overlay_wrapper_close'] = array(
'#markup' => '</div>',
);
}
function views_slideshow_xtra_overlay_theme($existing, $type, $theme, $path) {
return array(
'views_slideshow_xtra_overlay_widget_render' => array(
'variables' => array(
'vss_id' => NULL,
'view' => NULL,
'settings' => array(),
'location' => NULL,
'rows' => array(),
),
'file' => 'theme/views_slideshow_xtra_overlay.theme.inc',
),
'views_slideshow_xtra_overlay_row' => array(
'variables' => array(
'item' => NULL,
'count' => NULL,
'view' => NULL,
),
'template' => 'theme/views-slideshow-xtra-overlay-row',
),
);
}
include_once 'theme/views_slideshow_xtra_overlay.theme.inc';
function template_preprocess_views_slideshow_xtra_overlay(&$vars) {
_views_slideshow_xtra_overlay_preprocess_views_slideshow_xtra_overlay($vars);
}
function template_preprocess_views_slideshow_xtra_overlay_row(&$vars) {
_views_slideshow_xtra_overlay_preprocess_views_slideshow_xtra_overlay_row($vars);
}