Project

General

Profile

« Previous | Next » 

Revision cb993828

Added by Andreas Kohlbecker over 2 years ago

ref #9811 switching in search results to portal/taxon/{uuid}/taxonRelationshipsDTO and adapting code

View differences:

modules/cdm_dataportal/cdm_dataportal.module
2742 2742
    $taxon_nodes = cdm_ws_get(CDM_WS_PORTAL_TAXON_TAXONNODES, $taxon->uuid);
2743 2743
  }
2744 2744

  
2745
  $taxon_node_classification_uuids = [];
2745 2746
  if ($taxon->class == "Taxon" && isset($taxon_nodes)) {
2746 2747
    foreach ($taxon_nodes as $node) {
2747 2748
      if($node->class == 'TaxonNodeDto' && isset($node->classificationUUID)){
2748 2749
        // case of TaxonNodeDto
2749
        return $node->classificationUUID == $default_classification_uuid;
2750
        $taxon_node_classification_uuids[] = $node->classificationUUID;
2750 2751
      } else if($node->class == 'TaxonNode' && isset($node->classification->uuid)) {
2751
         return $node->classification->uuid == $default_classification_uuid;
2752
        $taxon_node_classification_uuids[] =  $node->classification->uuid;
2752 2753
      }
2753 2754
    }
2754 2755
  }
2755
  return FALSE;
2756
  return _cdm_dataportal_matches_current_view($taxon_node_classification_uuids);
2757
}
2758

  
2759
/**
2760
 * Check if one uuid in the given set matches the current classification uuid.
2761
 *
2762
 * @param array $taxon_node_classification_uuids
2763
 *   A list of classification uuids.
2764
 * @return bool
2765
 */
2766
function _cdm_dataportal_matches_current_view($taxon_node_classification_uuids) {
2767

  
2768
  $default_classification_uuid = get_current_classification_uuid();
2769
  return array_search($default_classification_uuid, $taxon_node_classification_uuids) !== false;
2756 2770
}
2757 2771

  
2758 2772
/**

Also available in: Unified diff