You are here

function gdpr_consent_field_formatter_view in General Data Protection Regulation 7

Implements hook_field_formatter_view().

File

modules/gdpr_consent/gdpr_consent.module, line 543
Contains hook implementations and shared functions.

Code

function gdpr_consent_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();
  switch ($display['type']) {
    case 'gdpr_consent':
      foreach ($items as $delta => $item) {
        $element[$delta] = array(
          '#type' => 'html_tag',
          '#tag' => 'p',
          '#value' => t('User Consent ID: @entity', array(
            '@entity' => $item['target_id'],
          )),
        );
      }
      break;
  }
  return $element;
}