function views_slideshow_xtra_views_slideshow_widget_form_options in Views Slideshow Xtra 7.2
Same name and namespace in other branches
- 6.3 views_slideshow_xtra.module \views_slideshow_xtra_views_slideshow_widget_form_options()
- 7.3 views_slideshow_xtra.module \views_slideshow_xtra_views_slideshow_widget_form_options()
- 7 views_slideshow_xtra.module \views_slideshow_xtra_views_slideshow_widget_form_options()
Implements hook_views_slideshow_widget_form_options().
File
- ./
views_slideshow_xtra.module, line 78 - This module creates a Views Slideshow widget for overlaying HTML elements on a slideshow.
Code
function views_slideshow_xtra_views_slideshow_widget_form_options(&$form, &$form_state, &$view, $defaults, $dependency) {
$options = array();
// Get each field and it's name.
foreach ($view->display->handler
->get_handlers('field') as $field => $handler) {
$options[$field] = $handler
->ui_name();
}
// Need to wrap this so it indents correctly.
$form['views_slideshow_xtra_wrapper'] = array(
'#markup' => '<div class="vs-dependent-lvl2">',
);
// Add ability to choose which fields to show in the pager.
$form['fields'] = array(
'#type' => 'checkboxes',
'#title' => t('Fields'),
'#options' => $options,
'#default_value' => $defaults['fields'],
'#description' => t("Choose the field(s) to use as your views slideshow xtra fields."),
'#process' => array(
'form_process_checkboxes',
),
'#states' => array(
'visible' => array(
':input[name="' . $dependency . '[enable]"]' => array(
'checked' => TRUE,
),
),
),
);
// Text display delay.
$form['display_delay'] = array(
'#type' => 'textfield',
'#title' => t('Text Display Delay'),
'#default_value' => $defaults['display_delay'],
'#description' => t("How long, in milliseconds, to delay before displaying the text."),
'#states' => array(
'visible' => array(
':input[name="' . $dependency . '[enable]"]' => array(
'checked' => TRUE,
),
),
),
);
// Text display fade transition.
$form['display_delay_fade'] = array(
'#type' => 'checkbox',
'#title' => t('Fade in the text'),
'#default_value' => $defaults['display_delay_fade'],
'#states' => array(
'visible' => array(
':input[name="' . $dependency . '[enable]"]' => array(
'checked' => TRUE,
),
),
),
);
// Pause after mouse movement.
$form['pause_after_mouse_move'] = array(
'#type' => 'textfield',
'#title' => t('Pause After Mouse Movement'),
'#default_value' => $defaults['pause_after_mouse_move'],
'#description' => t("Temporarily pause slide transition to allow the user time to click a slide overlay link if the mouse is in motion."),
'#states' => array(
'visible' => array(
':input[name="' . $dependency . '[enable]"]' => array(
'checked' => TRUE,
),
),
),
);
$form['views_slideshow_xtra_wrapper_close'] = array(
'#markup' => '</div>',
);
}