Project

General

Profile

« Previous | Next » 

Revision 553b0bcc

Added by Andreas Kohlbecker about 3 years ago

more generic html class attribute generation

View differences:

modules/cdm_dataportal/includes/common.inc
50 50

  
51 51
  $attributes = '';
52 52
  if (is_cdm_entity($cdm_entity)) {
53
    // Entities
53 54
    $attributes =  "cdm:" . $cdm_entity->class . " uuid:" . $cdm_entity->uuid;
54
  } elseif (isset($cdm_entity->class)) {
55 55
    switch ($cdm_entity->class){
56
      case 'TypedEntityReference':
57
      case 'TaggedEntityReference':
58
      case 'TypeDesignationDTO':
59
        $attributes =  "cdm:" . $cdm_entity->type . " uuid:" . $cdm_entity->uuid;
60
      break;
61
      case 'TaxonNodeDto':
62
        $attributes .= " taxon_uuid:"  . $cdm_entity->taxonUuid . " sec_uuid:"  . $cdm_entity->secUuid;;
63
      break;
64 56
      case 'Taxon':
65 57
        if(isset($cdm_entity->sec->uuid)){
66
        $attributes .= " sec_uuid:"  . $cdm_entity->sec->uuid;
67
      }
58
          $attributes .= " sec_uuid:"  . $cdm_entity->sec->uuid;
59
        }
60
        break;
61
    }
62
  } elseif (isset($cdm_entity->class)) {
63
    // DTOs
64
    if(isset_not_empty($cdm_entity->type) && isset_not_empty($cdm_entity->uuid)){
65
        $attributes =  "cdm:" . $cdm_entity->type . " uuid:" . $cdm_entity->uuid;
66
    }
67
    // additional data of specific DTOs
68
    switch ($cdm_entity->class){
69
      case 'TaxonNodeDto':
70
        $attributes .= "taxon_uuid:"  . $cdm_entity->taxonUuid . " sec_uuid:"  . $cdm_entity->secUuid;;
68 71
      break;
69 72
    }
70 73
  }

Also available in: Unified diff