You are here

function party_hat_field_formatter_view in Party 8.2

Same name and namespace in other branches
  1. 7 modules/party_hat/party_hat.module \party_hat_field_formatter_view()

Implements hook_field_formatter_view().

File

modules/party_hat/party_hat.module, line 643
party_hat.module Provides an extensible access system for parties.

Code

function party_hat_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();
  switch ($display['type']) {
    case 'hat_reference_default':
      foreach ($items as $delta => $item) {
        $hat = party_hat_load($item['hat_name']);
        $element[$delta]['#markup'] = $hat->label;
      }
      break;
  }
  return $element;
}