diff --git a/flexpaper/swftools_flexpaper.module b/flexpaper/swftools_flexpaper.module index 0a67ad6..9a651da 100644 --- a/flexpaper/swftools_flexpaper.module +++ b/flexpaper/swftools_flexpaper.module @@ -49,7 +49,7 @@ function swftools_flexpaper_menu() { } -function swftools_flexpaper_swftools_flashvars($action, &$methods, &$vars) { +function swftools_flexpaper_swftools_flashvars($action, $methods, &$vars) { $flashvars = _swftools_flexpaper_settings(); $flashvars += array( 'SwfFile' => urlencode($vars->othervars['file_url']), diff --git a/flowplayer3/flowplayer3.module b/flowplayer3/flowplayer3.module index 426f720..4ba5a99 100644 --- a/flowplayer3/flowplayer3.module +++ b/flowplayer3/flowplayer3.module @@ -101,7 +101,7 @@ function flowplayer3_menu() { * @return * Return an array of flashvars needed to allow the player to work. */ -function flowplayer3_swftools_flashvars($action, &$methods, &$vars) { +function flowplayer3_swftools_flashvars($action, $methods, &$vars) { // Initialise array of FlowPlayer3 configuration settings $flowplayer = array(); diff --git a/genericplayers.module b/genericplayers.module index d061122..9de90b6 100644 --- a/genericplayers.module +++ b/genericplayers.module @@ -105,7 +105,7 @@ function swftools_admin_generic_form() { * Implementation of swftools_flashvars hook. * */ -function genericplayers_swftools_flashvars($action, &$methods, &$vars) { +function genericplayers_swftools_flashvars($action, $methods, &$vars) { // All we need to do is assign the 'file_url' variable to our preferred place on the flashvars array. if ($vars->othervars['file_url']) { $vars->flashvars['file_url'] = $vars->othervars['file_url']; diff --git a/imagerotator/imagerotator.module b/imagerotator/imagerotator.module index c2e383f..c092455 100644 --- a/imagerotator/imagerotator.module +++ b/imagerotator/imagerotator.module @@ -116,7 +116,7 @@ function _imagerotator_settings($player) { * Implementation of swftools_flashvars hook. * Return an array of flashvars. */ -function imagerotator_swftools_flashvars($action, &$methods, &$vars) { +function imagerotator_swftools_flashvars($action, $methods, &$vars) { // Pad out the user parameters (like those passed through swf(), with our // configured defaults, allowing the user parameters to dominate. diff --git a/onepixelout/onepixelout.module b/onepixelout/onepixelout.module index 974b1a8..ee0c902 100644 --- a/onepixelout/onepixelout.module +++ b/onepixelout/onepixelout.module @@ -92,7 +92,7 @@ function _onepixelout_settings() { * Implementation of swftools_flashvars hook. * Return an array of flashvars. */ -function onepixelout_swftools_flashvars($action, &$methods, &$vars) { +function onepixelout_swftools_flashvars($action, $methods, &$vars) { // Generate sequential player ids static $player_id = 1; diff --git a/simpleviewer/simpleviewer.module b/simpleviewer/simpleviewer.module index c3f99ad..081df57 100644 --- a/simpleviewer/simpleviewer.module +++ b/simpleviewer/simpleviewer.module @@ -66,7 +66,7 @@ function simpleviewer_menu() { * Other arrays can also be modified. * */ -function simpleviewer_swftools_flashvars($action, &$methods, &$vars) { +function simpleviewer_swftools_flashvars($action, $methods, &$vars) { $sv_vars = _simpleviewer_vars(); // Here we only assign 'other' settings to othervars, and return 'swf' settings diff --git a/swftools.module b/swftools.module index 54e09ed..5319c11 100644 --- a/swftools.module +++ b/swftools.module @@ -498,7 +498,7 @@ function swf($file, $options = array()) { if (module_hook($resolved_methods->player['module'], 'swftools_flashvars')) { // Get player flashvars - $player_flashvars = module_invoke($resolved_methods->player['module'], 'swftools_flashvars', $action, $resolved_methods, $vars); + $player_flashvars = swftool_module_invoke_swftools_flashvars($resolved_methods->player['module'], $action, $resolved_methods, $vars); // Merge player flashvars with existing flashvars if (is_array($player_flashvars)) { @@ -523,13 +523,34 @@ function swf($file, $options = array()) { $vars->params['flashvars'] = _swftools_get_flashvars_string($vars->flashvars); // Call the embedding code to get the HTML and set the JavaScript if necessary. - $embed_markup = module_invoke($resolved_methods->embed['module'], 'swftools_embed', $action, $resolved_methods, $vars, $html_alt); + $embed_markup = swftool_module_invoke_swftools_embed($resolved_methods->embed['module'], $action, $resolved_methods, $vars, $html_alt); // Call theme function to return completed markup, e.g. add containing div return theme('swftools_embed', $embed_markup, $action, $resolved_methods, $vars, $html_alt); } +function swftool_module_invoke_swftools_flashvars($module, &$action, &$methods, &$vars) { + $hook = 'swftools_flashvars'; + $function = $module .'_'. $hook; + if (module_hook($module, $hook)) { + return $function($action, $methods, $vars); + } +} +function swftool_module_invoke_swftools_embed($module, &$action, &$methods, &$vars, &$html_alt) { + $hook = 'swftools_embed'; + $function = $module .'_'. $hook; + if (module_hook($module, $hook)) { + return $function($action, $methods, $vars,$html_alt); + } +} + +function swftool_module_invoke_swftools_playlist($module, $hook, &$playlist_data, &$method, &$vars) { + $function = $module .'_'. $hook; + if (module_hook($module, $hook)) { + return $function($playlist_data, $method, $vars); + } +} /** * Produce finished markup ready for inserting on the page * @@ -951,7 +972,7 @@ function swftools_generate_playlist(&$playlist_data, $playlist_name, &$method, & // Check that the module implements this hook before trying to call it if (module_hook($method->player['module'], $hook)) { - $playlist = module_invoke($method->player['module'], $hook, $playlist_data, $method, $vars); + $playlist = swftool_module_invoke_swftools_playlist($method->player['module'], $hook, $playlist_data, $method, $vars); } // If the hook doesn't exist then the player doesn't support playlists @@ -1001,7 +1022,7 @@ function swftools_push_js($embed = SWFDEFAULT) { // Call the module responsible to output the js. Don't pass any additional // parameters - as we don't want the module to try and return the in-body // html placeholder for the flash content. - $output = module_invoke($all_methods[SWFTOOLS_EMBED_METHOD][$embed]['module'], 'swftools_embed'); + $output = swftool_module_invoke_swftools_embed($all_methods[SWFTOOLS_EMBED_METHOD][$embed]['module'], null, null,null, null); } /** diff --git a/wijering/wijering.module b/wijering/wijering.module index d74e80c..b8796fa 100644 --- a/wijering/wijering.module +++ b/wijering/wijering.module @@ -140,7 +140,7 @@ function _wijering_settings($player) { * Implementation of swftools_flashvars hook. * Return an array of flashvars. */ -function wijering_swftools_flashvars($action, &$methods, &$vars) { +function wijering_swftools_flashvars($action, $methods, &$vars) { // Pad out the user parameters (like those passed through swf(), with our // configured defaults, allowing the user parameters to dominate. diff --git a/wijering4/wijering4.module b/wijering4/wijering4.module index 5376628..acc8c86 100644 --- a/wijering4/wijering4.module +++ b/wijering4/wijering4.module @@ -159,7 +159,7 @@ function _wijering4_settings($player) { * Implementation of swftools_flashvars hook. * Return an array of flashvars. */ -function wijering4_swftools_flashvars($action, &$methods, &$vars) { +function wijering4_swftools_flashvars($action, $methods, &$vars) { // Pad out the user parameters (like those passed through swf(), with our // configured defaults, allowing the user parameters to dominate.