Project

General

Profile

« Previous | Next » 

Revision df2eb131

Added by Andreas Kohlbecker about 4 years ago

ref #8771 unit test for significant figures of statistical values

View differences:

modules/cdm_dataportal/cdm_dataportal.module
2543 2543
  return $result->Integer;
2544 2544
}
2545 2545

  
2546
/**
2547
 * Composes an HTML element class attribute value composed of
2548
 * the short-name of the cdm class and the uuid of the entity.
2549
 * This class attribute should be used wherever an cdm-entity is rendered.
2550
 *
2551
 * In case of Taxon entities or TaxonNodeDTOs the secReference is also added
2552
 * to the class attributes as 'sec_uuid:<uuid>'. In case of TaxonNodeDTOs the
2553
 * Taxon uuid is added also as taxon_uuid:<uuid>
2554
 *
2555
 * These according class selectors in css must be escaped, eg:
2556
 *    .cdm\:TextData
2557
 *
2558
 * @param $cdm_entity
2559
 *    A CDM entity, TaxonNodeDTO or TypedEntityReference
2560
 */
2561
function html_class_attribute_ref($cdm_entity) {
2562

  
2563
  $attributes = '';
2564
  if (is_cdm_entity($cdm_entity)) {
2565
    $attributes =  "cdm:" . $cdm_entity->class . " uuid:" . $cdm_entity->uuid;
2566
  } else if($cdm_entity->class == 'TypedEntityReference') {
2567
    $attributes =  "cdm:" . $cdm_entity->type . " uuid:" . $cdm_entity->uuid;
2568
  }
2569
  if($cdm_entity->class == 'TaxonNodeDto'){
2570
    $attributes .= " taxon_uuid:"  . $cdm_entity->taxonUuid . " sec_uuid:"  . $cdm_entity->secUuid;;
2571
  }
2572
  if($cdm_entity->class == 'Taxon' && isset($cdm_entity->sec->uuid)){
2573
    $attributes .= " sec_uuid:"  . $cdm_entity->sec->uuid;
2574
  }
2575
  return $attributes;
2576
}
2577

  
2578

  
2579 2546
/**
2580 2547
 * Creates a short version of a taxonname.
2581 2548
 *

Also available in: Unified diff