You are here

function textimage_field_formatter_view in Textimage 7.2

Same name and namespace in other branches
  1. 7.3 textimage.module \textimage_field_formatter_view()

Implements hook_field_formatter_view().

File

./textimage.module, line 677
Provides text to image manipulations.

Code

function textimage_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  if ('textimage' !== drupal_substr($display['type'], 0, 9)) {
    return array();
  }
  $element = array();
  foreach ($items as $delta => $item) {
    $variables = array();
    $variables['preset'] = drupal_substr($display['type'], 10);
    $variables['text'] = $item['value'];
    $variables['additional_text'] = array();
    $variables['format'] = 'png';
    $variables['file_path'] = '';
    $variables['alt'] = htmlentities($item['value']);
    $variables['title'] = htmlentities($item['value']);
    $variables['image'] = TRUE;
    $element[$delta]['#markup'] = theme('textimage_image', $variables);
  }
  return $element;
}