You are here

function imagecrop_match_requested_file_directory in Image javascript crop 6

Check if a the current requested file is located in the given directory.

1 call to imagecrop_match_requested_file_directory()
imagecrop_javascript_image in ./imagecrop_actions.inc
Action callback to perform the crop on an image

File

./imagecrop_actions.inc, line 278
Imagecache actions implementation.

Code

function imagecrop_match_requested_file_directory($filepath, $search_directory) {
  $files_directory = variable_get('file_directory_path', 'sites/default/files');
  $image_dir = str_replace($files_directory . '/', '', $filepath);
  $args = explode('/', $image_dir);
  unset($args[count($args) - 1]);
  $image_dir = implode('/', $args);
  return $image_dir == $search_directory;
}