You are here

function _royalslider_optionset_defaults in RoyalSlider Integration 7

Default settings for a newly created option set

Parameters

string $key [optional]: Get specific default value

Return value

array

5 calls to _royalslider_optionset_defaults()
royalslider_ctools_export_ui_form_submit in plugins/export_ui/royalslider_ctools_export_ui.inc
Submit handler
royalslider_optionset_create in ./royalslider.module
Create a new optionset object
royalslider_optionset_save in ./royalslider.module
Saves the given optionset to the database. Set the $new flag if this optionset has not been written before.
royalslider_option_elements in ./royalslider.admin.inc
Defines the form elements used to edit the RoyalSlider library options
_royalslider_remove_default_optionset_options in ./royalslider.module
Strip options with default values from the Option Set options so that we don't add unecessary options.

File

./royalslider.module, line 302
RoyalSlider module.

Code

function _royalslider_optionset_defaults($key = NULL) {
  $defaults = array(
    // General.
    'manuallyInit' => FALSE,
    'loop' => FALSE,
    'loopRewind' => FALSE,
    'randomizeSlides' => FALSE,
    'usePreloader' => TRUE,
    'numImagesToPreload' => 4,
    'slidesOrientation' => 'horizontal',
    'globalCaption' => FALSE,
    // Full Screen.
    'fullscreen' => array(
      'enabled' => FALSE,
      'keyboardNav' => TRUE,
      'buttonFS' => TRUE,
      'nativeFS' => FALSE,
    ),
    // Navigation.
    'controlNavigation' => 'bullets',
    'controlsInside' => TRUE,
    'sliderDrag' => TRUE,
    'sliderTouch' => TRUE,
    'keyboardNavEnabled' => FALSE,
    'navigateByClick' => TRUE,
    'arrowsNav' => TRUE,
    'arrowsNavAutoHide' => TRUE,
    'arrowsNavHideOnTouch' => FALSE,
    // Thumbnails.
    'thumbs' => array(
      'drag' => TRUE,
      'touch' => TRUE,
      'orientation' => 'horizontal',
      'arrows' => TRUE,
      'spacing' => 4,
      'arrowsAutoHide' => FALSE,
      'autoCenter' => TRUE,
      'transitionSpeed' => 600,
      'fitInViewport' => TRUE,
      'firstMargin' => TRUE,
      'arrowLeft' => NULL,
      'arrowRight' => NULL,
      'appendSpan' => FALSE,
    ),
    // Transitions.
    'transitionType' => 'move',
    'transitionSpeed' => 600,
    'easeInOut' => 'easeInOutSine',
    'easeOut' => 'easeOutSine',
    'allowCSS3' => TRUE,
    // Note: that since only 3 easing methods are available
    // in CSS3 by default with RoyalSlider and we'd have to implement the rest
    // ourselves, it's probably best to set this to FALSE in most Option Sets.
    // However, in order to maintain compatibility with the RoyalSlider API
    // we're leaving this be.
    'addActiveClass' => FALSE,
    'fadeinLoadedSlide' => TRUE,
    // Dimensions.
    'autoScaleSlider' => FALSE,
    'autoScaleSliderWidth' => 800,
    'autoScaleSliderHeight' => 400,
    'autoHeight' => FALSE,
    'imageScaleMode' => 'fit-if-smaller',
    'imageScalePadding' => 4,
    'imageAlignCenter' => TRUE,
    'imgWidth' => NULL,
    'imgHeight' => NULL,
    'slidesSpacing' => 8,
    // Autoplay
    'autoplay' => array(
      'enabled' => FALSE,
      'stopAtAction' => TRUE,
      'pauseOnHover' => TRUE,
      'delay' => 300,
    ),
    // Visible Nearby
    'visibleNearby' => array(
      'enabled' => TRUE,
      'centerArea' => 0.6,
      'center' => TRUE,
      'navigateByCenterClick' => TRUE,
      'breakpoint' => 0,
      'breakpointCenterArea' => 0.8,
    ),
    // Deep linking
    'deeplinking' => array(
      'enabled' => FALSE,
      'change' => FALSE,
      'prefix' => '',
    ),
    // Video
    'video' => array(
      'autoHideArrows' => TRUE,
      'autoHideControlNav' => FALSE,
      'autoHideBlocks' => FALSE,
      'youTubeCode' => '<iframe src="http://www.youtube.com/embed/%id%?rel=1&autoplay=1&showinfo=0" frameborder="no"></iframe>',
      'vimeoCode' => '<iframe src="http://player.vimeo.com/video/%id%?byline=0&amp;portrait=0&amp;autoplay=1" frameborder="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>',
    ),
    // Drupal-specific.
    'drupalAutoSetSliderDimensions' => FALSE,
    'drupalAutoSetImageDimensions' => TRUE,
  );

  // We add typecasts to ensure the variables get JSON encoded properly.
  _royalslider_typecast_optionset($defaults);

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

  // Return all items
  return $defaults;
}