You are here

function fancy_file_delete_files in Fancy File Delete 7

Same name and namespace in other branches
  1. 8 fancy_file_delete.module \fancy_file_delete_files()

Normal File Delete Action for hook_action_info.

File

./fancy_file_delete.module, line 123

Code

function fancy_file_delete_files(&$entity, $context) {
  module_load_include('inc', 'fancy_file_delete', 'includes/fancy_file_delete.admin');

  // Set entities to batch our way.
  $operations = array();
  foreach ($entity as $key => $value) {
    if ($key === 'fid' || $key === 'path') {
      $operations[] = array(
        'fancy_file_delete_batch_delete',
        array(
          $value,
          FALSE,
        ),
      );
    }
  }

  // Send to batch.
  _fancy_file_delete_batch_delete_run($operations);
}