You are here

function swftools_fix_old_action_names in SWF Tools 6.3

Changes old action names to the new ones so existing content doesn't break.

Parameters

string $name: The currently assigned action name.

Return value

string The corrected action name (which will be unchanged if it is already ok).

1 call to swftools_fix_old_action_names()
swf in ./swftools.module
Processes a file, or an array of files, and returns the relevant mark-up to render a Flash based player.

File

./swftools.module, line 2128
The primary component of SWF Tools that enables comprehensive media handling.

Code

function swftools_fix_old_action_names($name) {

  // This is the array to map old names to new names
  $map = array(
    'swftools_swf_display_direct' => 'swf',
    'swftools_flv_display' => 'video',
    'swftools_flv_display_list' => 'video_list',
    'swftools_mp3_display' => 'audio',
    'swftools_mp3_display_list' => 'audio_list',
    'swftools_image_display' => 'image',
    'swftools_image_display_list' => 'image_list',
    'swftools_media_display_list' => 'media_list',
  );

  // Attach the supplied action name as both key and value
  $map += array(
    $name => $name,
  );

  // Return the mapped result
  return $map[$name];
}