You are here

function wijering_swftools_flashvars in SWF Tools 5

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

Implementation of swftools_flashvars hook. Return an array of flashvars.

File

wijering/wijering.module, line 186

Code

function wijering_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 = _wijering_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;
}