Revision 7f36e33a
Added by Andreas Kohlbecker over 3 years ago
modules/cdm_dataportal/includes/descriptions.inc | ||
---|---|---|
1308 | 1308 |
$out = ''; |
1309 | 1309 |
$type_representation = NULL; |
1310 | 1310 |
$min_max = statistical_values_array(); |
1311 |
$other_values = []; |
|
1312 | 1311 |
$sample_size_markup = null; |
1313 | 1312 |
|
1314 | 1313 |
if (isset($element->statisticalValues)) { |
... | ... | |
1331 | 1330 |
$min_max[statistical_measure_term2min_max_key($statistical_val->type)] = $statistical_val; |
1332 | 1331 |
} |
1333 | 1332 |
else { |
1334 |
$other_values[] = $statistical_val;
|
|
1333 |
drupal_set_message("Unsupported statistical value type: " . $statistical_val->type->uuid, "error");
|
|
1335 | 1334 |
} |
1336 | 1335 |
} // end of loop over statisticalValues |
1337 | 1336 |
|
1338 | 1337 |
// create markup |
1339 |
|
|
1340 |
$min_max_markup = statistical_values($min_max); |
|
1341 |
|
|
1342 |
|
|
1343 |
foreach ($other_values as $statistical_val) { |
|
1344 |
$statistical_val_type_representation = NULL; |
|
1345 |
if (isset($statistical_val->type)) { |
|
1346 |
$statistical_val_type_representation = cdm_term_representation($statistical_val->type); |
|
1347 |
} |
|
1348 |
|
|
1349 |
$value_markup = ''; |
|
1350 |
$type_markup = ''; |
|
1351 |
switch (statistical_measure_term2min_max_key($statistical_val->type)){ |
|
1352 |
case 'SampleSize': |
|
1353 |
$sample_size_markup = '<span class="' . html_class_attribute_ref($statistical_val) . ' ' . $statistical_val->type->termType . ' ">' |
|
1354 |
. '[' . $statistical_val->_value . ']</span>'; |
|
1355 |
break; |
|
1356 |
case 'ExactValue': |
|
1357 |
$value_markup = '<span class="' . html_class_attribute_ref($statistical_val) . ' ' . $statistical_val->type->termType . ' ">' |
|
1358 |
. $statistical_val->_value . '</span>'; |
|
1359 |
break; |
|
1360 |
default: |
|
1361 |
$value_markup = '<span class="' . html_class_attribute_ref($statistical_val) . ' ' . $statistical_val->type->termType . ' ">' |
|
1362 |
. $statistical_val->_value . '</span>'; |
|
1363 |
$type_markup = ($statistical_val_type_representation ? ' <span class="type">' . $statistical_val_type_representation . '</span>' : ''); |
|
1364 |
} |
|
1365 |
if($value_markup){ |
|
1366 |
$other_values_markup[] = $value_markup . $type_markup; |
|
1367 |
} |
|
1338 |
$unit = null; |
|
1339 |
if (isset($element->unit)) { |
|
1340 |
$unit = ' <span class="unit" title="' |
|
1341 |
. cdm_term_representation($element->unit) . '">' |
|
1342 |
. cdm_term_representation_abbreviated($element->unit) |
|
1343 |
. '</span>'; |
|
1368 | 1344 |
} |
1369 |
|
|
1370 |
$other_values_markup = trim(implode($other_values_markup, ', ')); |
|
1371 |
$out .= $min_max_markup . ($other_values_markup ? $other_values_markup : ''); |
|
1372 |
$out .= '</span>'; |
|
1373 |
} |
|
1374 |
|
|
1375 |
if (isset($element->unit)) { |
|
1376 |
$out .= '<span class="unit" title="' |
|
1377 |
. cdm_term_representation($element->unit) . '">' |
|
1378 |
. cdm_term_representation_abbreviated($element->unit) |
|
1379 |
. '</span>'; |
|
1345 |
$min_max_markup = statistical_values($min_max, $unit); |
|
1346 |
$out .= $min_max_markup . '</span>'; |
|
1380 | 1347 |
} |
1381 | 1348 |
|
1382 | 1349 |
if($sample_size_markup){ |
Also available in: Unified diff
fix #8828 removing empty brackets from statistical values in QuantitativeData and cleaning up