You are here

function imagepicker_get_files_directory in Image Picker 7

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_get_files_directory()
  2. 6.2 imagepicker.module \imagepicker_get_files_directory()
6 calls to imagepicker_get_files_directory()
imagepicker_admin_orphans_do in ./imagepicker.admin.inc
imagepicker_admin_orphans_form in ./imagepicker.admin.inc
imagepicker_file_download in ./imagepicker.module
Implements hook_file_download().
imagepicker_get_path in ./imagepicker.module
imagepicker_install in ./imagepicker.install
Implements hook_install().

... See full list

File

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

Code

function imagepicker_get_files_directory($system_only = FALSE) {
  $file_default_scheme = file_default_scheme();
  $drupal_path = file_stream_wrapper_get_instance_by_scheme($file_default_scheme)
    ->getDirectoryPath();
  if ($file_default_scheme == 'private') {
    $drupaldir = $drupal_path;
  }
  else {
    $drupaldir = str_replace('/', DIRECTORY_SEPARATOR, getcwd()) . DIRECTORY_SEPARATOR . $drupal_path;
  }
  if ($system_only) {
    return $drupaldir;
  }
  $dir = $drupaldir . DIRECTORY_SEPARATOR . IMAGEPICKER_FILES_DIR;
  return $dir;
}