Revision f19f47fa
Added by Andreas Kohlbecker about 9 years ago
7.x/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme | ||
---|---|---|
68 | 68 |
// Creating an array to place the description elements in. |
69 | 69 |
foreach ($mergedFeatureNodes as $node) { |
70 | 70 |
|
71 |
if (isset($node->descriptionElements['#type']) || hasFeatureNodeDescriptionElements($node)) {
|
|
71 |
if ((isset($node->descriptionElements['#type']) || has_feature_node_description_elements($node)) && $node->feature->uuid != UUID_IMAGE) {
|
|
72 | 72 |
|
73 |
$featureRepresentation = isset($node->feature->representation_L10n) ? $node->feature->representation_L10n : 'Feature'; |
|
74 |
$block = new stdclass(); // Empty object. |
|
75 |
$block->module = 'cdm_dataportal'; |
|
76 |
$media_list = array(); |
|
73 |
$feature_name = isset($node->feature->representation_L10n) ? $node->feature->representation_L10n : 'Feature'; |
|
77 | 74 |
|
78 |
if (true || $node->feature->uuid != UUID_IMAGE) {
|
|
75 |
$block = feature_block($feature_name, $node->feature);
|
|
79 | 76 |
|
80 |
$block->delta = generalizeString($featureRepresentation); |
|
81 |
$block->subject = '<span class="' . html_class_atttibute_ref($node->feature) . '">' . theme('cdm_feature_name', array('feature_name' => $featureRepresentation)) . '</span>'; |
|
82 |
$block->module = "cdm_dataportal-feature"; |
|
83 |
$block->content = ''; |
|
77 |
$media_list = array(); |
|
84 | 78 |
|
85 |
/*
|
|
86 |
* Content/DISTRIBUTION.
|
|
87 |
*/
|
|
88 |
if ($node->feature->uuid == UUID_DISTRIBUTION) {
|
|
79 |
/* |
|
80 |
* Content/DISTRIBUTION. |
|
81 |
*/ |
|
82 |
if ($node->feature->uuid == UUID_DISTRIBUTION) { |
|
89 | 83 |
|
90 |
$distributionElements = null;
|
|
91 |
$distribution_info_dto = null;
|
|
92 |
$text_data_out_array = array();
|
|
84 |
$distributionElements = null; |
|
85 |
$distribution_info_dto = null; |
|
86 |
$text_data_out_array = array(); |
|
93 | 87 |
|
94 |
$distribution_sortOutArray = FALSE;
|
|
95 |
if (variable_get('distribution_sort', 'NO_SORT') != 'NO_SORT') {
|
|
96 |
$distribution_glue = '';
|
|
97 |
$distribution_enclosingTag = 'dl';
|
|
98 |
}
|
|
99 |
else {
|
|
100 |
$distribution_glue = '';
|
|
101 |
$distribution_enclosingTag = 'ul';
|
|
102 |
}
|
|
88 |
$distribution_sortOutArray = FALSE; |
|
89 |
if (variable_get('distribution_sort', 'NO_SORT') != 'NO_SORT') { |
|
90 |
$distribution_glue = ''; |
|
91 |
$distribution_enclosingTag = 'dl'; |
|
92 |
} |
|
93 |
else { |
|
94 |
$distribution_glue = ''; |
|
95 |
$distribution_enclosingTag = 'ul'; |
|
96 |
} |
|
103 | 97 |
|
104 |
if(!isset($node->descriptionElements['#type']) || !$node->descriptionElements['#type']=='DTO') {
|
|
105 |
// skip the DISTRIBUTION section if there is no DTO type element
|
|
106 |
continue;
|
|
107 |
}
|
|
98 |
if(!isset($node->descriptionElements['#type']) || !$node->descriptionElements['#type']=='DTO') { |
|
99 |
// skip the DISTRIBUTION section if there is no DTO type element |
|
100 |
continue; |
|
101 |
} |
|
108 | 102 |
|
109 |
if(isset($node->descriptionElements['TextData'])){ |
|
110 |
// --- TextData |
|
111 |
foreach ($node->descriptionElements['TextData'] as $text_data_element){ |
|
112 |
$asListElement = FALSE; |
|
113 |
$repr = theme('cdm_descriptionElementTextData', array( |
|
114 |
'element' => $text_data_element, |
|
115 |
'asListElement' => $asListElement, |
|
116 |
'feature_uuid' => $text_data_element->feature->uuid, |
|
117 |
)); |
|
118 |
|
|
119 |
if (!array_search($repr, $text_data_out_array)) { |
|
120 |
$text_data_out_array[] = $repr; |
|
121 |
// TODO HINT: sorting in theme_cdm_descriptionElementArray will |
|
122 |
// not work since this array contains html attributes with uuids |
|
123 |
// !!!! |
|
124 |
$text_data_sortOutArray = TRUE; |
|
125 |
$text_data_glue = '<br/> '; |
|
126 |
$text_data_enclosingTag = 'p'; |
|
127 |
} |
|
103 |
if(isset($node->descriptionElements['TextData'])){ |
|
104 |
// --- TextData |
|
105 |
foreach ($node->descriptionElements['TextData'] as $text_data_element){ |
|
106 |
$asListElement = FALSE; |
|
107 |
$repr = theme('cdm_descriptionElementTextData', array( |
|
108 |
'element' => $text_data_element, |
|
109 |
'asListElement' => $asListElement, |
|
110 |
'feature_uuid' => $text_data_element->feature->uuid, |
|
111 |
)); |
|
112 |
|
|
113 |
if (!array_search($repr, $text_data_out_array)) { |
|
114 |
$text_data_out_array[] = $repr; |
|
115 |
// TODO HINT: sorting in theme_cdm_descriptionElementArray will |
|
116 |
// not work since this array contains html attributes with uuids |
|
117 |
// !!!! |
|
118 |
$text_data_sortOutArray = TRUE; |
|
119 |
$text_data_glue = '<br/> '; |
|
120 |
$text_data_enclosingTag = 'p'; |
|
128 | 121 |
} |
129 | 122 |
} |
123 |
} |
|
130 | 124 |
|
131 | 125 |
|
132 |
if ($text_data_out_array && variable_get(DISTRIBUTION_TEXTDATA_DISPLAY_ON_TOP, 0)) {
|
|
133 |
$block->content .= theme('cdm_descriptionElementArray', array(
|
|
134 |
'elementArray' => $text_data_out_array,
|
|
135 |
'feature' => $node->feature,
|
|
136 |
'glue' => $text_data_glue,
|
|
137 |
'sortArray' => $text_data_sortOutArray,
|
|
138 |
'enclosingHtml' => $text_data_enclosingTag,
|
|
139 |
));
|
|
140 |
}
|
|
126 |
if ($text_data_out_array && variable_get(DISTRIBUTION_TEXTDATA_DISPLAY_ON_TOP, 0)) { |
|
127 |
$block->content .= theme('cdm_descriptionElementArray', array( |
|
128 |
'elementArray' => $text_data_out_array, |
|
129 |
'feature' => $node->feature, |
|
130 |
'glue' => $text_data_glue, |
|
131 |
'sortArray' => $text_data_sortOutArray, |
|
132 |
'enclosingHtml' => $text_data_enclosingTag, |
|
133 |
)); |
|
134 |
} |
|
141 | 135 |
|
142 |
// --- Distribution map
|
|
143 |
$distribution_map_query_parameters = null;
|
|
144 |
if(isset($node->descriptionElements['DistributionInfoDTO'])) {
|
|
145 |
$distribution_map_query_parameters = $node->descriptionElements['DistributionInfoDTO']->mapUriParams;
|
|
146 |
}
|
|
147 |
$map_render_element = compose_distribution_map($taxon, $distribution_map_query_parameters);
|
|
148 |
$block->content .= $map_render_element['#markup'];
|
|
136 |
// --- Distribution map |
|
137 |
$distribution_map_query_parameters = null; |
|
138 |
if(isset($node->descriptionElements['DistributionInfoDTO'])) { |
|
139 |
$distribution_map_query_parameters = $node->descriptionElements['DistributionInfoDTO']->mapUriParams; |
|
140 |
} |
|
141 |
$map_render_element = compose_distribution_map($taxon, $distribution_map_query_parameters); |
|
142 |
$block->content .= $map_render_element['#markup']; |
|
149 | 143 |
|
150 |
// --- tree or list
|
|
151 |
$dto_out_array = array();
|
|
152 |
if(isset($node->descriptionElements['DistributionInfoDTO'])) {
|
|
153 |
$distribution_info_dto = $node->descriptionElements['DistributionInfoDTO'];
|
|
144 |
// --- tree or list |
|
145 |
$dto_out_array = array(); |
|
146 |
if(isset($node->descriptionElements['DistributionInfoDTO'])) { |
|
147 |
$distribution_info_dto = $node->descriptionElements['DistributionInfoDTO']; |
|
154 | 148 |
|
155 |
// --- tree
|
|
156 |
if (is_object($distribution_info_dto->tree)) {
|
|
157 |
$dto_out_array[] = theme('cdm_description_ordered_distributions', array('distribution_tree' => $distribution_info_dto->tree));
|
|
158 |
}
|
|
149 |
// --- tree |
|
150 |
if (is_object($distribution_info_dto->tree)) { |
|
151 |
$dto_out_array[] = theme('cdm_description_ordered_distributions', array('distribution_tree' => $distribution_info_dto->tree)); |
|
152 |
} |
|
159 | 153 |
|
160 |
// --- sorted element list |
|
161 |
if( is_array($distribution_info_dto->elements) && count($distribution_info_dto->elements) > 0 ) { |
|
162 |
foreach ($distribution_info_dto->elements as $descriptionElement){ |
|
163 |
if (is_object($descriptionElement->area)) { |
|
164 |
$sortKey = $descriptionElement->area->representation_L10n; |
|
165 |
$distributionElements[$sortKey] = $descriptionElement; |
|
166 |
} |
|
154 |
// --- sorted element list |
|
155 |
if( is_array($distribution_info_dto->elements) && count($distribution_info_dto->elements) > 0 ) { |
|
156 |
foreach ($distribution_info_dto->elements as $descriptionElement){ |
|
157 |
if (is_object($descriptionElement->area)) { |
|
158 |
$sortKey = $descriptionElement->area->representation_L10n; |
|
159 |
$distributionElements[$sortKey] = $descriptionElement; |
|
167 | 160 |
} |
168 |
ksort($distributionElements); |
|
169 |
$dto_out_array[] = theme('cdm_descriptionElement_Distribution', array( |
|
170 |
'descriptionElements' => $distributionElements, |
|
171 |
)); |
|
172 |
|
|
173 | 161 |
} |
174 |
// |
|
175 |
$block->content .= theme('cdm_descriptionElementArray', array( |
|
176 |
'elementArray' => $dto_out_array, |
|
177 |
'feature' => $node->feature, |
|
178 |
'glue' => $distribution_glue, |
|
179 |
'sortArray' => $distribution_sortOutArray, |
|
180 |
'enclosingHtml' => $distribution_enclosingTag, |
|
162 |
ksort($distributionElements); |
|
163 |
$dto_out_array[] = theme('cdm_descriptionElement_Distribution', array( |
|
164 |
'descriptionElements' => $distributionElements, |
|
181 | 165 |
)); |
182 |
} |
|
183 | 166 |
|
184 |
// --- TextData at the bottom |
|
185 |
if ($text_data_out_array && !variable_get(DISTRIBUTION_TEXTDATA_DISPLAY_ON_TOP, 0)) { |
|
186 |
$block->content .= theme('cdm_descriptionElementArray', array( |
|
187 |
'elementArray' => $text_data_out_array, |
|
188 |
'feature' => $node->feature, |
|
189 |
'glue' => $text_data_glue, |
|
190 |
'sortArray' => $text_data_sortOutArray, |
|
191 |
'enclosingHtml' => $text_data_enclosingTag, |
|
192 |
)); |
|
193 | 167 |
} |
194 |
|
|
168 |
// |
|
169 |
$block->content .= theme('cdm_descriptionElementArray', array( |
|
170 |
'elementArray' => $dto_out_array, |
|
171 |
'feature' => $node->feature, |
|
172 |
'glue' => $distribution_glue, |
|
173 |
'sortArray' => $distribution_sortOutArray, |
|
174 |
'enclosingHtml' => $distribution_enclosingTag, |
|
175 |
)); |
|
195 | 176 |
} |
196 | 177 |
|
197 |
/* |
|
198 |
* Content/COMMON_NAME. |
|
199 |
*/ |
|
200 |
elseif ($node->feature->uuid == UUID_COMMON_NAME) { |
|
201 |
// TODO why is theme_cdm_descriptionElement_CommonTaxonName not |
|
202 |
// beeing used??? |
|
203 |
$block->content .= theme('cdm_common_names', array('elements' => $node->descriptionElements)); |
|
204 |
/* |
|
205 |
}else if($node->feature->uuid == UUID_IMAGE_SOURCES) { |
|
206 |
$block->content .= theme('cdm_image_sources', |
|
207 |
$node->descriptionElements); |
|
208 |
*/ |
|
178 |
// --- TextData at the bottom |
|
179 |
if ($text_data_out_array && !variable_get(DISTRIBUTION_TEXTDATA_DISPLAY_ON_TOP, 0)) { |
|
180 |
$block->content .= theme('cdm_descriptionElementArray', array( |
|
181 |
'elementArray' => $text_data_out_array, |
|
182 |
'feature' => $node->feature, |
|
183 |
'glue' => $text_data_glue, |
|
184 |
'sortArray' => $text_data_sortOutArray, |
|
185 |
'enclosingHtml' => $text_data_enclosingTag, |
|
186 |
)); |
|
209 | 187 |
} |
210 | 188 |
|
189 |
} |
|
190 |
|
|
191 |
/* |
|
192 |
* Content/COMMON_NAME. |
|
193 |
*/ |
|
194 |
elseif ($node->feature->uuid == UUID_COMMON_NAME) { |
|
195 |
// TODO why is theme_cdm_descriptionElement_CommonTaxonName not |
|
196 |
// beeing used??? |
|
197 |
$block->content .= theme('cdm_common_names', array('elements' => $node->descriptionElements)); |
|
211 | 198 |
/* |
212 |
* Content/ALL OTHER FEATURES. |
|
213 |
*/ |
|
214 |
else { |
|
215 |
if (isset($node->descriptionElements)) { |
|
216 |
$taxon_uuid = NULL; |
|
217 |
if(isset($taxon) ) { |
|
218 |
$taxon_uuid = $taxon->uuid; |
|
219 |
} |
|
220 |
$block->content .= theme('cdm_descriptionElements', array( |
|
221 |
'descriptionElements' => $node->descriptionElements, |
|
222 |
'feature' => $node->feature, |
|
223 |
'taxon_uuid' => $taxon_uuid, |
|
224 |
)); |
|
199 |
}else if($node->feature->uuid == UUID_IMAGE_SOURCES) { |
|
200 |
$block->content .= theme('cdm_image_sources', |
|
201 |
$node->descriptionElements); |
|
202 |
*/ |
|
203 |
} |
|
204 |
|
|
205 |
/* |
|
206 |
* Content/ALL OTHER FEATURES. |
|
207 |
*/ |
|
208 |
else { |
|
209 |
if (isset($node->descriptionElements)) { |
|
210 |
$taxon_uuid = NULL; |
|
211 |
if(isset($taxon) ) { |
|
212 |
$taxon_uuid = $taxon->uuid; |
|
225 | 213 |
} |
214 |
$block->content .= theme('cdm_descriptionElements', array( |
|
215 |
'descriptionElements' => $node->descriptionElements, |
|
216 |
'feature' => $node->feature, |
|
217 |
'taxon_uuid' => $taxon_uuid, |
|
218 |
)); |
|
219 |
} |
|
226 | 220 |
|
227 | 221 |
// Content/ALL OTHER FEATURES/Subordinate Features |
228 | 222 |
// subordinate features are printed inline in one floating text, |
229 | 223 |
// it is expected hat supordinate features can "contain" TextData, |
230 | 224 |
// Qualitative- and Qualitative- DescriptioneElements |
231 |
if (isset($node->childNodes[0])) { |
|
232 |
|
|
233 |
// TODO support more than one level of children. |
|
234 |
// can this be solved by resursively calling this very function? |
|
235 |
// @see http://dev.e-taxonomy.eu/trac/ticket/2393 |
|
236 |
$text = ''; |
|
237 |
foreach ($node->childNodes as $child) { |
|
238 |
|
|
239 |
if (isset($child->descriptionElements) && is_array($child->descriptionElements)) { |
|
240 |
foreach ($child->descriptionElements as $element) { |
|
241 |
|
|
242 |
if (is_array($element->media)) { |
|
243 |
// Append media of supordinate elements to list of main |
|
244 |
// feature. |
|
245 |
$media_list = array_merge($media_list, $element->media); |
|
246 |
} |
|
247 |
|
|
248 |
switch ($element->class) { |
|
249 |
case 'TextData': |
|
250 |
// TODO use theme_cdm_descriptionElementTextData() |
|
251 |
$out_child_elements = str_replace("\n", "<br/>", $element->multilanguageText_L10n->text); |
|
252 |
$out_child_elements = str_replace($child->feature->titleCache, '<em>' . $child->feature->representation_L10n . '</em>', $out_child_elements); |
|
253 |
break; |
|
254 |
case 'CategoricalData': |
|
255 |
$out_child_elements = '<em>' . $child->feature->representation_L10n . '</em> ' |
|
256 |
. theme('cdm_descriptionElement_CategoricalData', array('element' => $element)); |
|
257 |
break; |
|
258 |
case 'QuantitativeData': |
|
259 |
$out_child_elements = '<em>' . $child->feature->representation_L10n . '</em> ' |
|
260 |
. theme('cdm_descriptionElement_QuantitativeData', array('element' => $element)); |
|
261 |
|
|
262 |
} |
|
225 |
if (isset($node->childNodes[0])) { |
|
226 |
|
|
227 |
// TODO support more than one level of children. |
|
228 |
// can this be solved by resursively calling this very function? |
|
229 |
// @see http://dev.e-taxonomy.eu/trac/ticket/2393 |
|
230 |
$text = ''; |
|
231 |
foreach ($node->childNodes as $child) { |
|
232 |
|
|
233 |
if (isset($child->descriptionElements) && is_array($child->descriptionElements)) { |
|
234 |
foreach ($child->descriptionElements as $element) { |
|
263 | 235 |
|
236 |
if (is_array($element->media)) { |
|
237 |
// Append media of supordinate elements to list of main |
|
238 |
// feature. |
|
239 |
$media_list = array_merge($media_list, $element->media); |
|
264 | 240 |
} |
265 |
$text .= " " . $out_child_elements; |
|
266 |
$out_child_elements = ''; |
|
241 |
|
|
242 |
switch ($element->class) { |
|
243 |
case 'TextData': |
|
244 |
// TODO use theme_cdm_descriptionElementTextData() |
|
245 |
$out_child_elements = str_replace("\n", "<br/>", $element->multilanguageText_L10n->text); |
|
246 |
$out_child_elements = str_replace($child->feature->titleCache, '<em>' . $child->feature->representation_L10n . '</em>', $out_child_elements); |
|
247 |
break; |
|
248 |
case 'CategoricalData': |
|
249 |
$out_child_elements = '<em>' . $child->feature->representation_L10n . '</em> ' |
|
250 |
. theme('cdm_descriptionElement_CategoricalData', array('element' => $element)); |
|
251 |
break; |
|
252 |
case 'QuantitativeData': |
|
253 |
$out_child_elements = '<em>' . $child->feature->representation_L10n . '</em> ' |
|
254 |
. theme('cdm_descriptionElement_QuantitativeData', array('element' => $element)); |
|
255 |
|
|
256 |
} |
|
257 |
|
|
267 | 258 |
} |
259 |
$text .= " " . $out_child_elements; |
|
260 |
$out_child_elements = ''; |
|
268 | 261 |
} |
269 |
$block->content .= $text; |
|
270 | 262 |
} |
263 |
$block->content .= $text; |
|
271 | 264 |
} |
265 |
} |
|
272 | 266 |
|
273 |
/* |
|
274 |
* Media/ALL FEATURES. |
|
275 |
*/ |
|
276 |
if (isset($node->descriptionElements)) { |
|
277 |
$media_list = array_merge($media_list, cdm_dataportal_media_from_descriptionElements($node->descriptionElements)); |
|
278 |
} |
|
279 |
$captionElements = array('title', 'rights'); |
|
280 |
$gallery = ''; |
|
281 |
if (isset($gallery_settings['cdm_dataportal_media_maxextend']) && isset($gallery_settings['cdm_dataportal_media_cols'])) { |
|
282 |
$gallery = theme('cdm_media_gallerie', array( |
|
283 |
'mediaList' => $media_list, |
|
284 |
'galleryName' => CDM_DATAPORTAL_DESCRIPTION_GALLERY_NAME . '_' . $node->feature->uuid, |
|
285 |
'maxExtend' => $gallery_settings['cdm_dataportal_media_maxextend'], |
|
286 |
'cols' => $gallery_settings['cdm_dataportal_media_cols'], |
|
287 |
'captionElements' => $captionElements, |
|
288 |
)); |
|
289 |
} |
|
290 |
$block->content .= $gallery; |
|
291 |
$block->content .= theme('cdm_footnotes', array('footnoteListKey' => $node->feature->uuid)); |
|
292 |
$block->content .= theme('cdm_annotation_footnotes', array('footnoteListKey' => $node->feature->uuid)); |
|
293 |
|
|
294 |
// Add anchor to subject. |
|
295 |
$block->subject = '<a name="' . $block->delta . '"></a>' . $block->subject; |
|
296 |
|
|
297 |
// In D6: $out .= theme('block', $block); |
|
298 |
// Comment @WA @TODO check if need to set a region, and which one. |
|
299 |
$block->region = FALSE; |
|
300 |
$out .= theme('block', array('elements' => array( |
|
301 |
'#block' => $block, |
|
302 |
'#children' => $block->content, |
|
303 |
))); |
|
267 |
/* |
|
268 |
* Media/ALL FEATURES. |
|
269 |
*/ |
|
270 |
if (isset($node->descriptionElements)) { |
|
271 |
$media_list = array_merge($media_list, cdm_dataportal_media_from_descriptionElements($node->descriptionElements)); |
|
272 |
} |
|
273 |
$captionElements = array('title', 'rights'); |
|
274 |
$gallery = ''; |
|
275 |
if (isset($gallery_settings['cdm_dataportal_media_maxextend']) && isset($gallery_settings['cdm_dataportal_media_cols'])) { |
|
276 |
$gallery = theme('cdm_media_gallerie', array( |
|
277 |
'mediaList' => $media_list, |
|
278 |
'galleryName' => CDM_DATAPORTAL_DESCRIPTION_GALLERY_NAME . '_' . $node->feature->uuid, |
|
279 |
'maxExtend' => $gallery_settings['cdm_dataportal_media_maxextend'], |
|
280 |
'cols' => $gallery_settings['cdm_dataportal_media_cols'], |
|
281 |
'captionElements' => $captionElements, |
|
282 |
)); |
|
304 | 283 |
} |
284 |
$block->content .= $gallery; |
|
285 |
$block->content .= theme('cdm_footnotes', array('footnoteListKey' => $node->feature->uuid)); |
|
286 |
$block->content .= theme('cdm_annotation_footnotes', array('footnoteListKey' => $node->feature->uuid)); |
|
287 |
|
|
288 |
// In D6: $out .= theme('block', $block); |
|
289 |
// Comment @WA @TODO check if need to set a region, and which one. |
|
290 |
$block->region = FALSE; |
|
291 |
$out .= theme('block', |
|
292 |
array( |
|
293 |
'elements' => array( |
|
294 |
'#block' => $block, |
|
295 |
'#children' => $block->content, |
|
296 |
) |
|
297 |
) |
|
298 |
); |
|
305 | 299 |
} |
306 | 300 |
} |
307 | 301 |
RenderHints::popFromRenderStack(); |
308 | 302 |
return $out; |
309 | 303 |
} |
310 | 304 |
|
305 |
|
|
306 |
|
|
311 | 307 |
/** |
312 | 308 |
* @todo Please document this function. |
313 | 309 |
* @see http://drupal.org/node/1354 |
... | ... | |
400 | 396 |
*/ |
401 | 397 |
function theme_cdm_descriptionElement_CommonTaxonName($variables) { |
402 | 398 |
$element = $variables['element']; |
403 |
$out = '<span class="' . html_class_atttibute_ref($element) . '">' . $element->language->representation_L10n . ' (' . $element->area->titleCache . '): ' . $element->name . '</span>';
|
|
399 |
$out = '<span class="' . html_class_attribute_ref($element) . '">' . $element->language->representation_L10n . ' (' . $element->area->titleCache . '): ' . $element->name . '</span>';
|
|
404 | 400 |
return $out; |
405 | 401 |
} |
406 | 402 |
|
... | ... | |
440 | 436 |
|
441 | 437 |
$footnote_key_list_str = cdm_create_description_element_footnotes($element); |
442 | 438 |
|
443 |
$out = '<span class="' . html_class_atttibute_ref($element) . '">' . implode(', ', $state_data_strings) . '</span>';
|
|
439 |
$out = '<span class="' . html_class_attribute_ref($element) . '">' . implode(', ', $state_data_strings) . '</span>';
|
|
444 | 440 |
return $out . $footnote_key_list_str; |
445 | 441 |
} |
446 | 442 |
|
... | ... | |
484 | 480 |
$out .= implode($value_array, ', '); |
485 | 481 |
} |
486 | 482 |
|
487 |
if (isset($element->unit)) {
|
|
488 |
$out .= ' '. cdm_term_representation($element->unit);
|
|
483 |
if (isset($element->unit)) { |
|
484 |
$out .= ' '. cdm_term_representation($element->unit); |
|
489 | 485 |
} |
490 | 486 |
|
491 | 487 |
if (isset($element->statisticalValues->modifyingText_L10n)) { |
... | ... | |
715 | 711 |
// Adding footnotes sources. |
716 | 712 |
foreach ($element->sources as $source) { |
717 | 713 |
if (_is_original_source_type($source)) { |
718 |
$_fkey = FootnoteManager::addNewFootnote(UUID_COMMON_NAME, theme('cdm_OriginalSource', array('source' => $source, 'doLink' => FALSE)));
|
|
714 |
$_fkey = FootnoteManager::addNewFootnote(original_source_footnote_list_key(UUID_COMMON_NAME), theme('cdm_OriginalSource', array('source' => $source, 'doLink' => FALSE)));
|
|
719 | 715 |
$sourcesFootnoteKeyList .= theme('cdm_footnote_key', array('footnoteKey' => $_fkey, 'separator' => ($sourcesFootnoteKeyList ? $separator : ''))); |
720 | 716 |
} |
721 | 717 |
} |
722 | 718 |
if ($element->name) { |
723 |
$rendered_element_list .= '<span class="' . html_class_atttibute_ref($element) . '">' . (strlen($rendered_element_list) > 0 ? ', ' : '') . $element->name . $sourcesFootnoteKeyList . '</span>';
|
|
719 |
$rendered_element_list .= '<span class="' . html_class_attribute_ref($element) . '">' . (strlen($rendered_element_list) > 0 ? ', ' : '') . $element->name . $sourcesFootnoteKeyList . '</span>';
|
|
724 | 720 |
} |
725 | 721 |
} |
726 | 722 |
if ($key) { |
... | ... | |
841 | 837 |
case 'CategoricalData': |
842 | 838 |
$outArray[] = theme('cdm_descriptionElement_CategoricalData', array('element' => $descriptionElement)); |
843 | 839 |
break; |
844 |
case 'QuantitativeData':
|
|
845 |
$outArray[] = theme('cdm_descriptionElement_QuantitativeData', array('element' => $descriptionElement));
|
|
840 |
case 'QuantitativeData': |
|
841 |
$outArray[] = theme('cdm_descriptionElement_QuantitativeData', array('element' => $descriptionElement)); |
|
846 | 842 |
break; |
847 | 843 |
case 'IndividualsAssociation': |
848 | 844 |
$outArray[] = theme('cdm_descriptionElement_IndividualsAssociation', array('element' => $descriptionElement)); |
... | ... | |
913 | 909 |
$footNoteKeys = cdm_annotations_as_footnotekeys($image_source); |
914 | 910 |
foreach ($image_source->sources as $source) { |
915 | 911 |
if (_is_original_source_type($source)) { |
916 |
$fn_key = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), theme('cdm_OriginalSource', array(
|
|
912 |
$fn_key = FootnoteManager::addNewFootnote(original_source_footnote_list_key(), theme('cdm_OriginalSource', array(
|
|
917 | 913 |
'source' => $source, |
918 | 914 |
'doLink' => FALSE, |
919 | 915 |
))); |
... | ... | |
1029 | 1025 |
foreach ($element_level3->data as $description_level3){ |
1030 | 1026 |
foreach ($description_level3->sources as $source) { |
1031 | 1027 |
if (_is_original_source_type($source)) { |
1032 |
$fn_key3 = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), theme('cdm_OriginalSource', array('source' => $source, 'doLink' => FALSE)));
|
|
1028 |
$fn_key3 = FootnoteManager::addNewFootnote(original_source_footnote_list_key(), theme('cdm_OriginalSource', array('source' => $source, 'doLink' => FALSE)));
|
|
1033 | 1029 |
cdm_add_footnote_to_array($fnKeysLevel3, $fn_key3); |
1034 | 1030 |
} |
1035 | 1031 |
} |
... | ... | |
1047 | 1043 |
foreach ($description_level4->sources as $source) { |
1048 | 1044 |
if (_is_original_source_type($source)) { |
1049 | 1045 |
$fn_key4 = FootnoteManager::addNewFootnote( |
1050 |
RenderHints::getFootnoteListKey(),
|
|
1046 |
original_source_footnote_list_key(),
|
|
1051 | 1047 |
theme('cdm_OriginalSource', array('source' => $source, 'doLink' => FALSE))); |
1052 | 1048 |
cdm_add_footnote_to_array($fnKeysLevel4, $fn_key4); |
1053 | 1049 |
} |
Also available in: Unified diff
basic implementation of #4314 (taxon page: display of bibliography in a block on the taxon page)