You are here

public function SlickUi::getSlickResponsiveElements in Slick Carousel 7.2

Defines available options for the responsive Slick.

Parameters

int $count: The number of breakpoints.

Return value

array An array of Slick responsive options.

1 call to SlickUi::getSlickResponsiveElements()
SlickUi::edit_form in slick_ui/plugins/export_ui/SlickUi.class.php
Overrides the actual editing form.

File

slick_ui/plugins/export_ui/SlickUi.class.php, line 818
Contains the CTools export UI integration code.

Class

SlickUi
CTools Export UI class handler for Slick UI.

Code

public function getSlickResponsiveElements($count = 0) {
  $elements = array();
  $breakpoints = drupal_map_assoc(range(0, $count - 1));
  $slick_elements = slick_clean_options($this
    ->getSlickElements());
  foreach ($breakpoints as $key => $breakpoint) {
    $elements[$key] = array(
      'title' => t('Breakpoint #@key', array(
        '@key' => $key + 1,
      )),
      'type' => 'fieldset',
    );
    $elements[$key]['breakpoint'] = array(
      'title' => t('Breakpoint'),
      'description' => t('Breakpoint width in pixel. If mobileFirst enabled, equivalent to min-width, otherwise max-width.'),
      'type' => 'textfield',
      'field_suffix' => 'px',
      'default' => FALSE,
    );
    $elements[$key]['unslick'] = array(
      'title' => t('Unslick'),
      'description' => t("Disable Slick at a given breakpoint. Note, you can't window shrink this, once you unslick, you are unslicked."),
      'type' => 'checkbox',
      'default' => '',
    );
    $elements[$key]['settings'] = array();

    // Duplicate relevant main settings.
    foreach ($slick_elements as $name => $element) {
      $elements[$key]['settings'][$name] = $element;
    }

    // Allows form responsive elements information to be altered.
    drupal_alter('slick_ui_responsive_elements_info', $elements);
  }
  return $elements;
}