Revision c5294246
Added by Andreas Kohlbecker over 7 years ago
modules/cdm_dataportal/theme/cdm_dataportal.name.theme | ||
---|---|---|
76 | 76 |
$out = '<ul class="typeDesignations">'; |
77 | 77 |
$typeDesignation_footnotes = FALSE; |
78 | 78 |
$is_lectotype = FALSE; |
79 |
$specimenTypeDesignations = array();
|
|
79 |
$specimen_type_designations = array();
|
|
80 | 80 |
$separator = ','; |
81 | 81 |
foreach ($typeDesignations as $typeDesignation) { |
82 | 82 |
if ($typeDesignation->class == 'SpecimenTypeDesignation') { |
83 | 83 |
// SpecimenTypeDesignations should be ordered. Collect theme here only. |
84 |
$specimenTypeDesignations[] = $typeDesignation;
|
|
84 |
$specimen_type_designations[] = $typeDesignation;
|
|
85 | 85 |
} |
86 | 86 |
// It is a lectotype? |
87 | 87 |
else { |
... | ... | |
109 | 109 |
} |
110 | 110 |
} |
111 | 111 |
|
112 |
if (!empty($specimenTypeDesignations)) {
|
|
112 |
if (!empty($specimen_type_designations)) {
|
|
113 | 113 |
// Sorting might be different for dataportals so this has to be |
114 | 114 |
// parameterized. |
115 |
usort($specimenTypeDesignations, "compare_specimenTypeDesignationStatus");
|
|
116 |
foreach ($specimenTypeDesignations as $std) {
|
|
115 |
usort($specimen_type_designations, "compare_specimenTypeDesignationStatus");
|
|
116 |
foreach ($specimen_type_designations as $type_designation) {
|
|
117 | 117 |
$typeReference = ''; |
118 |
if (!empty($std->citation)) { |
|
119 |
$author_team = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $std->citation->uuid); |
|
120 |
$shortCitation = $author_team->titleCache; |
|
121 |
|
|
122 |
$shortCitation .= (strlen($shortCitation) > 0 ? ' ' : '') . partialToYear($std->citation->datePublished->start); |
|
123 |
$missingShortCitation = FALSE; |
|
124 |
if (strlen($shortCitation) == 0) { |
|
125 |
$shortCitation = theme('cdm_reference', array('reference' => $std->citation)); |
|
126 |
$missingShortCitation = TRUE; |
|
118 |
|
|
119 |
if (!empty($type_designation->citation)) { |
|
120 |
|
|
121 |
$citation_footnote_str = theme('cdm_reference', array('reference' => $type_designation->citation)); |
|
122 |
$author_team = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $type_designation->citation->uuid); |
|
123 |
|
|
124 |
if(isset($author_team->titleCache)){ |
|
125 |
$authorteam_str = $author_team->titleCache . partialToYear($type_designation->citation->datePublished->start); |
|
126 |
if($authorteam_str == $type_designation->citation->titleCache){ |
|
127 |
$citation_footnote_str = ''; |
|
128 |
} |
|
129 |
} else { |
|
130 |
$authorteam_str = $citation_footnote_str; |
|
131 |
// no need for a footnote in case in case it is used as replacement for missing author teams |
|
132 |
$citation_footnote_str = ''; |
|
127 | 133 |
} |
128 | 134 |
|
129 |
$typeReference .= ' (' . t('designated by'); |
|
130 |
$typeReference .= ' <span class="typeReference">'; |
|
131 |
$typeReference .= $shortCitation . '</span>'; |
|
132 |
if (!empty($std->citationMicroReference)) { |
|
133 |
$typeReference .= ':' . $std->citationMicroReference; |
|
135 |
$footnote_key_markup = ''; |
|
136 |
if($citation_footnote_str) { |
|
137 |
// footnotes should be rendered in the parent element so we |
|
138 |
// are relying on the FootnoteListKey set there |
|
139 |
$_fkey2 = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $citation_footnote_str); |
|
140 |
$footnote_key_markup = theme('cdm_footnote_key', array( |
|
141 |
'footnoteKey' => $_fkey2, |
|
142 |
'separator' => $separator, |
|
143 |
'highlightable' => TRUE, |
|
144 |
'separator_off' => TRUE, |
|
145 |
)); |
|
146 |
|
|
134 | 147 |
} |
135 |
$typeReference .= ')'; |
|
136 |
|
|
137 |
// footnotes should be rendered in the parent element so we |
|
138 |
// are relying on the FootnoteListKey set there |
|
139 |
$_fkey2 = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $std->citation->titleCache); |
|
140 |
$typeReference .= theme('cdm_footnote_key', array( |
|
141 |
'footnoteKey' => $_fkey2, |
|
142 |
'separator' => $separator, |
|
143 |
'highlightable' => TRUE, |
|
144 |
'separator_off' => TRUE, |
|
145 |
)); |
|
148 |
|
|
149 |
$typeReference .= ' (' . t('designated by') . ' <span class="typeReference">'. $authorteam_str . '</span>'; |
|
150 |
if (!empty($type_designation->citationMicroReference)) { |
|
151 |
$typeReference .= ':' . $type_designation->citationMicroReference; |
|
152 |
} |
|
153 |
$typeReference .= $footnote_key_markup . ')'; |
|
154 |
|
|
146 | 155 |
} |
147 | 156 |
|
148 | 157 |
$derivedUnitFacadeInstance = null; |
149 | 158 |
|
150 | 159 |
$out .= '<li class="specimenTypeDesignation">'; |
151 | 160 |
$out .= '<span class="status">' |
152 |
. ((isset($std->typeStatus->representation_L10n)) ? $std->typeStatus->representation_L10n : t('Type'))
|
|
161 |
. ((isset($type_designation->typeStatus->representation_L10n)) ? $type_designation->typeStatus->representation_L10n : t('Type'))
|
|
153 | 162 |
. $typeReference |
154 | 163 |
. '</span>'; |
155 | 164 |
|
156 | 165 |
|
157 |
if (isset($std->typeSpecimen)) {
|
|
158 |
$derivedUnitFacadeInstance = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, $std->typeSpecimen->uuid);
|
|
166 |
if (isset($type_designation->typeSpecimen)) {
|
|
167 |
$derivedUnitFacadeInstance = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, $type_designation->typeSpecimen->uuid);
|
|
159 | 168 |
} |
160 | 169 |
if ( isset($derivedUnitFacadeInstance ) ){ |
161 | 170 |
$out .= ': ' . $derivedUnitFacadeInstance->titleCache; // . ': ' . theme('cdm_specimen', array('specimenTypeDesignation' => $derivedUnitFacadeInstance)); |
Also available in: Unified diff
ref #3061 fixing position of footnote