You are here

function _styleswitcher_file_create_url in Style Switcher 6.2

Creates a web-accessible URL for a "shipped" file.

This function imitates D7's file_create_url() because D6's one does not work with files, which ship as part of modules or themes. Also this is needed to avoid breaking path in url() when clean urls are turned off.

Parameters

string $path: The path to a shipped file or an external URL.

Return value

string A string containing a URL that may be used to access the file. If the provided string is already an external path, nothing is done and the same string is returned.

2 calls to _styleswitcher_file_create_url()
styleswitcher_block_view in ./styleswitcher.module
Returns a renderable view of a block.
styleswitcher_css in ./styleswitcher.module
Page callback: Redirects to CSS file of currently active style.

File

./styleswitcher.module, line 781
Module's hooks implementations and helper functions.

Code

function _styleswitcher_file_create_url($path) {
  if (!menu_path_is_external($path)) {
    $path = $GLOBALS['base_url'] . '/' . drupal_urlencode($path);
  }
  return $path;
}