You are here

function theme_swftools_api in SWF Tools 6.3

Prepares the minimum definition to render Flash, and hands it to the selected embedding function.

Parameters

string $file: The file to be rendered.

array $options: An array of options (params, flashvars, othervars, methods).

Return value

string A markup string.

1 theme call to theme_swftools_api()
theme_swftools in includes/swftools.core.inc
Themes an swftools element by passing it on to the appropriate theme function.

File

api/swftools_api.module, line 133
A lightweight API to allow other modules to access SWF Tools embedding methods.

Code

function theme_swftools_api($file, $options = array()) {

  // Initialise any $options array elements that weren't passed by the caller
  swftools_initialise_options($options);

  // Initialise othervars with some defaults
  $options['othervars'] += array(
    'height' => '100%',
    'width' => '100%',
  );

  // Initialise a minimum version
  $options['params'] += array(
    'version' => '7',
  );

  // Set id - note - we do not check for uniqueness - that's up to the caller
  $options['othervars']['id'] = swftools_get_id($options['othervars']['id'], SWFTOOLS_DO_NOT_CLEAN_ID);

  // Get current embed method (theme) from swftools_embed_method
  $theme = variable_get('swftools_embed_method', 'swftools_direct');

  // Call theme to render
  return theme($theme, $file, $options);
}