You are here

function extended_file_field_delete_contents in Extended File Field 7

Related topics

1 call to extended_file_field_delete_contents()
extended_file_field_delete_contents_confirm_submit in ./extended_file_field.module

File

./extended_file_field.module, line 132
Extends the core File field widget and provides a new formatter.

Code

function extended_file_field_delete_contents($file) {
  $content = t("File content deleted on !date by user: !name\n", array(
    '!date' => gmdate('c'),
    '!name' => $GLOBALS['user']->name,
  ));
  file_put_contents($file->uri, $content);
  file_save($file);
}