You are here

function file_entity_field_formatter_info in File Entity (fieldable files) 7.2

Same name and namespace in other branches
  1. 7.3 file_entity.field.inc \file_entity_field_formatter_info()
  2. 7 file_entity.field.inc \file_entity_field_formatter_info()

Implements hook_field_formatter_info().

File

./file_entity.field.inc, line 11
Field API integration for the file_entity module.

Code

function file_entity_field_formatter_info() {
  $info['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,
    ),
  );
  $info['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]'),
    ),
  );
  $info['file_audio'] = array(
    'label' => t('Audio'),
    'description' => t('Render the file using an HTML5 audio tag.'),
    'field types' => array(
      'file',
    ),
    'settings' => array(
      'controls' => TRUE,
      'controls_list' => array(
        'download' => 'download',
        'remote_playback' => 'remote_playback',
      ),
      'autoplay' => FALSE,
      'loop' => FALSE,
      'preload' => '',
      'multiple_file_behavior' => 'tags',
    ),
    'file formatter' => array(
      'mime types' => array(
        'audio/*',
      ),
    ),
  );
  $info['file_video'] = array(
    'label' => t('Video'),
    'description' => t('Render the file using an HTML5 video tag.'),
    'field types' => array(
      'file',
    ),
    'settings' => array(
      'controls' => TRUE,
      'controls_list' => array(
        'fullscreen' => 'fullscreen',
        'download' => 'download',
        'remote_playback' => 'remote_playback',
      ),
      'autoplay' => FALSE,
      'playsinline' => FALSE,
      'loop' => FALSE,
      'muted' => FALSE,
      'width' => NULL,
      'height' => NULL,
      'preload' => '',
      'multiple_file_behavior' => 'tags',
    ),
    'file formatter' => array(
      'mime types' => array(
        'video/*',
      ),
    ),
  );
  return $info;
}