You are here

function swftools_get_playlist_path in SWF Tools 6

Same name and namespace in other branches
  1. 5 swftools.module \swftools_get_playlist_path()
  2. 6.2 swftools.module \swftools_get_playlist_path()

Returns the playlist path relative to webroot. This path needs to be writeable, so it is fitting to limit valid locations to the files directory.

3 calls to swftools_get_playlist_path()
swftools_admin_embed_form in ./swftools.admin.inc
swftools_admin_handling_form in ./swftools.admin.inc
swftools_generate_playlist in ./swftools.module
Saves a playlist/xml file to a directory ready for the browser callback. Data must be formatted correctly, see docs (link to come) Returns a fully qualified url to the playlist file

File

./swftools.module, line 581

Code

function swftools_get_playlist_path($dir = FALSE) {

  // If no directory specified, get the default
  if (!$dir) {
    $dir = variable_get('swftools_playlist_path', SWFTOOLS_PLAYLIST_PATH);
  }

  // Ensure we have a path in the file system
  $dir = file_create_path($dir);

  // Create playlist directory if necessary
  if (!file_check_directory($dir, FILE_CREATE_DIRECTORY)) {
    drupal_set_message(t('%dir does not exist, or is not writeable.', array(
      '%dir' => $dir,
    )), 'error', FALSE);
  }

  // Return path to the playlist directory
  return $dir;
}