You are here

function hook_file_operations in File Entity (fieldable files) 7.3

Same name and namespace in other branches
  1. 7.2 file_entity.api.php \hook_file_operations()

Add mass file operations.

This hook enables modules to inject custom operations into the mass operations dropdown found at admin/content/file, by associating a callback function with the operation, which is called when the form is submitted. The callback function receives one initial argument, which is an array of the checked files.

Return value

array An array of operations. Each operation is an associative array that may contain the following key-value pairs:

  • 'label': Required. The label for the operation, displayed in the dropdown menu.
  • 'callback': Required. The function to call for the operation.
  • 'callback arguments': Optional. An array of additional arguments to pass to the callback function.
2 functions implement hook_file_operations()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

file_entity_file_operations in ./file_entity.module
Implements hook_file_operations().
pathauto_file_operations in ./file_entity.module
Implements hook_file_operations() on behalf of pathauto.module.
2 invocations of hook_file_operations()
file_entity_admin_files in ./file_entity.admin.inc
Form builder: Builds the file administration overview.
file_entity_admin_files_submit in ./file_entity.admin.inc
Process file_entity_admin_files form submissions.

File

./file_entity.api.php, line 141
Hooks provided by the File Entity module.

Code

function hook_file_operations() {
  $operations = array(
    'delete' => array(
      'label' => t('Delete selected files'),
      'callback' => NULL,
    ),
  );
  return $operations;
}