1
|
<?php
|
2
|
/**
|
3
|
* @file
|
4
|
* Occurrence theming functions.
|
5
|
*
|
6
|
* @copyright
|
7
|
* (C) 2007-2012 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
|
|
16
|
/**
|
17
|
*
|
18
|
* @param string $field
|
19
|
*
|
20
|
*/
|
21
|
function cdm_occurrence_field_name_label($field){
|
22
|
|
23
|
static $field_labels = array(
|
24
|
'class' => 'Basis of Record',
|
25
|
'fieldNumber' => 'Collecting number',
|
26
|
'absoluteElevation' => 'Altitude',
|
27
|
'absoluteElevationMinimum' => 'Altitude maximum',
|
28
|
'absoluteElevationMaximum' => 'Altitude minimum',
|
29
|
'getGatheringPeriod' => 'Gathering period',
|
30
|
);
|
31
|
|
32
|
if (isset($field_labels[$field])) {
|
33
|
$field = $field_labels[$field];
|
34
|
}
|
35
|
|
36
|
$field = preg_replace_callback(
|
37
|
'/([a-z])([A-Z])/',
|
38
|
function ($m) {
|
39
|
return $m[1] . ' ' . strtolower ($m[2]);
|
40
|
},
|
41
|
$field);
|
42
|
|
43
|
return t('@field-name:', array('@field-name' => ucfirst($field)));
|
44
|
}
|
45
|
|
46
|
|