1
|
<?php
|
2
|
/**
|
3
|
* @file
|
4
|
* Extensions to the cdm dataportal module specific for the Palmweb project
|
5
|
*
|
6
|
* @copyright
|
7
|
* (C) 2007-2013 EDIT
|
8
|
* European Distributed Institute of Taxonomy
|
9
|
* http://www.e-taxonomy.eu
|
10
|
*
|
11
|
* The contents of this module are subject to the Mozilla
|
12
|
* Public License Version 1.1.
|
13
|
* @see http://www.mozilla.org/MPL/MPL-1.1.html
|
14
|
*
|
15
|
* @author
|
16
|
* - Andreas Kohlbecker <a.kohlbecker@BGBM.org>
|
17
|
* - Alex Theys
|
18
|
*/
|
19
|
|
20
|
|
21
|
/**
|
22
|
* Implements hook_cdm_feature_node_blocks_alter()
|
23
|
*
|
24
|
*
|
25
|
##### DISABLED AS THERE IS NO DIFFERENCE TO hook_cdm_feature_node_blocks_alter()
|
26
|
function palmweb_cdm_feature_node_blocks_alter(&$block_list, $taxon) {
|
27
|
|
28
|
if ($taxon) {
|
29
|
// taxon is only given if called from within the taxon general page part
|
30
|
$numberOfChildren = count(cdm_ws_get(CDM_WS_PORTAL_TAXONOMY_CHILDNODES_OF_TAXON, [
|
31
|
get_current_classification_uuid(),
|
32
|
$taxon->uuid,
|
33
|
]));
|
34
|
$subRank = 'sub taxa';
|
35
|
if ($taxon->name->rank->titleCache == "Genus") {
|
36
|
$subRank = "species";
|
37
|
}
|
38
|
else {
|
39
|
if ($taxon->name->rank->titleCache == "Species") {
|
40
|
if ($numberOfChildren == 1) {
|
41
|
$subRank = "infraspecific taxon";
|
42
|
}
|
43
|
else {
|
44
|
$subRank = "infraspecific taxa";
|
45
|
}
|
46
|
}
|
47
|
}
|
48
|
if ($numberOfChildren > 0) {
|
49
|
$feature_num_of_taxa = make_pseudo_feature('Number of Taxa', PSEUDO_FEATURE_BIBLIOGRAPHY);
|
50
|
$block = feature_block(t('Number of Taxa'), $feature_num_of_taxa);
|
51
|
$block->content[] = compose_feature_block_wrap_elements([
|
52
|
markup_to_render_array(
|
53
|
'<ul class="feature-block-elements"><li>'
|
54
|
. $numberOfChildren . " " . $subRank
|
55
|
. '</li></ul>'),
|
56
|
]
|
57
|
, $feature_num_of_taxa);
|
58
|
array_unshift($block_list, $block);
|
59
|
cdm_toc_list_add_item('Number of Taxa', 'number-of-taxa', NULL, TRUE);
|
60
|
}
|
61
|
}
|
62
|
|
63
|
return $block_list;
|
64
|
}
|
65
|
*/
|