You are here

function swftools_get_action in SWF Tools 6.3

Same name and namespace in other branches
  1. 5 swftools.module \swftools_get_action()
  2. 6 swftools.module \swftools_get_action()
  3. 6.2 swftools.module \swftools_get_action()

Determines the action to be taken, based on the extension of a filename.

Parameters

string $extension: The file being queried.

Return value

string An SWF Tools action if one is associated with the extension, or 'media_list' if we don't know.

2 calls to swftools_get_action()
swf in ./swftools.module
Processes a file, or an array of files, and returns the relevant mark-up to render a Flash based player.
swftools_prepare_playlist in ./swftools.module
Prepares an array of filenames, or file objects, for use in a playlist.

File

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

Code

function swftools_get_action($file) {

  // Get the array of actions, keyed on extension
  $actions = _swftools_actions();

  // Get the extension for this file
  $extension = strtolower(pathinfo($file, PATHINFO_EXTENSION));

  // If we know the handler for this then use it, otherwise return 'media_list'
  return isset($actions[$extension]) ? $actions[$extension] : 'media_list';
}