You are here

protected function ElevateZoomPlusForm::getState in ElevateZoom Plus 8

Same name and namespace in other branches
  1. 7 modules/ui/src/Form/ElevateZoomPlusForm.php \Drupal\elevatezoomplus_ui\Form\ElevateZoomPlusForm::getState()

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.

File

modules/ui/src/Form/ElevateZoomPlusForm.php, line 696

Class

ElevateZoomPlusForm
Extends base form for elevatezoomplus instance configuration form.

Namespace

Drupal\elevatezoomplus_ui\Form

Code

protected function getState($state) {
  $states = [
    static::ZOOM_TYPE_INNER => [
      'visible' => [
        'select[name$="[zoomType]"]' => [
          'value' => 'inner',
        ],
      ],
    ],
    static::ZOOM_TYPE_LENS => [
      'visible' => [
        'select[name$="[zoomType]"]' => [
          'value' => 'lense',
        ],
      ],
    ],
    static::ZOOM_TYPE_WINDOW => [
      'visible' => [
        'select[name$="[zoomType]"]' => [
          'value' => 'window',
        ],
      ],
    ],
    static::SHOW_LENS => [
      'visible' => [
        ':input[name$="[showLens]"]' => [
          'checked' => TRUE,
        ],
      ],
    ],
  ];
  return $states[$state];
}