16 |
16 |
* @param $typeDesignation_citation The lectotype citation to print
|
17 |
17 |
* @return html valid string
|
18 |
18 |
*/
|
19 |
|
function lectotype_citation_layout($typeDesignation_citation){
|
|
19 |
function lectotype_citation_layout($typeDesignation){
|
|
20 |
|
20 |
21 |
$res = '';
|
21 |
|
if ($typeDesignation_citation){
|
|
22 |
$citation = $typeDesignation->citation;
|
|
23 |
$pages = $typeDesignation->citationMicroReference;
|
|
24 |
if ($citation){
|
22 |
25 |
//$type = $typeDesignation_citation->type;
|
23 |
|
$year = substr($typeDesignation_citation->datePublished->start, 0, 4);
|
24 |
|
$page = $typeDesignation_citation->page;
|
25 |
|
$author = $typeDesignation_citation->authorTeam->titleCache;
|
|
26 |
$year = substr($citation->datePublished->start, 0, 4);
|
|
27 |
$author = $citation->authorTeam->titleCache;
|
26 |
28 |
$res .= ' (designated by ';
|
27 |
29 |
$res .= $author;
|
28 |
30 |
$res .= ($year ? ' '.$year : '');
|
29 |
|
$res .= ($year && $page ? ': '. $page : '');
|
|
31 |
$res .= ($pages ? ': '. $pages : '');
|
30 |
32 |
//$res .= ')';
|
31 |
|
//$res .= ($type ? ': ' . $type : '');
|
32 |
33 |
}
|
33 |
34 |
return $res;
|
34 |
35 |
}
|
35 |
36 |
|
36 |
37 |
function theme_cdm_typedesignations($typeDesignations = array()){
|
37 |
|
|
38 |
|
RenderHints::pushToRenderStack('typedesignations');
|
|
38 |
/*
|
|
39 |
if(isset($renderTemplate['referencePart']['reference']) && $taxonName->nomenclaturalReference){
|
|
40 |
$microreference = null;
|
|
41 |
if(isset($renderTemplate['referencePart']['microreference'])){
|
|
42 |
$microreference = $taxonName->nomenclaturalMicroReference;
|
|
43 |
}
|
|
44 |
$citation = cdm_ws_get(CDM_WS_NOMENCLATURAL_REFERENCE_CITATION, array($typeDesignation->uuid), "microReference=".urlencode($microreference));
|
|
45 |
$citation = $citation->String;
|
|
46 |
*/
|
|
47 |
|
|
48 |
RenderHints::pushToRenderStack('typedesignations');
|
39 |
49 |
//_add_js_cluetip();
|
40 |
50 |
$out = '<ul class="typeDesignations">';
|
41 |
51 |
$typeDesignation_footnotes = false;
|
... | ... | |
47 |
57 |
}else {
|
48 |
58 |
// it's a NameTypeDesignation
|
49 |
59 |
if($typeDesignation->notDesignated){
|
50 |
|
$out .= '<li class="nameTypeDesignation"><span class="status">Lectotype</span> '.t('not designated'). '</li>';
|
|
60 |
$out .= '<li class="nameTypeDesignation"><span class="status">Lectotype</span>: '.t('not designated'). '</li>';
|
51 |
61 |
}else if($typeDesignation->typeName){
|
52 |
62 |
$link_to_name_page = '?q=' . path_to_name($typeDesignation->typeName->uuid);
|
53 |
|
$out .= '<li class="nameTypeDesignation"><span class="status">Lectotype</span> ';
|
|
63 |
$out .= '<li class="nameTypeDesignation"><span class="status">Lectotype</span>';
|
54 |
64 |
|
55 |
|
if($typeDesignation->citation){
|
56 |
|
$out .= lectotype_citation_layout($typeDesignation->citation);
|
|
65 |
if($typeDesignation->citation){
|
|
66 |
$out .= lectotype_citation_layout($typeDesignation);
|
57 |
67 |
//footnotes
|
58 |
68 |
$fkey_typeDesignation = FootnoteManager::addNewFootnote(RenderHints::getRenderPath() . '-typeDesignations-' . $typeDesignation->uuid, $typeDesignation->citation->titleCache);
|
59 |
|
$out .= theme('cdm_footnote_key', $fkey_typeDesignation) . '): ';
|
60 |
|
$typeDesignation_footnotes = true;
|
|
69 |
$out .= theme('cdm_footnote_key', $fkey_typeDesignation) . ')';
|
61 |
70 |
}
|
62 |
71 |
|
63 |
72 |
if($typeDesignation->typeName->nomenclaturalReference){
|
64 |
73 |
$referenceUri = url(path_to_reference($typeDesignation->typeName->nomenclaturalReference->uuid));
|
65 |
74 |
}
|
66 |
|
$out .= theme('cdm_taxonName', $typeDesignation->typeName, $link_to_name_page, $referenceUri);
|
67 |
|
|
|
75 |
|
|
76 |
$out .= ': ' . theme('cdm_taxonName', $typeDesignation->typeName, $link_to_name_page, $referenceUri);
|
68 |
77 |
}
|
69 |
78 |
}
|
70 |
79 |
}
|
... | ... | |
122 |
131 |
$out .= theme('cdm_footnotes', RenderHints::getRenderPath() . '-lectotypes');
|
123 |
132 |
}
|
124 |
133 |
$out .= theme('cdm_footnotes', RenderHints::getRenderPath() . '-acronyms');
|
125 |
|
if ($typeDesignation_footnotes){
|
126 |
|
$out .= theme('cdm_footnotes', RenderHints::getRenderPath() . '-typeDesignations-' . $typeDesignation->uuid);
|
127 |
|
}
|
|
134 |
|
|
135 |
$out .= theme('cdm_footnotes', RenderHints::getRenderPath() . '-typeDesignations-' . $typeDesignation->uuid);
|
|
136 |
|
128 |
137 |
RenderHints::popFromRenderStack();
|
129 |
138 |
return $out;
|
130 |
139 |
}
|
... | ... | |
231 |
240 |
foreach($homotypicalGroup as $synonym){
|
232 |
241 |
if($is_first_entry){
|
233 |
242 |
$is_first_entry = false;
|
234 |
|
$typeDesignations = cdm_ws_get(CDM_WS_NAME_TYPEDESIGNATIONS, $synonym->name->uuid);
|
|
243 |
$typeDesignations = cdm_ws_get(CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS, $synonym->name->uuid);
|
235 |
244 |
// is first list entry
|
236 |
245 |
$out .= '<li class="firstentry synonym">'.theme('cdm_related_taxon',$synonym, UUID_HETEROTYPIC_SYNONYM_OF).'</li>';
|
237 |
246 |
} else {
|
... | ... | |
281 |
290 |
$out .= '<li class="synonym">'.theme('cdm_related_taxon', $synonym, UUID_HOMOTYPIC_SYNONYM_OF).'</li>';
|
282 |
291 |
}
|
283 |
292 |
|
284 |
|
$typeDesignations = cdm_ws_get(CDM_WS_NAME_TYPEDESIGNATIONS, $synonymList[0]->name->uuid);
|
|
293 |
$typeDesignations = cdm_ws_get(CDM_WS_PORTAL_NAME_TYPEDESIGNATIONS, $synonymList[0]->name->uuid);
|
285 |
294 |
if($typeDesignations){
|
286 |
295 |
$out .= theme('cdm_typedesignations', $typeDesignations);
|
287 |
296 |
}
|
type designations with footnotes