data__accession_formatter.inc 707 B

1234567891011121314151617181920212223242526
  1. <?php
  2. class data__accession_formatter extends ChadoFieldFormatter {
  3. // The default lable for this field.
  4. public static $default_label = 'Accession';
  5. // The list of field types for which this formatter is appropriate.
  6. public static $field_types = array('data__accession');
  7. /**
  8. * @see TripalFieldFormatter::view()
  9. */
  10. public function view(&$element, $entity_type, $entity, $langcode, $items, $display) {
  11. foreach ($items as $delta => $item) {
  12. if ($item['value']) {
  13. $content = $item['value']['vocabulary'] . ':' . $item['value']['accession'];
  14. $element[$delta] = array(
  15. '#type' => 'markup',
  16. '#markup' => $content,
  17. );
  18. }
  19. }
  20. }
  21. }