function _auditfiles_used_not_referenced_batch_delete_create_batch in Audit Files 7.3
Same name and namespace in other branches
- 7.4 auditfiles.usednotreferenced.inc \_auditfiles_used_not_referenced_batch_delete_create_batch()
Creates the batch for deleting files from the file_usage table.
Parameters
array $fileids: The list of file IDs to be processed.
Return value
array The definition of the batch.
1 call to _auditfiles_used_not_referenced_batch_delete_create_batch()
- auditfiles_used_not_referenced_form_submit in ./
auditfiles.usednotreferenced.inc - Submit handler for the auditfiles_used_not_referenced_form form.
File
- ./
auditfiles.usednotreferenced.inc, line 482 - Generates report showing files in file_usage, but not referenced by content.
Code
function _auditfiles_used_not_referenced_batch_delete_create_batch(array $fileids) {
$batch = _auditfiles_used_not_referenced_batch_set_common_values();
$batch['title'] = t('Deleting files from the file_usage table');
$operations = array();
// Remove all the empty values from the array.
$file_ids = array();
foreach ($fileids as $file_id) {
if ($file_id != 0) {
$file_ids[] = $file_id;
}
}
// Fill in the $operations variable.
foreach ($file_ids as $file_id) {
$operations[] = array(
'_auditfiles_used_not_referenced_batch_delete_process_batch',
array(
$file_id,
),
);
}
$batch['operations'] = $operations;
return $batch;
}