Same name and namespace in other branches
  1. 8.x-1.x src/Form/ColorboxSettingsForm.php \Drupal\colorbox\Form\ColorboxSettingsForm::getState() 1 comment

Get one of the pre-defined states used in this form.

Parameters

string $state: The state to get that matches one of the state class constants.

Return value

array A corresponding form API state.

1 call to ColorboxSettingsForm::getState()
ColorboxSettingsForm::buildForm in src/Form/ColorboxSettingsForm.php

File

src/Form/ColorboxSettingsForm.php, line 472

Class

ColorboxSettingsForm
General configuration form for controlling the colorbox behaviour..

Namespace

Drupal\colorbox\Form

Code

protected function getState($state) {
    $states = [
        static::STATE_CUSTOM_SETTINGS => [
            'visible' => [
                ':input[name="colorbox_custom_settings_activate"]' => [
                    'value' => '1',
                ],
            ],
        ],
        static::STATE_SLIDESHOW_ENABLED => [
            'visible' => [
                ':input[name="colorbox_slideshow"]' => [
                    'value' => '1',
                ],
            ],
        ],
    ];
    return $states[$state];
}