You are here

function gdoc_field_field_formatter_info_alter in Embedded Google Docs Viewer 7

Implements hook_field_formatter_info_alter().

Add a new formatter to the list of formatters available for the File field type.

File

./gdoc_field.module, line 53
A field formatter for the File field, which renders the file as an embedded document, using Google's Google Docs embeddable file viewer. At the current time this viewer will reasonably display files of these types: Adobe .pdf, Microsoft…

Code

function gdoc_field_field_formatter_info_alter(&$info) {
  $new_formatter = array(
    'label' => t('Embedded Google Docs viewer'),
    'field types' => array(
      0 => 'file',
    ),
    'settings' => array(),
    'module' => 'gdoc_field',
  );
  $info['gdoc_field_embedded_doc'] = $new_formatter;
}