Project

General

Profile

« Previous | Next » 

Revision f5e7f68e

Added by Andreas Kohlbecker over 5 years ago

ref #7977 display of specimen type designations and stableURIs

View differences:

modules/cdm_dataportal/cdm_dataportal.module
2039 2039
    }
2040 2040
    if(is_object($registration_dto->orderdTypeDesignationWorkingSets)) {
2041 2041
      $field_unit_uuids = array();
2042
      $specimen_type_designation_refs = array();
2042 2043
      $name_type_designation_refs = array();
2043 2044
      foreach ((array)$registration_dto->orderdTypeDesignationWorkingSets as $field_unit_ref => $obj) {
2044 2045
        $tokens = explode("#", $field_unit_ref);
2046
        foreach ($obj as $type_status => $entity_reference_list) {
2047
          // NOTE: there is always only one element, since we use the foreach to extract the objects field name and value
2048
          $entity_reference = $entity_reference_list[0];
2049
        }
2045 2050
        if ($tokens[0] == 'NameTypeDesignation') {
2046
          foreach ($obj as $type_status => $entity_reference) {
2047
            // NOTE: there is always only one element, since we use the foreach to extract the field name an value
2048
            $name_type_designation_refs[$type_status] = $entity_reference[0];
2051
          foreach ($obj as $type_status => $entity_reference_list) {
2052
            $name_type_designation_refs[$type_status] = $entity_reference;
2049 2053
          }
2050
        } else {
2054
        } else if ($tokens[0] == 'FieldUnit'){
2051 2055
          $field_unit_uuids[] = $tokens[1];
2056
          $specimen_type_designation_refs[$type_status] = $entity_reference;
2057
        } else {
2058
          drupal_set_message("Unimplemented type: " . $tokens[0], 'error');
2052 2059
        }
2053 2060
      }
2054 2061
      if (count($name_type_designation_refs) > 0) {
......
2058 2065
        $render_array['name_type_designations']['#weight'] = 22;
2059 2066
      }
2060 2067
      if (count($field_unit_uuids) > 0) {
2061
        $render_array['specimen_table'] = compose_specimen_table($field_unit_uuids);
2068
        $render_array['specimen_type_designations'] = compose_specimen_type_designations($specimen_type_designation_refs);
2069
        // $render_array['specimen_table'] = compose_specimen_table($field_unit_uuids);
2062 2070
        // below citation (weight=20)
2063 2071
        $render_array['specimen_table']['#weight'] = 30;
2064 2072
      }

Also available in: Unified diff