Revision 0387c539
Added by Andreas Kohlbecker over 13 years ago
modules/cdm_dataportal/theme/cdm_dataportal.taxon.theme | ||
---|---|---|
64 | 64 |
* @param unknown_type $taxonRelationships |
65 | 65 |
* @return unknown |
66 | 66 |
*/ |
67 |
function theme_cdm_taxonRelations($taxonRelationships){ |
|
67 |
function theme_cdm_taxonRelationships($taxonRelationships){
|
|
68 | 68 |
|
69 | 69 |
if(!$taxonRelationships){ |
70 | 70 |
return; |
71 | 71 |
} |
72 |
|
|
73 |
RenderHints::pushToRenderStack('taxonRelationships'); |
|
74 |
$footnoteListKey = 'taxonRelationships'; |
|
75 |
RenderHints::setFootnoteListKey($footnoteListKey); |
|
72 | 76 |
|
73 |
_add_js_cluetip(); |
|
74 |
|
|
75 |
// aggregate misapplied names having the same fullname: |
|
76 | 77 |
$misapplied = array(); |
78 |
$joinedAuthorTeams = array(); |
|
79 |
|
|
80 |
// aggregate misapplied names having the same fullname: |
|
77 | 81 |
foreach($taxonRelationships as $taxonRelation){ |
78 | 82 |
if(true || $taxonRelation->type->uuid == UUID_MISAPPLIED_NAME_FOR || $taxonRelation->type->uuid == UUID_INVALID_DESIGNATION_FOR ){ |
79 | 83 |
|
... | ... | |
87 | 91 |
|
88 | 92 |
// collect all authors for this fullname |
89 | 93 |
if(isset($authorteam)){ |
90 |
$misapplied[$name]['authorteam'][$authorteam] = ' <span class="sensu cluetip no-print" title="|sensu '.htmlspecialchars(theme('cdm_reference',$taxonRelation->fromTaxon->sec )).'|">sensu ' |
|
91 |
.$authorteam.'</span>' |
|
92 |
.'<span class="reference only-print">sensu '.theme('cdm_reference', $taxonRelation->fromTaxon->sec ).'</span>'; |
|
94 |
$misapplied[$name]['authorteam'][$authorteam] = ''; |
|
95 |
$joinedAuthorTeams[$authorteam] = 'sensu '.theme('cdm_reference', $taxonRelation->fromTaxon->sec); |
|
93 | 96 |
} |
94 | 97 |
|
95 | 98 |
} |
96 | 99 |
} |
100 |
|
|
101 |
// sort the joinedAuthorTeams and create footnotes and footnotekeys |
|
102 |
ksort($joinedAuthorTeams); |
|
103 |
foreach($joinedAuthorTeams as $authorteam=>$sensuCitation){ |
|
104 |
$footnoteKey = FootnoteManager::addNewFootnote($footnoteListKey, $sensuCitation); |
|
105 |
$joinedAuthorTeams[$authorteam] = '<span class="sensu">sensu '.$authorteam. theme('cdm_footnote_key', $footnoteKey).'</span>'; |
|
106 |
} |
|
97 | 107 |
|
98 | 108 |
// generate output |
99 | 109 |
$out = '<ul class="misapplied">'; |
110 |
|
|
100 | 111 |
foreach($misapplied as $misapplied_name){ |
112 |
|
|
101 | 113 |
$out .= '<li class="synonym">'.$misapplied_name['out'] . " "; |
102 |
// sorting authors |
|
114 |
// fill authors the renderedFootnoteKey and sorting 'em |
|
115 |
foreach($misapplied_name['authorteam'] as $authorteam=>&$renderedFootnoteKey) { |
|
116 |
$renderedFootnoteKey = $joinedAuthorTeams[$authorteam]; |
|
117 |
} |
|
103 | 118 |
if(isset($misapplied_name['authorteam'])){ |
104 | 119 |
ksort($misapplied_name['authorteam']); |
105 | 120 |
$out .= join('; ', $misapplied_name['authorteam']); |
106 | 121 |
} |
107 | 122 |
$out .= '</li>'; |
123 |
|
|
108 | 124 |
} |
109 | 125 |
$out .= '</ul>'; |
126 |
|
|
127 |
$out .= theme('cdm_footnotes', $footnoteListKey, 'div'); |
|
128 |
RenderHints::popFromRenderStack(); |
|
110 | 129 |
return $out; |
111 | 130 |
} |
112 | 131 |
|
Also available in: Unified diff
footnotes for taxon names in the synonymy page #392 and replacing "senu bubbles" #391