Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

cdm-dataportal / modules / cdm_dataportal / theme / cdm_dataportal.occurrence.theme @ f41c2b5e

History | View | Annotate | Download (1.01 KB)

1 6657531f Andreas Kohlbecker
<?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 c4f1eee9 Andreas Kohlbecker
 *
18 f15267b0 Andreas Kohlbecker
 * @param string $field
19 f1f05758 Andreas Kohlbecker
 *
20 c4f1eee9 Andreas Kohlbecker
 */
21
function cdm_occurrence_field_name_label($field){
22
23 d2a09415 Andreas Kohlbecker
  static $field_labels = array(
24
      'class' => 'Basis of Record',
25 4186a152 Katja Luther
      'fieldNumber' => 'Collecting number',
26 d2a09415 Andreas Kohlbecker
      'absoluteElevation' => 'Altitude',
27
      'absoluteElevationMinimum' => 'Altitude maximum',
28
      'absoluteElevationMaximum' => 'Altitude minimum',
29
      'getGatheringPeriod' => 'Gathering period',
30 c4f1eee9 Andreas Kohlbecker
  );
31 696b4219 Andreas Kohlbecker
32 d2a09415 Andreas Kohlbecker
  if (isset($field_labels[$field])) {
33
    $field = $field_labels[$field];
34 c4f1eee9 Andreas Kohlbecker
  }
35 696b4219 Andreas Kohlbecker
36 7abe6011 Andreas Kohlbecker
  $field = preg_replace_callback(
37
      '/([a-z])([A-Z])/',
38
      function ($m) {
39
        return $m[1] . ' ' . strtolower ($m[2]);
40
      },
41
      $field);
42 94544c00 Andreas Kohlbecker
43 88e8a1fe Andreas Kohlbecker
  return t('@field-name:', array('@field-name' => ucfirst($field)));
44 6657531f Andreas Kohlbecker
}
45 c4f1eee9 Andreas Kohlbecker
Add picture from clipboard (Maximum size: 40 MB)