You are here

function linkimagefield_clear_field_session in Link Image Field 5

3 calls to linkimagefield_clear_field_session()
linkimagefield_clear_session in ./linkimagefield.module
linkimagefield_field in ./linkimagefield.module
Implementation of hook_field().
_linkimagefield_widget_prepare_form_values in ./linkimagefield.module

File

./linkimagefield.module, line 341
Defines an link image field type. linkimagefield uses content.module to store the fid, and the drupal files table to store the actual file data.

Code

function linkimagefield_clear_field_session($fieldname) {
  if (is_array($_SESSION['linkimagefield'][$fieldname]) && count($_SESSION['linkimagefield'][$fieldname])) {
    foreach ($_SESSION['linkimagefield'][$fieldname] as $delta => $file) {
      if (is_file($file['filepath'])) {
        file_delete($file['filepath']);
      }
    }
    unset($_SESSION['linkimagefield'][$fieldname]);
  }
}