function linkimagefield_file_update in Link Image Field 5
update the file record if necessary
Parameters
$node:
$file:
$field:
1 call to linkimagefield_file_update()
- linkimagefield_field in ./
linkimagefield.module - Implementation of hook_field().
File
- ./
linkimagefield.module, line 125 - 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_file_update($node, &$file, $field) {
$file = (array) $file;
if ($file['flags']['delete'] == TRUE) {
if (_linkimagefield_file_delete($file, $field['field_name'])) {
return array();
}
}
if ($file['fid'] == 'upload') {
return linkimagefield_file_insert($node, $file, $field);
}
else {
// if fid is not numeric here we should complain.
// else we update the file table.
}
return $file;
}