function swftools_get_player_path in SWF Tools 6.2
Same name and namespace in other branches
- 5 swftools.module \swftools_get_player_path()
- 6 swftools.module \swftools_get_player_path()
Returns a flash player path relative to webroot. The default path is in the modules/swftools/shared directory. It may suit some sites to store flash players in an alternative location, but the assumption is the location will be on the same server. If the path starts with '/', then we can assume is relative to the webroot. Otherwise we assume it's in the files directory.
Parameters
$dir: Optional parameter that gives the location of flash media players.
Return value
String with the path to the media players.
13 calls to swftools_get_player_path()
- flowplayer3_swftools_embed in flowplayer3/
flowplayer3.module - lutman_swftools_embed in lutman/
lutman.module - Implementation of swftools_embed hook Returns the markup for the page, plus set necessary javascript.
- swf in ./
swftools.module - Return output, which might be embed markup, or pre-flash markup that includes the appropriate jQuery added to the <head>
- swfobject2_available_locally in swfobject2/
swfobject2.module - Verify if the swfobject2.js library is available locally.
- swfobject2_swftools_embed in swfobject2/
swfobject2.module - Implementation of swftools_embed hook Returns the markup for the page, plus set necessary javascript.
File
- ./
swftools.module, line 728
Code
function swftools_get_player_path($dir = FALSE) {
// If a directory parameter wasn't set then return the configured value
if (!$dir) {
$dir = variable_get('swftools_player_path', SWFTOOLS_PLAYER_PATH);
// If the swftools_player_path variable isn't set return the default path
if (!$dir) {
$dir = drupal_get_path('module', 'swftools') . '/shared';
}
}
elseif (substr($dir, 0, 1) == '/') {
$dir = ltrim($dir, '/');
}
else {
$dir = file_create_path($dir);
}
// Return the resulting directory
return $dir;
}