'swfobject_replace', 'module' => 'swfobject', 'shared_file' => 'swfobject/swfobject.js', 'title' => t('SWFObject 1.5 - JavaScript'), 'download' => 'http://blog.deconcept.com/swfobject/#download', ); return $methods; } /** * Implementation of swftools_embed hook * Returns the markup for the page, plus set necessary javascript. * * $methods and $vars should never be empty - unless the only reason for this call * is to push the javascript into the header of the page in which case you don't * add any paramters as all. This is useful for filtered nodes where the body is * not regenerated every time. */ function swfobject_swftools_embed($action = 'add_js', $methods = FALSE, $vars = FALSE, $html_alt = '') { static $swfobject_has_run; static $swfobject_id = 0; // Output javascript to the header if (!$swfobject_has_run) { // Add swfobject.js drupal_add_js(swftools_get_player_path() .'/swfobject/swfobject.js'); drupal_add_js(_swfobject_header_js(), 'inline', 'header'); $swfobject_has_run = TRUE; if ($action == 'add_js') { // Exit early having put the javascript in the header. return; } } static $unique_id = 0; $unique_id++; // SWFObject needs an id so that the replacement script can take it as a parameter. // Use time() to prevent caching issues. $html = '