Revision e413f218
Added by Andreas Kohlbecker about 8 years ago
modules/cdm_dataportal/includes/descriptions.inc | ||
---|---|---|
925 | 925 |
} |
926 | 926 |
|
927 | 927 |
|
928 |
/** |
|
929 |
* Theme function to render CDM DescriptionElements of the type TaxonInteraction. |
|
930 |
* |
|
931 |
* @param $element |
|
932 |
* The CDM TaxonInteraction entity |
|
933 |
* |
|
934 |
* @return |
|
935 |
* A drupal render array |
|
936 |
* |
|
937 |
* @ingroup compose |
|
938 |
*/ |
|
939 |
function compose_description_element_taxon_interaction($element, $feature_block_settings) { |
|
940 |
|
|
941 |
$out = ''; |
|
942 |
$enclosing_tag = cdm_feature_block_element_tag_name($feature_block_settings); |
|
943 |
|
|
944 |
if (isset($element->description_L10n)) { |
|
945 |
$out .= ' ' . $element->description_L10n; |
|
946 |
} |
|
947 |
|
|
948 |
if(isset($element->taxon2)){ |
|
949 |
$out = render_taxon_or_name($element->taxon2, url(path_to_taxon($element->taxon2->uuid))); |
|
950 |
} |
|
951 |
|
|
952 |
$annotations_and_sources = handle_annotations_and_sources( |
|
953 |
$element, |
|
954 |
$feature_block_settings, |
|
955 |
$out, // the description element text |
|
956 |
$element->feature->uuid |
|
957 |
); |
|
958 |
|
|
959 |
if(!empty($annotations_and_sources['source_references'])){ |
|
960 |
$out .= ' ' . join(' ', $annotations_and_sources['source_references'] ); |
|
961 |
} |
|
962 |
return '<' . $enclosing_tag . '>' . $out . $annotations_and_sources['foot_note_keys'] . '</' . $enclosing_tag . '>'; |
|
963 |
|
|
964 |
} |
|
965 |
|
|
966 |
|
|
928 | 967 |
/** |
929 | 968 |
* Renders a single instance of the type IndividualsAssociations. |
930 | 969 |
* |
... | ... | |
1143 | 1182 |
break; |
1144 | 1183 |
case 'TaxonInteraction': |
1145 | 1184 |
$feature_block_has_content = true; |
1146 |
$elements_out_array[] = theme('cdm_descriptionElement_TaxonInteraction', array('element' => $descriptionElement));
|
|
1185 |
$elements_out_array[] = compose_description_element_taxon_interaction($descriptionElement, $feature_block_settings);
|
|
1147 | 1186 |
break; |
1148 | 1187 |
case 'Uses': |
1149 | 1188 |
/* IGNORE Uses classes, these are handled completely in theme_cdm_UseDescription */ |
Also available in: Unified diff
#5583 turning theme function to compose method for IndividualsAssociations