You are here

function media_file_browser_media_register in D7 Media 6

Implementation of hook_media_register

Return value

array

File

media_file_browser/media_file_browser.module, line 32

Code

function media_file_browser_media_register() {
  $registration = array();
  $registration['media_file_browser_directory'] = array(
    // human readable name
    'name' => 'File Browser Local',
    'description' => 'Provides access to local files',
    'uri' => 'file',
    'kind' => 'resource',
    'callbacks' => array(
      'resource' => 'media_file_browser_local_files',
    ),
    'fields' => array(
      'attachments',
      'filefield',
    ),
  );
  if (module_exists('s3_api')) {
    $registration['media_file_browser_s3'] = array(
      'name' => 'File Browser S3',
      'uri' => 'file',
      'kind' => 'resource',
      'description' => 'Provides access to files stored on Amazon\'s S3',
      'callbacks' => array(
        'resource' => 'media_file_browser_s3_files',
      ),
      'fields' => array(
        'attachments',
        'filefield',
      ),
    );
  }
  if (module_exists('ftp_api')) {
    $registration['media_file_browser_ftp'] = array(
      // human readable name
      'name' => 'File Browser FTP',
      'description' => 'Provides access to files stored on the FTP server',
      'uri' => 'file',
      'kind' => 'resource',
      'callbacks' => array(
        'resource' => 'media_file_browser_ftp_files',
      ),
      'fields' => array(
        'attachments',
        'filefield',
      ),
    );
  }
  return $registration;
}