600 |
600 |
* @ingroup compose
|
601 |
601 |
*/
|
602 |
602 |
function compose_specimen_type_designations($type_entity_refs){
|
|
603 |
|
603 |
604 |
$render_array = array();
|
|
605 |
|
604 |
606 |
foreach($type_entity_refs as $type_status => $specimen_type){
|
605 |
607 |
$type_designation = cdm_ws_get(CDM_TYPEDESIGNATION, array($specimen_type->uuid));
|
|
608 |
|
606 |
609 |
$preferredStableUri = '';
|
|
610 |
$citation_markup = '';
|
|
611 |
$media = '';
|
|
612 |
|
|
613 |
// preferredStableUri
|
607 |
614 |
if(isset($type_designation->typeSpecimen->preferredStableUri) && $type_designation->typeSpecimen->preferredStableUri){
|
608 |
615 |
$preferredStableUri = $type_designation->typeSpecimen->preferredStableUri;
|
609 |
616 |
}
|
610 |
|
$render_array[] = markup_to_render_array('<div class="specimen_type_designation ' . html_class_attribute_ref($specimen_type) . '"><span class="type_status">'
|
611 |
|
. ucfirst($type_status)
|
612 |
|
. "</span>: "
|
|
617 |
|
|
618 |
$mediaSpecimen = cdm_ws_get(CDM_WS_PORTAL_OCCURRENCE, array($type_designation->typeSpecimen->uuid, 'mediaSpecimen'));
|
|
619 |
if($mediaSpecimen){
|
|
620 |
// compose output
|
|
621 |
// mediaURI
|
|
622 |
if(isset($mediaSpecimen->representations[0])) {
|
|
623 |
$gallery_settings = getGallerySettings(CDM_DATAPORTAL_SPECIMEN_GALLERY_NAME);
|
|
624 |
$captionElements = array(
|
|
625 |
'#uri' => t('open media'),
|
|
626 |
'elements' => array('-none-'),
|
|
627 |
'sources_as_content' => true
|
|
628 |
);
|
|
629 |
$media = compose_cdm_media_gallerie(array(
|
|
630 |
'mediaList' => array($mediaSpecimen),
|
|
631 |
'galleryName' => CDM_DATAPORTAL_TYPE_SPECIMEN_GALLERY_NAME . '_' . $specimen_type->uuid,
|
|
632 |
'maxExtend' => $gallery_settings['cdm_dataportal_media_maxextend'],
|
|
633 |
'cols' => $gallery_settings['cdm_dataportal_media_cols'],
|
|
634 |
'captionElements' => $captionElements,
|
|
635 |
));
|
|
636 |
}
|
|
637 |
// citation and detail
|
|
638 |
$annotations_and_sources = handle_annotations_and_sources(
|
|
639 |
$mediaSpecimen,
|
|
640 |
array(
|
|
641 |
'sources_as_content' => true,
|
|
642 |
'link_to_name_used_in_source' => false,
|
|
643 |
'link_to_reference' => true,
|
|
644 |
'add_footnote_keys' => false,
|
|
645 |
'bibliography_aware' => false),
|
|
646 |
'',
|
|
647 |
null
|
|
648 |
);
|
|
649 |
if(is_array( $annotations_and_sources['source_references'])){
|
|
650 |
$citation_markup = join(', ', $annotations_and_sources['source_references']);
|
|
651 |
}
|
|
652 |
}
|
|
653 |
|
|
654 |
$render_array[] = markup_to_render_array('<div class="specimen_type_designation ' . html_class_attribute_ref($specimen_type) . '">
|
|
655 |
<span class="type_status">' . ucfirst($type_status) . "</span>: "
|
613 |
656 |
. $specimen_type->label
|
|
657 |
. ($citation_markup ? ' '. $citation_markup : '')
|
614 |
658 |
. ($preferredStableUri ? " ". l($preferredStableUri, $preferredStableUri) : '')
|
|
659 |
. $media
|
615 |
660 |
. '</div>');
|
616 |
661 |
}
|
617 |
662 |
return $render_array;
|
ref #7977 better specimen type representation in registration page: