You are here

function file_admin_file_operations in File admin 7

Implement hook_file_operations().

File

./file_admin.module, line 352
Enhances file administration by adding published, promote, and sticky fields.

Code

function file_admin_file_operations() {
  $operations = array(
    'publish' => array(
      'label' => t('Publish'),
      'callback' => 'file_admin_mass_update',
      'callback arguments' => array(
        'updates' => array(
          'published' => FILE_PUBLISHED,
        ),
      ),
    ),
    'unpublish' => array(
      'label' => t('Unpublish'),
      'callback' => 'file_admin_mass_update',
      'callback arguments' => array(
        'updates' => array(
          'published' => FILE_NOT_PUBLISHED,
        ),
      ),
    ),
    'promote' => array(
      'label' => t('Promote selected files'),
      'callback' => 'file_admin_mass_update',
      'callback arguments' => array(
        'updates' => array(
          'published' => FILE_PUBLISHED,
          'promote' => FILE_PROMOTED,
        ),
      ),
    ),
    'demote' => array(
      'label' => t('Demote selected files'),
      'callback' => 'file_admin_mass_update',
      'callback arguments' => array(
        'updates' => array(
          'promote' => FILE_NOT_PROMOTED,
        ),
      ),
    ),
  );
  return $operations;
}