You are here

function _swftools_imagerotator_flashvars in SWF Tools 6.3

This function is called from swftools_imagerotator_swftools_flashvars() which is called from swf() It will return the default flashvar configuration, just prior to any overrides passed into swf(). We start with the settings defined on admin/swf/imagerotator which are returned by _swftools_imagerotator_settings(). Then we prepare these values for output to html (eg. '1' become 'true') and we unset undefined flashvars to prevent their output.

2 calls to _swftools_imagerotator_flashvars()
swftools_imagerotator_swftools_playlist_imagerotator in imagerotator/swftools_imagerotator.module
Implementation of hook_swftools_playlist_PLAYER().
swftools_imagerotator_swftools_preprocess_imagerotator in imagerotator/swftools_imagerotator.module
Implementation of hook_swftools_preprocess_[player]().

File

imagerotator/swftools_imagerotator.module, line 152
Enables SWF Tools support for the LongTail ImageRotator.

Code

function _swftools_imagerotator_flashvars($profile = '') {

  // Initialise cache to handle repeated calls
  static $cache = array();

  // Store name of profile
  $_profile = $profile ? $profile : SWFTOOLS_UNDEFINED;

  // If no settings stored for this profile then fetch them
  if (!isset($cache[$_profile])) {

    // Get saved settings for this method.
    $settings = _swftools_imagerotator_settings($profile);

    // Flatten defaults
    swftools_array_flatten($settings);

    // Iterate over boolean settings
    foreach (array(
      'showicons',
      'shownavigation',
      'shuffle',
      'enablejs',
      'linkfromdisplay',
    ) as $key) {

      // Settings are already encoded properly on the settings page, but if we called from PHP it might be 1/0 or TRUE/FALSE
      if ($settings[$key] != 'default') {
        $settings[$key] = _swftools_tf($settings[$key]);
      }
    }

    // Store the result
    $cache[$_profile] = $settings;
  }

  // Return the result
  return $cache[$_profile];
}