You are here

SlickDefault.php in Slick Carousel 8.2

Same filename and directory in other branches
  1. 8 src/SlickDefault.php
  2. 7.3 src/SlickDefault.php

Namespace

Drupal\slick

File

src/SlickDefault.php
View source
<?php

namespace Drupal\slick;

use Drupal\blazy\BlazyDefault;

/**
 * Defines shared plugin default settings for field formatter and Views style.
 *
 * @see FormatterBase::defaultSettings()
 * @see StylePluginBase::defineOptions()
 */
class SlickDefault extends BlazyDefault {

  /**
   * {@inheritdoc}
   */
  public static function baseSettings() {
    return [
      'optionset' => 'default',
      'override' => FALSE,
      'overridables' => [],
      'skin' => '',
      'skin_arrows' => '',
      'skin_dots' => '',
      'use_theme_field' => FALSE,
    ] + parent::baseSettings();
  }

  /**
   * {@inheritdoc}
   */
  public static function gridSettings() {
    return [
      'preserve_keys' => FALSE,
      'visible_items' => 0,
    ] + parent::gridSettings();
  }

  /**
   * {@inheritdoc}
   */
  public static function imageSettings() {
    return [
      'optionset_thumbnail' => '',
      'skin_thumbnail' => '',
      'thumbnail_caption' => '',
      'thumbnail_effect' => '',
      'thumbnail_position' => '',
    ] + self::baseSettings() + parent::imageSettings() + self::gridSettings();
  }

  /**
   * {@inheritdoc}
   */
  public static function extendedSettings() {
    return [
      'thumbnail' => '',
    ] + self::imageSettings() + parent::extendedSettings();
  }

  /**
   * Returns HTML or layout related settings to shut up notices.
   *
   * @return array
   *   The default settings.
   */
  public static function htmlSettings() {
    return [
      'breaking' => FALSE,
      'display' => 'main',
      'grid' => 0,
      'id' => '',
      'lazy' => '',
      'library' => 'slick',
      'namespace' => 'slick',
      'nav' => FALSE,
      'navpos' => FALSE,
      'thumbnail_uri' => '',
      'route_name' => '',
      'unslick' => FALSE,
      'vanilla' => FALSE,
      'vertical' => FALSE,
      'vertical_tn' => FALSE,
      'view_name' => '',
    ] + self::imageSettings();
  }

  /**
   * Defines JS options required by theme_slick(), used with optimized option.
   */
  public static function jsSettings() {
    return [
      'asNavFor' => '',
      'downArrowTarget' => '',
      'downArrowOffset' => '',
      'lazyLoad' => 'ondemand',
      'prevArrow' => 'Previous',
      'nextArrow' => 'Next',
      'pauseIcon' => 'slick-pause-icon',
      'playIcon' => 'slick-play-icon',
      'rows' => 1,
      'slidesPerRow' => 1,
      'slide' => '',
      'slidesToShow' => 1,
      'vertical' => FALSE,
    ];
  }

  /**
   * Returns slick theme properties.
   */
  public static function themeProperties() {
    return [
      'attached',
      'attributes',
      'items',
      'options',
      'optionset',
      'settings',
    ];
  }

}

Classes

Namesort descending Description
SlickDefault Defines shared plugin default settings for field formatter and Views style.