You are here

function swftools_get_base in SWF Tools 6.3

Returns a string defining a base path for flash to use.

1 call to swftools_get_base()
swf in ./swftools.module
Processes a file, or an array of files, and returns the relevant mark-up to render a Flash based player.

File

./swftools.module, line 1588
The primary component of SWF Tools that enables comprehensive media handling.

Code

function swftools_get_base() {

  // Cache the result as we might get multiple calls
  static $base = '';

  // If $base is not already defined then set it
  if (!$base) {

    // Retrieve swftools_media_url to see if a remote path has been set
    $base = trim(variable_get('swftools_media_url', ''));

    // If $base is still empty then use local path to file directory
    if (!$base) {
      $base = base_path() . file_directory_path() . '/';
    }
  }

  // Return the base path
  return $base;
}