You are here

function _emthumb_file_update in Embedded Media Field 6.2

Same name and namespace in other branches
  1. 6.3 contrib/emthumb/emthumb.module \_emthumb_file_update()
  2. 6 contrib/emthumb/emthumb.module \_emthumb_file_update()

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
Implements hook_emfield_field_extra(). This is called on field operations to allow us to act on emthumbs.

File

contrib/emthumb/emthumb.module, line 551
Allows for custom thumbnail overrides to Embedded Media Field.

Code

function _emthumb_file_update($node, &$file, $field, $delete = FALSE) {
  $file = (array) $file;
  if ($delete) {
    _emthumb_file_delete($file, $field['field_name']);
    $file = array();
    return array();
  }
  if (!$file['status']) {
    _emthumb_file_insert($node, $file, $field);
    return $file;
  }
  else {

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