Revision df6226aa
Added by Andreas Kohlbecker almost 8 years ago
modules/cdm_dataportal/includes/taxon.inc | ||
---|---|---|
45 | 45 |
*/ |
46 | 46 |
function cdm_taxonRelationships($taxonRelationships, $focusedTaxon){ |
47 | 47 |
|
48 |
static $NULL_AUTHORTEAM = 'NULL_AUTHORTEAM'; |
|
49 |
|
|
48 | 50 |
if (!$taxonRelationships) { |
49 | 51 |
return null; |
50 | 52 |
} |
51 | 53 |
|
52 |
RenderHints::pushToRenderStack('taxonRelationships');
|
|
53 |
$footnoteListKey = 'taxonRelationships';
|
|
54 |
RenderHints::pushToRenderStack('taxon_relationships');
|
|
55 |
$footnoteListKey = 'taxon_relationships';
|
|
54 | 56 |
RenderHints::setFootnoteListKey($footnoteListKey); |
55 | 57 |
|
56 | 58 |
$misapplied = array(); |
... | ... | |
63 | 65 |
|
64 | 66 |
if (in_array($taxonRelation->type->uuid, $taxon_relationship_types)) { |
65 | 67 |
|
68 |
|
|
66 | 69 |
if ($taxonRelation->type->uuid == UUID_MISAPPLIED_NAME_FOR || $taxonRelation->type->uuid == UUID_INVALID_DESIGNATION_FOR) { |
67 | 70 |
|
71 |
RenderHints::pushToRenderStack('misapplied_name_for'); // TODO the render path string should in future come from $taxonRelation->type->... |
|
72 |
|
|
68 | 73 |
$name = $taxonRelation->fromTaxon->name->titleCache; |
69 | 74 |
|
70 | 75 |
if(isset($taxonRelation->fromTaxon->sec)) { |
71 | 76 |
// taxa not always are have a sec reference (e.g. doubtful taxa) |
72 | 77 |
$authorteam = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $taxonRelation->fromTaxon->sec->uuid); |
73 | 78 |
$authorteam = $authorteam->titleCache; |
79 |
if(!$authorteam){ |
|
80 |
$authorteam = $NULL_AUTHORTEAM; |
|
81 |
} |
|
74 | 82 |
} |
75 | 83 |
|
76 | 84 |
if (!isset($misapplied[$name])) { |
... | ... | |
78 | 86 |
$misapplied[$name]['out'] = cdm_related_taxon($taxonRelation->fromTaxon, UUID_MISAPPLIED_NAME_FOR); |
79 | 87 |
} |
80 | 88 |
else { |
81 |
// We need to add the anchors for all of the other mispplied names not |
|
89 |
// We need to add the anchors for all of the other misapplied names not
|
|
82 | 90 |
// being rendered explicitly. |
83 | 91 |
$misapplied[$name]['out'] = uuid_anchor($taxonRelation->fromTaxon->uuid, $misapplied[$name]['out']); |
84 | 92 |
} |
... | ... | |
88 | 96 |
$misapplied[$name]['authorteam'][$authorteam] = ''; |
89 | 97 |
$joinedAuthorTeams[$authorteam] = 'sensu ' . theme('cdm_reference', array('reference' => $taxonRelation->fromTaxon->sec)); |
90 | 98 |
} |
99 |
|
|
91 | 100 |
} |
92 | 101 |
else { |
102 |
RenderHints::pushToRenderStack('other_taxon_relationship'); |
|
93 | 103 |
// All relationsship types but misapplied_name_for |
94 | 104 |
// invalid_designation_for. |
95 | 105 |
$taxon_relationships_lines[] = cdm_taxonRelationship($taxonRelation, TRUE, _is_invers_taxonRelationship($taxonRelation, $focusedTaxon)); |
96 | 106 |
} |
107 |
|
|
108 |
RenderHints::popFromRenderStack(); |
|
97 | 109 |
} |
98 | 110 |
} |
99 | 111 |
|
... | ... | |
101 | 113 |
ksort($joinedAuthorTeams); |
102 | 114 |
foreach ($joinedAuthorTeams as $authorteam => $sensuCitation) { |
103 | 115 |
$footnoteKey = FootnoteManager::addNewFootnote($footnoteListKey, $sensuCitation); |
104 |
$joinedAuthorTeams[$authorteam] = '<span class="sensu">sensu ' |
|
105 |
. $authorteam |
|
106 |
. theme('cdm_footnote_key', array('footnoteKey' => $footnoteKey)) |
|
107 |
. '</span>'; |
|
116 |
|
|
117 |
$joinedAuthorTeams[$authorteam] = '<span class="sensu">' |
|
118 |
. ($authorteam != $NULL_AUTHORTEAM ? 'sensu '. $authorteam : '') |
|
119 |
. theme('cdm_footnote_key', array('footnoteKey' => $footnoteKey)) |
|
120 |
. '</span>'; |
|
121 |
|
|
108 | 122 |
} |
109 | 123 |
|
110 | 124 |
// ---- Generate output ---- // |
Also available in: Unified diff
#5676 sensu for misalppied names without authorteam