You are here

function esign_field_formatter_view in E-Sign 7

Implements hook_field_formatter_view().

File

./esign.module, line 206
Defines all hooks and functions to manage the e-sign field.

Code

function esign_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, &$items, $display) {
  $element = array();
  switch ($display['type']) {
    case 'esign_formatter':
      foreach ($items as $key => $value) {
        $element[$key] = array(
          '#type' => 'markup',
          '#markup' => t('<div class="esignature"><img src="@signature" alt="@signer_name" /></div><div class="signer_name">@signer_name</div><div class="signer_title">@signer_title</div><div class="created">@created</div><br/>', array(
            '@signature' => $value['esignature'],
            '@signer_name' => $value['signer_name'],
            '@signer_title' => $value['signer_title'],
            '@created' => format_date($value['created']),
          )),
        );
      }
      break;
  }
  return $element;
}