You are here

function _flexslider_optionset_defaults in Flex Slider 7.2

Same name and namespace in other branches
  1. 7 flexslider.module \_flexslider_optionset_defaults()

Default settings for a newly created option set

Parameters

string $key [optional]: Get specific default value

See also

https://github.com/woothemes/FlexSlider/blob/master/README.mdown

https://github.com/woothemes/FlexSlider/wiki/FlexSlider-Properties

6 calls to _flexslider_optionset_defaults()
flexslider_ctools_export_ui_form_submit in plugins/export_ui/flexslider_ctools_export_ui.inc
Submit handler
flexslider_optionset_create in ./flexslider.module
Create a new optionset object
flexslider_optionset_save in ./flexslider.module
Saves the given option set to the database. Set the $new flag if this set has not been written before.
flexslider_option_elements in ./flexslider.admin.inc
Defines the form elements used to edit the FlexSlider library options
flexslider_update_7200 in ./flexslider.install
Migrate settings from FlexSlider v1 to v2

... See full list

File

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

Code

function _flexslider_optionset_defaults($key = NULL) {

  // We add typecasts to ensure the variables get json encoded properly
  $defaults = array(
    // v2.x options
    'namespace' => 'flex-',
    'selector' => '.slides > li',
    'easing' => 'swing',
    'direction' => 'horizontal',
    'reverse' => FALSE,
    // @todo verify data value
    'smoothHeight' => FALSE,
    // @todo verify data value
    'startAt' => 0,
    'animationSpeed' => 600,
    'initDelay' => 0,
    'useCSS' => TRUE,
    'touch' => TRUE,
    'video' => FALSE,
    'keyboard' => TRUE,
    'multipleKeyboard' => FALSE,
    'mousewheel' => FALSE,
    // requires https://github.com/brandonaaron/jquery-mousewheel @todo add to make file
    'controlsContainer' => '.flex-control-nav-container',
    'sync' => '',
    'asNavFor' => '',
    'itemWidth' => 0,
    'itemMargin' => 0,
    'minItems' => 0,
    'maxItems' => 0,
    'move' => 0,
    //'start' => '',

    //'before' => '',

    //'after' => '',

    //'end' => '',

    //'added' => '',

    //'removed' => '',

    // @todo verify the 1.x options are still valid
    // v1.x options
    'animation' => 'fade',
    //'animationDuration' => 6000, -- replaced by 'animationSpeed'

    //'slidedirection' => 'horizontal', -- replaced by "direction"
    'slideshow' => TRUE,
    'slideshowSpeed' => 7000,
    'directionNav' => TRUE,
    'controlNav' => TRUE,
    //'keyboardnav' => TRUE, --  replaced by 'keyboard'

    //'mousewheel' => FALSE,
    'prevText' => t('Previous'),
    'nextText' => t('Next'),
    'pausePlay' => FALSE,
    'pauseText' => t('Pause'),
    'playText' => t('Play'),
    'randomize' => FALSE,
    'thumbCaptions' => FALSE,
    'thumbCaptionsBoth' => FALSE,
    //'slidetostart' => 0, // integer value, not boolean --  replace by "startAt"
    'animationLoop' => TRUE,
    'pauseOnAction' => TRUE,
    'pauseOnHover' => FALSE,
    //'controlscontainer' => '.flex-nav-container', -- updated in v2
    'manualControls' => '',
  );

  // Typecast the values
  _flexslider_typecast_optionset($defaults);

  // Return the specific item
  if (isset($key) and array_key_exists($key, $defaults)) {
    return $defaults[$key];
  }

  // Return all items
  return $defaults;
}