You are here

function imagefield_crop_clear_field_session in Imagefield Crop 5

2 calls to imagefield_crop_clear_field_session()
imagefield_crop_clear_session in ./imagefield_crop.module
_imagefield_crop_widget_prepare_form_values in ./imagefield_crop.module

File

./imagefield_crop.module, line 334

Code

function imagefield_crop_clear_field_session($fieldname) {
  if (is_array($_SESSION['imagefield'][$fieldname]) && count($_SESSION['imagefield'][$fieldname])) {
    foreach ($_SESSION['imagefield'][$fieldname] as $files) {
      file_delete($file['filepath']);
      file_delete($file['crop']['filepath']);
      file_delete($file['filepath'] . '.unscaled');
    }
    unset($_SESSION['imagefield'][$fieldname]);
  }
}