You are here

function imagepicker_get_path in Image Picker 7

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_get_path()
  2. 5 imagepicker.module \imagepicker_get_path()
  3. 6.2 imagepicker.module \imagepicker_get_path()

Parameters

boolean $url:

mixed $userdir:

boolean $scheme:

Return value

string

14 calls to imagepicker_get_path()
imagepicker_adminview in ./imagepicker.admin.inc
imagepicker_copy_form_submit in ./imagepicker.functions.inc
Function to submit the copy form
imagepicker_delete_olduser_dirs in ./imagepicker.admin.inc
imagepicker_get_image_path in ./imagepicker.module
imagepicker_get_watermarks_dir in ./imagepicker.functions.inc

... See full list

File

./imagepicker.module, line 981
@author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function imagepicker_get_path($url = FALSE, $userdir = FALSE, $scheme = FALSE) {
  global $base_url;
  $dirsep = !$url ? DIRECTORY_SEPARATOR : '/';
  if (!$url && !$scheme) {
    $path = imagepicker_get_files_directory() . $dirsep;
  }
  else {
    if (imagepicker_variable_get('imagepicker_use_full_url', 0)) {
      $path = $base_url;
    }
    else {
      $path = base_path();
      $path = preg_replace("/\\/\$/", "", $path);
    }
    if ($scheme) {
      $path = IMAGEPICKER_FILES_DIR . $dirsep;
    }
    else {
      $path .= $dirsep . file_stream_wrapper_get_instance_by_scheme(file_default_scheme())
        ->getDirectoryPath() . $dirsep . IMAGEPICKER_FILES_DIR . $dirsep;
    }
  }
  if ($userdir) {
    $path .= imagepicker_get_userpath($userdir, $dirsep);
  }
  return $path;
}