You are here

function swftools_methods_available in SWF Tools 6

Same name and namespace in other branches
  1. 5 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.

7 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_embed_form in ./swftools.admin.inc
swftools_admin_generic_form in ./genericplayers.module
Implementation of swftools_admin_hook_form. Return the system settings page for generic players
swftools_push_js in ./swftools.module
_swftools_admin_file_handling_option in ./swftools.admin.inc

... See full list

File

./swftools.module, line 464

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('Direct embedding - do not 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;
}