You are here

function _shadowbox_get_settings in Shadowbox 7.3

Same name and namespace in other branches
  1. 8 shadowbox.module \_shadowbox_get_settings()
  2. 7.4 shadowbox.module \_shadowbox_get_settings()

Construct the JS settings array.

Parameters

$override: An array of settings to override global values.

Return value

An array containing settings to be used in drupal_add_js.

1 call to _shadowbox_get_settings()
shadowbox_library in ./shadowbox.module
Implements hook_library().

File

./shadowbox.module, line 226
Shadowbox, a JavaScript media viewer application for displaying content in a modal dialogue.

Code

function _shadowbox_get_settings($override = array()) {
  global $language;
  $settings = array(
    'animate' => variable_get('shadowbox_animate', TRUE),
    'animateFade' => variable_get('shadowbox_animate_fade', TRUE),
    'animSequence' => variable_get('shadowbox_animation_sequence', 'wh'),
    'auto_enable_all_images' => variable_get('shadowbox_auto_enable_all_images', 0),
    'auto_gallery' => variable_get('shadowbox_auto_gallery', 0),
    'autoplayMovies' => variable_get('shadowbox_autoplay_movies', 1) === 1 ? TRUE : FALSE,
    'continuous' => variable_get('shadowbox_continuous_galleries', FALSE),
    'counterLimit' => variable_get('shadowbox_counter_limit', 10),
    'counterType' => variable_get('shadowbox_counter_type', 'default'),
    'displayCounter' => variable_get('shadowbox_display_counter', TRUE),
    'displayNav' => variable_get('shadowbox_display_nav', TRUE),
    'enableKeys' => variable_get('shadowbox_enable_keys', TRUE),
    'fadeDuration' => variable_get('shadowbox_fade_duration', 0.35),
    'handleOversize' => variable_get('shadowbox_handle_oversize', 'resize'),
    'handleUnsupported' => variable_get('shadowbox_handle_unsupported', 'link'),
    'initialHeight' => variable_get('shadowbox_initial_height', 160),
    'initialWidth' => variable_get('shadowbox_initial_width', 320),
    'language' => $language->language,
    'modal' => !variable_get('shadowbox_overlay_listen', TRUE),
    'overlayColor' => '#' . variable_get('shadowbox_overlay_color', '000'),
    'overlayOpacity' => variable_get('shadowbox_overlay_opacity', 0.8),
    //'players' => $players,
    'resizeDuration' => variable_get('shadowbox_resize_duration', 0.55),
    'showMovieControls' => variable_get('shadowbox_show_movie_controls', TRUE),
    'slideshowDelay' => variable_get('shadowbox_slideshow_delay', 0),
    'viewportPadding' => variable_get('shadowbox_viewport_padding', 20),
    'useSizzle' => variable_get('shadowbox_use_sizzle', FALSE),
  );
  $settings = array_merge($settings, $override);
  $settings = array(
    'shadowbox' => $settings,
  );
  return $settings;
}