Project

General

Profile

« Previous | Next » 

Revision 5a079dbf

Added by Andreas Kohlbecker over 5 years ago

ref #2985 units in min max measures only at the end and after the error value

View differences:

modules/cdm_dataportal/includes/occurrences.inc
232 232

  
233 233

  
234 234
/**
235
 * Formats the given string to a label for displaying key-value pairs in HTML
235
 * Formats the given string to a label for displaying key-object pairs in HTML
236 236
 * @return string
237 237
 */
238 238
function create_label($label)
......
488 488
            @_description_list_group_add($groups, cdm_occurrence_field_name_label('country'), $value->country->representation_L10n);
489 489
            @_description_list_group_add($groups, cdm_occurrence_field_name_label('collectingMethod'), $value->collectingMethod);
490 490
            if (isset($value->absoluteElevation)) {
491
                $min_max_array = min_max_array();
492
                if(is_numeric($value->absoluteElevation)){
493
                    $min_max_array['Min'] = new stdClass();
494
                    $min_max_array['Min']->_value = $value->absoluteElevation . ' m';
495
                }
496
                if(is_numeric($value->absoluteElevation)){
497
                    $min_max_array['Max'] = new stdClass();
498
                    $min_max_array['Max']->_value = $value->absoluteElevationMax . ' m';
499
                }
500
                $min_max_markup = min_max_markup($min_max_array);
501
                if(isset($value->absoluteElevationError)){
502
                    $min_max_markup .= ' +/-' .  $value->absoluteElevationError . ' m';
503
                }
504
                if(is_string($value->absoluteElevationText)){
505
                    $min_max_markup .= ' ' . $value->absoluteElevationText;
506
                }
507
                @_description_list_group_add($groups, cdm_occurrence_field_name_label('absoluteElevation'), $min_max_markup);
491
              $min_max_markup = min_max_measure($value, 'absoluteElevation');
492
              @_description_list_group_add($groups, cdm_occurrence_field_name_label('absoluteElevation'), $min_max_markup);
508 493
            }
509 494
            if (isset($value->distanceToGround)) {
510
              $min_max_array = min_max_array();
511
              if(is_numeric($value->distanceToGround)){
512
                  $min_max_array['Min'] = new stdClass();
513
                  $min_max_array['Min']->_value = $value->distanceToGround . ' m';
514
              }
515
              if(is_numeric($value->distanceToGround)){
516
                  $min_max_array['Max'] = new stdClass();
517
                  $min_max_array['Max']->_value = $value->distanceToGroundMax . ' m';
518
              }
519
              $min_max_markup = min_max_markup($min_max_array);
520
              if(isset($value->distanceToGroundError)){
521
                  $min_max_markup .= ' +/-' .  $value->distanceToGroundError . ' m';
522
              }
523
              if(is_string($value->distanceToGroundText)){
524
                  $min_max_markup .= ' ' . $value->distanceToGroundText;
525
              }
495
              $min_max_markup = min_max_measure($value, 'distanceToGround');
526 496
              @_description_list_group_add($groups, cdm_occurrence_field_name_label('distanceToGround'), $min_max_markup);
527 497
            }
528 498
            if (isset($value->distanceToWaterSurface)) {
529
              $min_max_array = min_max_array();
530
              if(is_numeric($value->distanceToWaterSurface)){
531
                  $min_max_array['Min'] = new stdClass();
532
                  $min_max_array['Min']->_value = $value->distanceToWaterSurface . ' m';
533
              }
534
              if(is_numeric($value->distanceToWaterSurface)){
535
                  $min_max_array['Max'] = new stdClass();
536
                  $min_max_array['Max']->_value = $value->distanceToWaterSurfaceMax . ' m';
537
              }
538
              $min_max_markup = min_max_markup($min_max_array);
539
              if(isset($value->distanceToWaterSurfaceError)){
540
                  $min_max_markup .= ' +/-' .  $value->distanceToWaterSurfaceError . ' m';
541
              }
542
              if(is_string($value->distanceToWaterSurfaceText)){
543
                  $min_max_markup .= ' ' . $value->distanceToWaterSurfaceText;
544
              }
499
              $min_max_markup = min_max_measure($value, 'distanceToWaterSurface');
545 500
              @_description_list_group_add($groups, cdm_occurrence_field_name_label('distanceToWaterSurface'), $min_max_markup);
546 501
            }
547 502

  

Also available in: Unified diff