You are here

public static function SlickBase::removeUnsupportedSettings in Slick Carousel 8.2

Remove settings that aren't supported by the active library.

1 call to SlickBase::removeUnsupportedSettings()
SlickBase::defaultSettings in src/Entity/SlickBase.php
Returns available slick default options under group 'settings'.

File

src/Entity/SlickBase.php, line 112

Class

SlickBase
Defines the Slick configuration entity.

Namespace

Drupal\slick\Entity

Code

public static function removeUnsupportedSettings(array &$settings = []) {
  $library = \Drupal::config('slick.settings')
    ->get('library');

  // The `focusOnSelect`is required to sync asNavFor, but removed. Here must
  // be kept for future fix, or less breaking changes due to different logic.
  if ($library == 'accessible-slick') {
    unset($settings['accessibility']);
    unset($settings['focusOnChange']);
  }
  else {
    unset($settings['regionLabel']);
    unset($settings['useGroupRole']);
    unset($settings['instructionsText']);
    unset($settings['useAutoplayToggleButton']);
    unset($settings['pauseIcon']);
    unset($settings['playIcon']);
    unset($settings['arrowsPlacement']);
  }
}