You are here

public function SlickManager::prepareWrapperAttributes in Slick Carousel 7.3

Prepare attributes for the known module features, not necessarily users'.

1 call to SlickManager::prepareWrapperAttributes()
SlickManager::preRenderWrapper in src/SlickManager.php

File

src/SlickManager.php, line 475

Class

SlickManager
Implements SlickManagerInterface.

Namespace

Drupal\slick

Code

public function prepareWrapperAttributes(array $settings = []) {
  $classes = [];
  if (!empty($settings['skin'])) {
    $classes[] = str_replace('_', '-', $settings['skin']);
  }
  if (!empty($settings['skin_thumbnail'])) {
    $classes[] = str_replace('_', '-', $settings['skin_thumbnail']);
  }
  if (!empty($settings['vertical'])) {
    $classes[] = 'v';
  }
  if (!empty($settings['vertical_tn'])) {
    $classes[] = 'v-tn';
  }
  if (!empty($settings['thumbnail_position'])) {
    $classes[] = 'tn-' . $settings['thumbnail_position'];
    if (strpos($settings['thumbnail_position'], 'over') !== FALSE) {
      $classes[] = 'tn-overlay';
      $classes[] = 'tn-' . str_replace('over-', '', $settings['thumbnail_position']);
    }
  }
  $attributes['class'][] = 'slick-wrapper';
  foreach ($classes as $class) {
    $attributes['class'][] = 'slick-wrapper--' . $class;
  }
  return $attributes;
}