You are here

function wijering4_swftools_flashvars in SWF Tools 5

Same name and namespace in other branches
  1. 6 wijering4/wijering4.module \wijering4_swftools_flashvars()
  2. 6.2 wijering4/wijering4.module \wijering4_swftools_flashvars()

Implementation of swftools_flashvars hook. Return an array of flashvars.

File

wijering4/wijering4.module, line 141

Code

function wijering4_swftools_flashvars($action, &$methods, &$vars) {

  // Pad out the user parameters (like those passed through swf(), with our
  // configured defaults, allowing the user parameters to dominate.
  $saved_settings = _wijering4_flashvars($methods->player['name']);
  $saved = array();
  foreach ($saved_settings as $category => $settings) {
    $saved = array_merge($saved, $settings);
  }
  $flashvars = array_merge($saved, $vars->flashvars);
  if (isset($flashvars['image']) && !valid_url($flashvars['image'], TRUE)) {
    $flashvars['image'] = swftools_get_media_url(swftools_get_media_path() . $flashvars['image']);
  }
  if ($vars->params['width']) {
    $flashvars['width'] = $vars->params['width'];
  }
  if ($vars->params['height']) {
    $flashvars['height'] = $vars->params['height'];
  }

  // Return an array of flash variables
  return $flashvars;
}