You are here

function flexslider_optionset_list in Flex Slider 8.2

Gets an array of option sets suitable for using as select list options.

Return value

array Array of optionset labels keyed by id

2 calls to flexslider_optionset_list()
FlexSlider::buildOptionsForm in flexslider_views/src/Plugin/views/style/FlexSlider.php
Provide a form to edit options for this plugin.
FlexsliderFormatterTrait::buildSettingsForm in flexslider_fields/src/Plugin/Field/FieldFormatter/FlexsliderFormatterTrait.php
Builds the FlexSlider settings form.

File

./flexslider.module, line 204
A light-weight, customizable image gallery plugin for Drupal based on jQuery.

Code

function flexslider_optionset_list() {
  $optionsets = Flexslider::loadMultiple();
  $options = [];
  foreach ($optionsets as $name => $optionset) {
    $options[$name] = $optionset
      ->label();
  }
  if (empty($options)) {
    $options[''] = t('No defined option sets');
  }
  return $options;
}