Revision 614b1592
Added by Andreas Kohlbecker over 13 years ago
modules/cdm_dataportal/theme/cdm_dataportal.occurrence.theme | ||
---|---|---|
3 | 3 |
|
4 | 4 |
/** |
5 | 5 |
* Copyright (C) 2007 EDIT |
6 |
* European Distributed Institute of Taxonomy
|
|
6 |
* European Distributed Institute of Taxonomy |
|
7 | 7 |
* http://www.e-taxonomy.eu |
8 |
*
|
|
8 |
* |
|
9 | 9 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
10 | 10 |
* See http://www.mozilla.org/MPL/MPL-1.1.html for the full license terms. |
11 | 11 |
*/ |
12 | 12 |
|
13 | 13 |
/** |
14 |
*
|
|
14 |
* |
|
15 | 15 |
* @param $specimenTypeDesignation |
16 | 16 |
* @return unknown_type |
17 | 17 |
*/ |
18 | 18 |
function theme_cdm_specimen($specimenTypeDesignation){ |
19 | 19 |
|
20 | 20 |
// _add_js_thickbox(); |
21 |
|
|
21 |
|
|
22 | 22 |
if($specimenTypeDesignation->typeSpecimen){ |
23 | 23 |
$derivedUnitFacade = cdm_ws_get(CDM_WS_DERIVEDUNIT_FACADE, $specimenTypeDesignation->typeSpecimen->uuid); |
24 | 24 |
} |
... | ... | |
84 | 84 |
} |
85 | 85 |
return $out; |
86 | 86 |
} |
87 |
|
|
88 |
function theme_cdm_derivedUnitFacade($derivedUnitFacade){ |
|
89 |
|
|
90 |
static $excludeFields = array('class', 'titleCache', 'derivedUnitMedia'); |
|
91 |
|
|
92 |
if(is_object($derivedUnitFacade)){ |
|
93 |
$out = '<dl>'; |
|
94 |
foreach (get_object_vars($derivedUnitFacade) as $field=>$value){ |
|
95 |
if(!in_array($field, $excludeFields) && ($value && (!is_object($value) || isset($value->class) ))){ |
|
96 |
switch($field){ |
|
97 |
case 'locality': $stringValue = $value->language->representation_L10n; break; |
|
98 |
case 'country' : $stringValue = $value->representation_L10n; break; |
|
99 |
case 'collector': |
|
100 |
case 'collection' : $stringValue = $value->titleCache; break; |
|
101 |
case 'exactLocation': |
|
102 |
if($value->referenceSystem){ |
|
103 |
//TODO .... |
|
104 |
$stringValue = $value->latitude .', '.$value->longitude; |
|
105 |
} else { |
|
106 |
$stringValue = $value->latitude .', '.$value->longitude; |
|
107 |
} |
|
108 |
|
|
109 |
break; |
|
110 |
default: $stringValue = $value; |
|
111 |
} |
|
112 |
$out .= '<dt>' . $field . '</dt><dd>' . $stringValue . '</dd>'; |
|
113 |
} |
|
114 |
} |
|
115 |
$out .= '</dl>'; |
|
116 |
} |
|
117 |
return $out; |
|
118 |
} |
Also available in: Unified diff
details on specimens