Revision 9eeb624f
Added by Andreas Kohlbecker about 3 years ago
modules/cdm_dataportal/includes/occurrences_new.inc | ||
---|---|---|
73 | 73 |
} |
74 | 74 |
|
75 | 75 |
if($full_details){ |
76 |
RenderHints::setAnnotationsAndSourceConfig([ |
|
77 |
'sources_as_content' => TRUE, |
|
78 |
'link_to_name_used_in_source' => TRUE, |
|
79 |
'link_to_reference' => FALSE, |
|
80 |
'add_footnote_keys' => FALSE, |
|
81 |
'bibliography_aware' => FALSE |
|
82 |
]); |
|
83 |
$annotations_and_sources = handle_annotations_and_sources($sob_dto); |
|
84 |
if ($annotations_and_sources->hasSourceReferences()) { |
|
85 |
$render_array['sources'] = compose_cdm_sob_dto_sources($sob_dto, $annotations_and_sources); |
|
86 |
} |
|
76 |
// Annotations and Sources |
|
77 |
RenderHints::setAnnotationsAndSourceConfig([ |
|
78 |
'sources_as_content' => TRUE, |
|
79 |
'link_to_name_used_in_source' => TRUE, |
|
80 |
'link_to_reference' => FALSE, |
|
81 |
'add_footnote_keys' => FALSE, |
|
82 |
'bibliography_aware' => FALSE |
|
83 |
]); |
|
84 |
$annotations_and_sources = handle_annotations_and_sources($sob_dto); |
|
85 |
if ($annotations_and_sources->hasSourceReferences()) { |
|
86 |
$render_array['sources'] = compose_cdm_sob_dto_sources($sob_dto, $annotations_and_sources); |
|
87 |
} |
|
88 |
// Markers |
|
89 |
$markers = cdm_ws_get(CDM_WS_PORTAL_OCCURRENCE, [$sob_dto->uuid, 'markers']); |
|
90 |
if(isset_not_empty($markers->records)){ |
|
91 |
$render_array['markers'] = compose_cdm_sob_dto_markers($sob_dto, $markers); |
|
92 |
} |
|
87 | 93 |
} |
88 | 94 |
|
89 | 95 |
return $render_array; |
... | ... | |
435 | 441 |
return cdm_sob_dto_table($label, $table_row_data, $sob_dto, 1); |
436 | 442 |
} |
437 | 443 |
|
444 |
function compose_cdm_sob_dto_markers($sob_dto, $markers) { |
|
445 |
|
|
446 |
$table_row_data = []; |
|
447 |
foreach ($markers->records as $marker) { |
|
448 |
$table_row_data[] = cdm_sob_dto_table_row($marker->markerType->representation_L10n, ($marker->flag !== TRUE ? t('yes') : t('no'))); |
|
449 |
} |
|
450 |
|
|
451 |
$label = count($table_row_data) > 1 ? t("Markers") : t("Marker"); |
|
452 |
return cdm_sob_dto_table($label, $table_row_data, $sob_dto, 1); |
|
453 |
} |
|
454 |
|
|
438 | 455 |
/** |
439 | 456 |
* Compose an render array from the DerivedUnitDTO.specimenTypeDesignations. |
440 | 457 |
* |
... | ... | |
703 | 720 |
} |
704 | 721 |
break; |
705 | 722 |
|
706 |
case 'markers': |
|
707 |
$dd_elements = array(); |
|
708 |
foreach ($value as $marker) { |
|
709 |
$dd_elements[] = compose_cdm_marker($marker); |
|
710 |
} |
|
711 |
@_description_list_group_add($groups, cdm_occurrence_field_name_label($field), $dd_elements); |
|
712 |
break; |
|
723 |
|
|
713 | 724 |
|
714 | 725 |
@_description_list_group_add($groups, t('Notes:'), $dd_elements); |
715 | 726 |
|
Also available in: Unified diff
ref #6866 adding markers to specimen page