Project

General

Profile

« Previous | Next » 

Revision a9a04561

Added by Andreas Kohlbecker almost 5 years ago

ref #8366 refactoring typedesignation and map functions

View differences:

modules/cdm_dataportal/cdm_dataportal.module
1922 1922
      $content['name_relationships'] = compose_name_relationships_list($name_relations, $taxon_name->uuid, null);
1923 1923
    }
1924 1924

  
1925
    $type_designations =  cdm_ws_get(CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS, $taxon_name->uuid);
1926
    if ($type_designations) {
1927
      $content['type_designations'] = markup_to_render_array(
1928
        theme('cdm_typedesignations', array('typeDesignations' => $type_designations, 'enclosing_tag' => 'p', 'element_tag' => 'div'))
1929
      );
1930

  
1931
      $points = array();
1932
      foreach ($type_designations as $td){
1933
        if($td->class == "SpecimenTypeDesignation"){
1934
          $derived_unit_facade = cdm_ws_get(CDM_WS_PORTAL_DERIVEDUNIT_FACADE, array($td->typeSpecimen->uuid));
1935
          if(isset($derived_unit_facade->exactLocation)){
1936
            $points[] = $derived_unit_facade->exactLocation->latitude . ',' . $derived_unit_facade->exactLocation->longitude;
1937
          }
1938
        }
1939
      }
1940

  
1941
      if(count($points) > 0){
1942
        // os=1:c/ff0000/10/noLabel&od=1:52.52079,13.57781|-43.46333333333333,172.60355&legend=0
1943
        $occurrence_query = 'os=1:c/ff0000/10/noLabel&od=1:' . join('|', $points) . '&legend=0';
1944
        // $occurrence_query = 'os=1:c/ff0000/10/noLabel&od=1:52.52079,13.57781|-43.46333333333333,172.60355&legend=0';
1945
        $legend_format_query = null;
1946
        $distribution_query = NULL;
1947
        $content['map'] = compose_map('specimens', $occurrence_query, $distribution_query, $legend_format_query, array());
1948
      }
1949
    }
1925
    // type designations
1926
    $type_designations_render_array = compose_type_designations($taxon_name->uuid);
1950 1927

  
1928
    $content['type_designations'] = $type_designations_render_array['type_designations'];
1929
    $content['map'] = $type_designations_render_array['map'];
1951 1930
    // registrations
1952 1931
    $registrationDTOs= cdm_ws_fetch_all(CDM_WS_REGISTRATION_DTO,  array('nameUuid' => $taxon_name_uuid));
1953 1932
    if(isset($registrationDTOs) && count($registrationDTOs ) > 0 ){
......
1974 1953
  }
1975 1954
}
1976 1955

  
1956

  
1977 1957
/**
1978 1958
 * Returns a registration page as a Drupal node to be rendered by Drupal.
1979 1959
 *

Also available in: Unified diff