You are here

function emthumb_file_update in Embedded Media Field 5

update the file record if necessary

Parameters

$node:

$file:

$field:

1 call to emthumb_file_update()
emthumb_emfield_field_extra in contrib/emthumb/emthumb.module

File

contrib/emthumb/emthumb.module, line 83

Code

function emthumb_file_update($node, &$file, $field) {
  $file = (array) $file;
  if ($file['flags']['delete'] == TRUE) {
    if (_emthumb_file_delete($file, $field['field_name'])) {
      return array();
    }
  }
  if ($file['fid'] == 'upload') {
    return emthumb_file_insert($node, $file, $field);
  }
  else {

    // if fid is not numeric here we should complain.
    // else we update the file table.
  }
  return $file;
}