You are here

function swftools_methods_available in SWF Tools 5

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

Collect information from all modules about the Flash players, tools and scripts available for various actions.

6 calls to swftools_methods_available()
swf in ./swftools.module
Return output, which might be embed markup, or pre-flash markup that includes the appropriate jQuery added to the <head>
swftools_admin_generic_form in ./genericplayers.module
Implementation of swftools_admin_hook_form. Return the system settings page.
swftools_get_player in ./swftools.module
Identify the best flash player based on the chosen action. In a couple of cases we have a built-in default, but FALSE indicates that no default player is configured.
swftools_push_js in ./swftools.module
_swftools_admin_embed_form in ./swftools.admin.inc

... See full list

File

./swftools.module, line 482

Code

function swftools_methods_available($action = NULL, $reset = FALSE) {

  // Cache methods array.
  static $methods = array();
  if ($reset) {
    $methods = array();
  }
  elseif (count($methods)) {
    return $action ? $methods[$action] : $methods;
  }

  // Gather methods.
  foreach (module_implements('swftools_methods') as $mod) {
    $methods = array_merge_recursive($methods, call_user_func($mod . '_swftools_methods'));
  }
  $methods = array_merge_recursive($methods, genericplayers_swftools_methods());

  // This module implements a default plain HTML embedding method called 'direct'
  $methods[SWFTOOLS_EMBED_METHOD][SWFTOOLS_NOJAVASCRIPT] = array(
    'name' => SWFTOOLS_NOJAVASCRIPT,
    'module' => 'swftools',
    'shared_file' => '',
    'title' => t('Embed Flash Directly, don\'t use JavaScript replacement.'),
  );

  // This module implements swf embedding
  $methods[SWFTOOLS_SWF_DISPLAY_DIRECT][SWFTOOLS_SWF] = array(
    'name' => SWFTOOLS_SWF,
    'module' => 'swftools',
    'shared_file' => '',
    'title' => t('Use SWF file directly, no streaming through another SWF.'),
  );
  $methods[SWFTOOLS_SWF_DISPLAY_DIRECT][SWFTOOLS_CUSTOM] = array(
    'name' => SWFTOOLS_CUSTOM,
    'module' => 'swftools',
    'shared_file' => '',
    // Assigned later.
    'title' => t('Use custom SWF file.'),
  );
  return $action ? $methods[$action] : $methods;
}