You are here

function _swftools_simpleviewer_vars in SWF Tools 6.3

Remap values from the settings form to the format needed to build player output.

2 calls to _swftools_simpleviewer_vars()
swftools_simpleviewer_swftools_playlist_simpleviewer in simpleviewer/swftools_simpleviewer.module
Implementation of hook_swftools_playlist().
swftools_simpleviewer_swftools_preprocess_simpleviewer in simpleviewer/swftools_simpleviewer.module
Implementation of hook_swftools_preprocess_[player]().

File

simpleviewer/swftools_simpleviewer.module, line 205
Enables SWF Tools support for SimpleViewer.

Code

function _swftools_simpleviewer_vars($profile) {

  // Cache this
  static $cache = array();

  // If profile is not set then we need a name to cache it
  $_profile = $profile ? $profile : SWFTOOLS_UNDEFINED;

  // If values not already populated then get them
  if (!isset($cache[$_profile])) {

    // Get current defaults
    $settings = _swftools_simpleviewer_settings($profile);

    // Attach height and width
    $cache[$_profile]['swf'] = array(
      'width' => $settings['appearance']['width'],
      'height' => $settings['appearance']['height'],
    );

    // Don't attach swf appearance settings to xml
    unset($settings['appearance']['swf']);

    // Attach remaining appearance variables to xml
    $cache[$_profile]['xml'] = $settings['appearance'];

    // Attach imagecache settings
    $cache[$_profile]['imagecache'] = $settings['imagecache'];

    // Attach flickr settings
    $cache[$_profile]['flickr'] = $settings['flickr'];
  }

  // Return remapped variables
  return $cache[$_profile];
}