'lutman_replace', 'module' => 'lutman', 'shared_file' => 'lutman/jquery.flash.js', 'title' => t('jQuery Flash plugin - JavaScript'), 'download' => 'http://jquery.lukelutman.com/plugins/flash/', ); return $methods; } /** * Implementation of swftools_embed hook * Returns the markup for the page, plus set necessary javascript. */ function lutman_swftools_embed($action = 'add_js', $methods = FALSE, $vars = FALSE, $html_alt = '') { static $lutman_has_run; // Output javascript to the header if (!$lutman_has_run) { // Add jquery.flash.js drupal_add_js(swftools_get_player_path() .'/lutman/jquery.flash.js'); drupal_add_js(_lutman_header_js(), 'inline', 'header'); $lutman_has_run = TRUE; if ($action == 'add_js') { // Exit early having put the javascript in the header. return; } } // Initialise a counter to give each div a unique id static $unique_id = 0; $unique_id++; // Construct a unique id for each div by using time() combined with $unique_id // This is necessary to prevent clashes between cached content $id = time() . $unique_id; // Use time() to prevent caching issues. $html = '