You are here

function file_entity_delete_form in File Entity (fieldable files) 7.3

Same name and namespace in other branches
  1. 7.2 file_entity.pages.inc \file_entity_delete_form()

Page callback: Form constructor for the file deletion confirmation form.

Path: file/%file/delete

Parameters

object $file: A file object from file_load().

See also

file_entity_menu()

2 string references to 'file_entity_delete_form'
file_entity_menu in ./file_entity.module
Implements hook_menu().
file_entity_page_delete in ./file_entity.pages.inc
Page callback for the file deletion confirmation form.

File

./file_entity.pages.inc, line 1107
Supports file operations including View, Edit, and Delete.

Code

function file_entity_delete_form($form, &$form_state, $file) {
  $form_state['file'] = $file;
  $form['fid'] = array(
    '#type' => 'value',
    '#value' => $file->fid,
  );
  $description = t('This action cannot be undone.');
  if ($references = file_usage_list($file)) {
    $description .= ' ' . t('This file is currently in use and may cause problems if deleted.');
  }
  return confirm_form($form, t('Are you sure you want to delete the file %title?', array(
    '%title' => entity_label('file', $file),
  )), 'file/' . $file->fid, $description, t('Delete'));
}