data__sequence_checksum_formatter.inc 818 B

123456789101112131415161718192021222324252627
  1. <?php
  2. class data__sequence_checksum_formatter extends TripalFieldFormatter {
  3. // The default lable for this field.
  4. public static $label = 'Sequence checksum';
  5. // The list of field types for which this formatter is appropriate.
  6. public static $field_types = array('data__sequence_checksum');
  7. // The list of default settings for this formatter.
  8. public static $settings = array();
  9. /**
  10. * @see TripalFieldFormatter::view()
  11. */
  12. public function view(&$element, $entity_type, $entity, $langcode, $items, $display) {
  13. foreach ($items as $delta => $item) {
  14. $content = key_exists('value', $item) ? $item['value'] : '';
  15. $element[$delta] = array(
  16. // We create a render array to produce the desired markup,
  17. '#type' => 'markup',
  18. '#markup' => $content,
  19. );
  20. }
  21. }
  22. }