Same name and namespace in other branches
  1. 8.x-4.x modules/views_slideshow_cycle/src/Plugin/ViewsSlideshowType/Cycle.php \Drupal\views_slideshow_cycle\Plugin\ViewsSlideshowType\Cycle::validateConfigurationForm()

Overrides ViewsSlideshowTypeBase::validateConfigurationForm

Fichier

modules/views_slideshow_cycle/src/Plugin/ViewsSlideshowType/Cycle.php, line 550

Classe

Cycle
Provides a slideshow type based on jquery cycle.

Namespace

Drupal\views_slideshow_cycle\Plugin\ViewsSlideshowType

Code

public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
    $values = $form_state->getValue([
        'style_options',
        'views_slideshow_cycle',
    ]);
    if (!is_numeric($values['timeout'])) {
        $form_state->setErrorByName('style_options][views_slideshow_cycle][timeout', $this->t('@setting must be numeric!', [
            '@setting' => $this->t('Timeout'),
        ]));
    }
    if (!is_numeric($values['speed'])) {
        $form_state->setErrorByName('style_options][views_slideshow_cycle][speed', $this->t('@setting must be numeric!', [
            '@setting' => $this->t('Speed'),
        ]));
    }
    if (!is_numeric($values['remember_slide_days'])) {
        $form_state->setErrorByName('style_options][views_slideshow_cycle][remember_slide_days', $this->t('@setting must be numeric!', [
            '@setting' => $this->t('Slide days'),
        ]));
    }
}