You are here

function hook_views_slideshow_options_form_validate in Views Slideshow 8.3

Same name and namespace in other branches
  1. 6.3 views_slideshow.api.php \hook_views_slideshow_options_form_validate()
  2. 7.3 views_slideshow.api.php \hook_views_slideshow_options_form_validate()

Form validation callback for the slideshow settings.

1 function implements hook_views_slideshow_options_form_validate()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

views_slideshow_cycle_views_slideshow_options_form_validate in modules/views_slideshow_cycle/views_slideshow_cycle.module
Implements hook_views_slideshow_options_form_validate().
1 invocation of hook_views_slideshow_options_form_validate()
Slideshow::validateOptionsForm in src/Plugin/views/style/Slideshow.php
Validate the options form.

File

./views_slideshow.api.inc, line 181
Hooks provided by Views Slideshow.

Code

function hook_views_slideshow_options_form_validate(&$form, &$form_state, &$view) {
  if (!is_numeric($form_state['values']['style_options']['views_slideshow_cycle']['speed'])) {
    form_error($form['views_slideshow_cycle']['speed'], t('!setting must be numeric!', array(
      'Speed',
    )));
  }
  if (!is_numeric($form_state['values']['style_options']['views_slideshow_cycle']['timeout'])) {
    form_error($form['views_slideshow_cycle']['timeout'], t('!setting must be numeric!', array(
      'timeout',
    )));
  }
  if (!is_numeric($form_state['values']['style_options']['views_slideshow_cycle']['remember_slide_days'])) {
    form_error($form['views_slideshow_cycle']['remember_slide_days'], t('!setting must be numeric!', array(
      'Slide days',
    )));
  }
}