1.20.x file.field.inc file_field_formatter_info()

Implements hook_field_formatter_info().

File

modules/file/file.field.inc, line 345
Field module functionality for the File module.

Code

function file_field_formatter_info() {
  return array(
    'file_default' => array(
      'label' => t('Generic file'),
      'field types' => array('file'),
      'description' => t('Create a simple link to the file. The link is prefixed by a file type icon and the name of the file is used as the link text'),
    ),
    'file_table' => array(
      'label' => t('Table of files'),
      'field types' => array('file'),
      'description' => t('Build a two-column table where the first column contains a generic link to the file and the second column displays the size of the file.'),
    ),
    'file_url_plain' => array(
      'label' => t('URL to file'),
      'field types' => array('file'),
      'description' => t('Display a plain text URL to the file.'),
    ),
    'file_rendered' => array(
      'label' => t('Rendered file'),
      'description' => t('Display the file in a specific view mode'),
      'field types' => array('file', 'image'),
      'settings' => array(
        'file_view_mode' => 'default',
      ),
      'file formatter' => array(
        'hidden' => TRUE,
      ),
    ),
    'file_download_link' => array(
      'label' => t('Download link'),
      'description' => t('Displays a link that will force the browser to download the file.'),
      'field types' => array('file', 'image'),
      'settings' => array(
        'text' => t('Download [file:name]'),
      ),
    ),
    'file_audio' => array(
      'label' => t('Audio'),
      'description' => t('Render the file using an HTML5 audio tag.'),
      'field types' => array('file'),
      'settings' => array(
        'controls' => TRUE,
        'autoplay' => FALSE,
        'loop' => FALSE,
        'preload' => '',
        'multiple_file_behavior' => 'tags',
      ),
      'file formatter' => array(
        'mime types' => array('audio/*'),
      ),
    ),
    'file_video' => array(
      'label' => t('Video'),
      'description' => t('Render the file using an HTML5 video tag.'),
      'field types' => array('file'),
      'settings' => array(
        'controls' => TRUE,
        'autoplay' => FALSE,
        'loop' => FALSE,
        'muted' => FALSE,
        'width' => NULL,
        'height' => NULL,
        'preload' => '',
        'multiple_file_behavior' => 'tags',
      ),
      'file formatter' => array(
        'mime types' => array('video/*'),
      ),
    ),
  );
}