Revision f0df1f96
Added by Francisco Revilla over 13 years ago
modules/cdm_dataportal/cdm_dataportal.module | ||
---|---|---|
1878 | 1878 |
return $outArrayOfMedia; |
1879 | 1879 |
} |
1880 | 1880 |
|
1881 |
function cdm_annotations_as_footnotekeys($cdmBase){ |
|
1881 |
function cdm_annotations_as_footnotekeys($cdmBase, $footnote_list_key = array()){ |
|
1882 |
$footNoteKeys = array(); |
|
1882 | 1883 |
//is argument cdmBase an array? |
1883 | 1884 |
if (!is_array($cdmBase)){ |
1884 | 1885 |
$cdmBase_array = array(); |
... | ... | |
1886 | 1887 |
}else{ |
1887 | 1888 |
$cdmBase_array = $cdmBase; |
1888 | 1889 |
} |
1890 |
//getting the key for the footnotemanager |
|
1891 |
if((bool) $footnote_list_key){ |
|
1892 |
$footnoteListKey = $footnote_list_key; |
|
1893 |
}else{ |
|
1894 |
$footnoteListKey = RenderHints::getFootnoteListKey() . '-annotations'; |
|
1895 |
} |
|
1889 | 1896 |
//adding the footnotes keys |
1890 |
$footNoteKeys = array(); |
|
1891 |
$footnoteListKey = RenderHints::getFootnoteListKey() . '-annotations'; |
|
1892 | 1897 |
foreach($cdmBase_array as $cdmBase_element){ |
1893 | 1898 |
$annotationUrl = cdm_compose_annotations_url($cdmBase_element); |
1894 | 1899 |
if($annotationUrl){ |
modules/cdm_dataportal/theme/cdm_dataportal.common.theme | ||
---|---|---|
109 | 109 |
* TODO it should be configurable which objects can be annotated as this might differ in dataportals |
110 | 110 |
* |
111 | 111 |
*/ |
112 |
function theme_cdm_annotations_as_footnotekeys($cdmBase){ |
|
113 |
$footNoteKeys = cdm_annotations_as_footnotekeys($cdmBase); |
|
112 |
function theme_cdm_annotations_as_footnotekeys($cdmBase, $footnote_list_key = array()){
|
|
113 |
$footNoteKeys = cdm_annotations_as_footnotekeys($cdmBase, $footnote_list_key);
|
|
114 | 114 |
foreach($footNoteKeys as $a){ |
115 | 115 |
//$out .= theme('cdm_footnote_key', $a, $a->footnoteListKey, (isset($out)? ',' : '')); |
116 | 116 |
$out .= theme('cdm_footnote_key', $a, (isset($out)? ',' : '')); |
... | ... | |
168 | 168 |
|
169 | 169 |
/* ============================ footnotes ============================= */ |
170 | 170 |
|
171 |
function theme_cdm_footnote_key($footnoteKey, $separator = '', $highlightable=true){ |
|
171 |
function theme_cdm_footnote_key($footnoteKey, $separator = '', $highlightable=true, $separator_off = false){
|
|
172 | 172 |
if (!$footnoteKey->footnoteListKey){ |
173 | 173 |
return ''; |
174 | 174 |
} |
175 |
if ($separator_off){ |
|
176 |
$separator = ''; |
|
177 |
} |
|
175 | 178 |
$out = '<span class="footnote-key footnote-key-'.$footnoteKey->keyStr.' member-of-footnotes-'.$footnoteKey->footnoteListKey.'">'.$separator |
176 | 179 |
.'<a href="#footnote-'.$footnoteKey->keyStr.'">'.$footnoteKey->keyStr.'</a>' |
177 | 180 |
.'</span>'; |
modules/cdm_dataportal/theme/cdm_dataportal.name.theme | ||
---|---|---|
70 | 70 |
if($typeDesignation->citation){ |
71 | 71 |
$out .= type_designation_citation_layout($typeDesignation); |
72 | 72 |
//footnotes |
73 |
$fkey_typeDesignation = FootnoteManager::addNewFootnote(RenderHints::getRenderPath() . '-typeDesignations-' . $typeDesignation->uuid, $typeDesignation->citation->titleCache); |
|
74 |
$out .= theme('cdm_footnote_key', $fkey_typeDesignation, $separator) . ')'; |
|
73 |
//$fkey_typeDesignation = FootnoteManager::addNewFootnote(RenderHints::getRenderPath() . '-typeDesignations-' . $typeDesignation->uuid, $typeDesignation->citation->titleCache); |
|
74 |
$fkey_typeDesignation = FootnoteManager::addNewFootnote(RenderHints::getRenderPath() . '-typeDesignations', $typeDesignation->citation->titleCache); |
|
75 |
$out .= theme('cdm_footnote_key', $fkey_typeDesignation, $separator, true, true) . ')'; |
|
75 | 76 |
} |
76 | 77 |
if($typeDesignation->typeName->nomenclaturalReference){ |
77 | 78 |
$referenceUri = url(path_to_reference($typeDesignation->typeName->nomenclaturalReference->uuid)); |
... | ... | |
132 | 133 |
if ($render_footnote_lectotypes){ |
133 | 134 |
$out .= theme('cdm_footnotes', RenderHints::getRenderPath() . '-lectotypes'); |
134 | 135 |
} |
135 |
$out .= theme('cdm_footnotes', RenderHints::getRenderPath() . '-acronyms'); |
|
136 |
|
|
136 |
$out .= theme('cdm_footnotes', RenderHints::getRenderPath() . '-acronyms', 'li');
|
|
137 |
$out .= theme('cdm_footnotes', RenderHints::getRenderPath() . '-typeDesignations', 'li'); |
|
137 | 138 |
//$out .= theme('cdm_footnotes', RenderHints::getRenderPath() . '-typeDesignations-' . $typeDesignation->uuid, 'li'); |
138 | 139 |
|
139 | 140 |
RenderHints::popFromRenderStack(); |
... | ... | |
277 | 278 |
RenderHints::pushToRenderStack('homotypicSynonymyGroup'); |
278 | 279 |
|
279 | 280 |
$footnoteListKey = isset($prependedSynonyms[0]) ? $prependedSynonyms[0]->uuid : (isset($synonymList[0]) ? $synonymList[0]->uuid : 'NULL'); |
281 |
$accepted_taxon_footnoteListKey = RenderHints::getFootnoteListKey(); |
|
280 | 282 |
RenderHints::setFootnoteListKey($footnoteListKey); |
281 | 283 |
|
282 | 284 |
if(! is_array($synonymList) || count($synonymList) == 0){ |
... | ... | |
300 | 302 |
$out .= theme('cdm_typedesignations', $typeDesignations); |
301 | 303 |
} |
302 | 304 |
|
305 |
$out .= theme('cdm_footnotes', $accepted_taxon_footnoteListKey, 'li'); |
|
303 | 306 |
$out .= theme('cdm_annotation_footnotes', $footnoteListKey, 'li'); |
304 | 307 |
$out .= '</ul>'; |
305 | 308 |
|
... | ... | |
475 | 478 |
} |
476 | 479 |
$out .= '</span>'; |
477 | 480 |
if ($show_annotations){ |
478 |
$out .= theme('cdm_annotations_as_footnotekeys', $taxonName); |
|
481 |
//$out .= theme('cdm_annotations_as_footnotekeys', $taxonName);
|
|
479 | 482 |
} |
480 | 483 |
return $out; |
481 | 484 |
} |
modules/cdm_dataportal/theme/cdm_dataportal.page.theme | ||
---|---|---|
221 | 221 |
$referenceUri = url(path_to_reference($taxon->name->nomenclaturalReference->uuid)); |
222 | 222 |
} |
223 | 223 |
$out .= theme('cdm_taxonName', $taxon->name, null, $referenceUri); |
224 |
$out .= theme('cdm_annotations_as_footnotekeys', $taxon); |
|
224 |
|
|
225 |
$special_annotations_array = array(); |
|
226 |
$special_annotations_array[] = $taxon->name; |
|
227 |
$special_annotations_array[] = $taxon; |
|
228 |
$out .= theme('cdm_annotations_as_footnotekeys', |
|
229 |
$special_annotations_array, |
|
230 |
RenderHints::getRenderPath() . '-annotations'); |
|
231 |
RenderHints::setFootnoteListKey(RenderHints::getRenderPath() . '-annotations'); |
|
225 | 232 |
} |
226 | 233 |
|
227 | 234 |
if($addAcceptedTaxon && !isset($synomymie->homotypicSynonymsByHomotypicGroup[0])){ |
... | ... | |
231 | 238 |
$out .= theme('cdm_typedesignations', $typeDesignations); |
232 | 239 |
} |
233 | 240 |
} else { |
234 |
// reder the homotypicSynonymyGroup including the type information |
|
241 |
// render the homotypicSynonymyGroup including the type information
|
|
235 | 242 |
$out .= theme('cdm_homotypicSynonymyGroup', $synomymie->homotypicSynonymsByHomotypicGroup); |
236 | 243 |
} |
237 | 244 |
|
... | ... | |
256 | 263 |
$out .= theme('cdm_taxonRelationships', $taxonRelationships); |
257 | 264 |
} |
258 | 265 |
|
259 |
RenderHints::popFromRenderStack();
|
|
260 |
|
|
266 |
RenderHints::popFromRenderStack(); |
|
267 |
|
|
261 | 268 |
return $out; |
262 | 269 |
} |
263 | 270 |
|
Also available in: Unified diff
footnotes changes, related with ticket #1984