You are here

function telephone_field_formatter_prepare_view in Telephone 7

Implements hook_field_formatter_prepare_view().

File

./telephone.module, line 148
Defines a simple telephone number field type.

Code

function telephone_field_formatter_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items, $displays) {
  foreach ($entities as $id => $entity) {
    $settings = $displays[$id]['settings'];
    foreach ($items[$id] as &$item) {

      // If available, set custom link text.
      if (!empty($settings['title'])) {
        $item['title'] = $settings['title'];
      }
      else {
        $item['title'] = $item['value'];
      }
    }
  }
}