You are here

function file_entity_multiple_delete_form_submit in File Entity (fieldable files) 7.2

Same name and namespace in other branches
  1. 7.3 file_entity.pages.inc \file_entity_multiple_delete_form_submit()

Form submission handler for file_entity_multiple_delete_form().

File

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

Code

function file_entity_multiple_delete_form_submit($form, &$form_state) {
  if ($form_state['values']['confirm'] && ($fids = array_keys($form_state['values']['files']))) {
    file_delete_multiple($fids);
    $count = count($fids);
    watchdog('file', 'Deleted @count files.', array(
      '@count' => $count,
    ));
    drupal_set_message(format_plural($count, 'Deleted one file.', 'Deleted @count files.'));
  }
  $form_state['redirect'] = 'admin/content/file';

  // Clear the page and block caches.
  cache_clear_all();
}