Project

General

Profile

« Previous | Next » 

Revision 2fc97419

Added by Andreas Kohlbecker about 10 years ago

dataportal now uses the DescriptionInfoDTO service - cleaning up old stuff

View differences:

7.x/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
775 775

  
776 776
  RenderHints::pushToRenderStack('cdm_descriptionElements');
777 777

  
778
  // --- Handle DTO
779
  // fully disabled !!!!!!!!!!!!!
780
  if(false
781
    && $feature->uuid == UUID_DISTRIBUTION && $descriptionElements['#type'] == 'DTO'){
782
    // new faster DTO web services have been used
783

  
784
    if(isset($descriptionElements['TextData'])){
785
      // --- TextData
786
      foreach ($descriptionElements['TextData'] as $descriptionElement){
787
        $asListElement = FALSE;
788
        $repr = theme('cdm_descriptionElementTextData', array(
789
            'element' => $descriptionElement,
790
            'asListElement' => $asListElement,
791
            'feature_uuid' => $descriptionElement->feature->uuid,
792
        ));
793

  
794
        if (!array_search($repr, $outArray)) {
795
          $outArray[] = $repr;
796
          // TODO HINT: sorting in theme_cdm_descriptionElementArray will
797
          // not work since this array contains html attributes with uuids
798
          // !!!!
799
          $sortOutArray = TRUE;
800
          $glue = '<br/> ';
801
          $enclosingTag = 'p';
802
        }
803
      }
804
    }
805

  
806
    // ---
807
    if(isset($descriptionElements['DistributionInfoDTO'])){
808
      if(isset($descriptionElements['DistributionInfoDTO']->elements)){
809
        foreach ($descriptionElements['DistributionInfoDTO']->elements as $descriptionElement){
810
          if (is_object($descriptionElement->area)) {
811
            $sortKey = $descriptionElement->area->representation_L10n;
812
            $distributionElements[$sortKey] = $descriptionElement;
813
          }
814
        }
815
      }
816
      if(isset($descriptionElements['DistributionInfoDTO']->tree)){
817
        $distribution_tree = $descriptionElements['DistributionInfoDTO']->tree;
818
      }
819
    }
820

  
821
  } else if (is_array($descriptionElements)) {
778
  if (is_array($descriptionElements)) {
822 779
    // --- normal description element arrays
823 780
    foreach ($descriptionElements as $descriptionElement) {
824 781

  
825
      // --- DISTRIBUTION ---- //
826
      /* no longer in use, has been replaced
827
       *
828
      if ($descriptionElement->feature->uuid == UUID_DISTRIBUTION) {
829
        if ($descriptionElement->class == 'Distribution' && is_object($descriptionElement->area)) {
830
          $sortKey = $descriptionElement->area->representation_L10n;
831
          $distributionElements[$sortKey] = $descriptionElement;
832
        }
833
        else if ($descriptionElement->class == 'TextData') {
834
          $asListElement = FALSE;
835
          $repr = theme('cdm_descriptionElementTextData', array(
836
            'element' => $descriptionElement,
837
            'asListElement' => $asListElement,
838
            'feature_uuid' => $descriptionElement->feature->uuid,
839
          ));
840

  
841
          if (!array_search($repr, $outArray)) {
842
            $outArray[] = $repr;
843
            // TODO HINT: sorting in theme_cdm_descriptionElementArray will
844
            // not work since this array contains html attributes with uuids
845
            // !!!!
846
            $sortOutArray = TRUE;
847
            $glue = '<br/> ';
848
            $enclosingTag = 'p';
849
          }
850
        }
851
      }
852
      else
853
*/
854 782
      // --- IMAGE_SOURCES --- //
855 783
      if ($descriptionElement->feature->uuid == UUID_IMAGE_SOURCES) {
856 784
        $image_sources[] = $descriptionElement;
......
908 836
  } // END normal description element arrays
909 837

  
910 838

  
911
//   if ($distribution_tree) {
912
//     $outArray[] = theme('cdm_description_ordered_distributions', array('taxon_uuid' => $taxon_uuid, 'distribution_tree' => $distribution_tree));
913
//   }
914
//   else {
915
//     ksort($distributionElements);
916
//     // TODO , $entryEnclosingTag);
917
//     $outArray[] = theme('cdm_descriptionElement_Distribution', array(
918
//       'descriptionElements' => $distributionElements,
919
//     ));
920
//   }
921

  
922 839
  $out = theme('cdm_descriptionElementArray', array(
923 840
    'elementArray' => $outArray,
924 841
    'feature' => $feature,
......
1043 960
 */
1044 961
function theme_cdm_description_ordered_distributions($variables) {
1045 962

  
1046
//  TODO REMOVE $taxon_uuid = $variables['taxon_uuid'];
1047
// TODO REMOVE
1048 963
  $distribution_tree = $variables['distribution_tree'];
1049 964

  
1050 965
  // Returning NULL if there are no description elements.
......
1058 973
  RenderHints::pushToRenderStack('descriptionElementDistribution');
1059 974
  RenderHints::setFootnoteListKey(UUID_DISTRIBUTION);
1060 975

  
1061

  
1062
  /* TODO REMOVE
1063
  // Getting all the taxon description for a given taxon.
1064
  $markerTypesEmpty = array();
1065
  // $markerTypesEmpty['markerTypes'] = 'af9860ff-08f5-4b4d-863c-49ae96985115';
1066
  $markerTypesEmpty['markerTypes'] = '';
1067
  $queryString = $markerTypesEmpty['markerTypes'] ? queryString($markerTypesEmpty) : '';
1068

  
1069
  // Getting the sortered distributions (omitting level ??).
1070
  $taxonDescriptions = cdm_ws_get(CDM_WS_TAXON . "/$0/descriptions", $taxon_uuid, $queryString);
1071
  foreach ($taxonDescriptions->records as $description) {
1072
    $descriptions_uuids[] = $description->uuid;
1073
  }
1074
  $request_params = cdm_distribution_filter_query();
1075
  $request_params['omitLevels'] = UUID_NAMEDAREALEVEL_TDWGLEVEL_2;
1076
  $ordered_areas = cdm_ws_get(CDM_WS_PORTAL_DESCRIPTION_DISTRIBUTION_TREE, join(',', $descriptions_uuids), queryString($request_params));
1077
  */
1078

  
1079 976
  $ordered_areas = $distribution_tree;
1080 977
  if (isset($ordered_areas->rootElement->children)) {
1081 978
    $ordered_areas = $ordered_areas->rootElement->children;

Also available in: Unified diff