function file_field_formatter_view file_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) Implements hook_field_formatter_view(). File
 modules/file/file.field.inc, line 978 Field module functionality for the File module.  Code function file_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();

  switch ($display['type']) {
    case 'file_default':
      foreach ($items as $delta => $item) {
        $element[$delta] = array(
          '#theme' => 'file_link',
          '#file' => (object) $item,
        );
      }
      break;

    case 'file_url_plain':
      foreach ($items as $delta => $item) {
        $element[$delta] = array('#markup' => empty($item['uri']) ? '' : file_create_url($item['uri']));
      }
      break;

    case 'file_table':
      if (!empty($items)) {
        // Display all values in a single element..
        $element[0] = array(
          '#theme' => 'file_formatter_table',
          '#items' => $items,
        );
      }
      break;
  }

  return $element;
}


    
{'path': 'public/docs/drupal~7/modules-file-file.field.inc/function/file_field_formatter_view/7.x.html', 'source': 'DevDocs.IO'}