You are here

function image_url_formatter_convert_full_url in Image URL Formatter 7

Converts a full URL to the choosen format.

Parameters

string $url: The full URL to convet.

constant $format: IMAGE_URL_FORMATTER_FILENAME for filename only, IMAGE_URL_FORMATTER_RELATIVE_PATH for relative path, IMAGE_URL_FORMATTER_ABSOLUTE_PATH for absolute path, IMAGE_URL_FORMATTER_FULL_URL for full URL.

Return value

string The converted URL.

1 call to image_url_formatter_convert_full_url()
theme_image_url_formatter in ./image_url_formatter.module
Returns HTML for an image url field formatter.

File

./image_url_formatter.module, line 251
Add an URL formatter for image field

Code

function image_url_formatter_convert_full_url($url, $format = IMAGE_URL_FORMATTER_FULL_URL) {
  switch ($format) {
    case IMAGE_URL_FORMATTER_FILENAME:
      $url = _image_url_formater_get_filename($url);
      break;
    case IMAGE_URL_FORMATTER_RELATIVE_PATH:
      $url = _image_url_formatter_get_relative_file_url($url);
      break;
    case IMAGE_URL_FORMATTER_ABSOLUTE_PATH:
      $url = _image_url_formatter_get_absolute_file_url($url);
      break;
  }
  return $url;
}