Project

General

Profile

« Previous | Next » 

Revision 204e8173

Added by Andreas Kohlbecker about 5 years ago

ref #7977 better specimen type representation in registration page:

  • citation and detail for media specimens
  • kind of type shown
  • persistent identifier as link
  • media url as image in gallery

View differences:

modules/cdm_dataportal/cdm_dataportal.css
793 793
  padding-left: 2em;
794 794
}
795 795

  
796
/*
797
 * ======= Regisrtration page =======
798
 */
799

  
800
.registration .specimen_type_designation .media_gallery {
801
    margin-left: 2em;
802
}
796 803
/*
797 804
 * ======= Experts =======
798 805
 */
modules/cdm_dataportal/includes/name.inc
600 600
 * @ingroup compose
601 601
 */
602 602
function compose_specimen_type_designations($type_entity_refs){
603

  
603 604
  $render_array = array();
605

  
604 606
  foreach($type_entity_refs as $type_status => $specimen_type){
605 607
    $type_designation = cdm_ws_get(CDM_TYPEDESIGNATION, array($specimen_type->uuid));
608

  
606 609
    $preferredStableUri = '';
610
    $citation_markup = '';
611
    $media = '';
612

  
613
    // preferredStableUri
607 614
    if(isset($type_designation->typeSpecimen->preferredStableUri) && $type_designation->typeSpecimen->preferredStableUri){
608 615
      $preferredStableUri = $type_designation->typeSpecimen->preferredStableUri;
609 616
    }
610
    $render_array[] = markup_to_render_array('<div class="specimen_type_designation ' . html_class_attribute_ref($specimen_type)  . '"><span class="type_status">'
611
      . ucfirst($type_status)
612
      . "</span>: "
617

  
618
    $mediaSpecimen = cdm_ws_get(CDM_WS_PORTAL_OCCURRENCE, array($type_designation->typeSpecimen->uuid, 'mediaSpecimen'));
619
    if($mediaSpecimen){
620
      // compose output
621
      // mediaURI
622
      if(isset($mediaSpecimen->representations[0])) {
623
        $gallery_settings = getGallerySettings(CDM_DATAPORTAL_SPECIMEN_GALLERY_NAME);
624
        $captionElements = array(
625
          '#uri' => t('open media'),
626
          'elements' => array('-none-'),
627
          'sources_as_content' => true
628
        );
629
        $media = compose_cdm_media_gallerie(array(
630
          'mediaList' => array($mediaSpecimen),
631
          'galleryName' => CDM_DATAPORTAL_TYPE_SPECIMEN_GALLERY_NAME . '_' . $specimen_type->uuid,
632
          'maxExtend' => $gallery_settings['cdm_dataportal_media_maxextend'],
633
          'cols' => $gallery_settings['cdm_dataportal_media_cols'],
634
          'captionElements' => $captionElements,
635
        ));
636
      }
637
      // citation and detail
638
      $annotations_and_sources = handle_annotations_and_sources(
639
          $mediaSpecimen,
640
          array(
641
              'sources_as_content' => true,
642
              'link_to_name_used_in_source' => false,
643
              'link_to_reference' => true,
644
              'add_footnote_keys' => false,
645
              'bibliography_aware' => false),
646
          '',
647
          null
648
      );
649
      if(is_array( $annotations_and_sources['source_references'])){
650
        $citation_markup = join(', ', $annotations_and_sources['source_references']);
651
      }
652
    }
653

  
654
    $render_array[] = markup_to_render_array('<div class="specimen_type_designation ' . html_class_attribute_ref($specimen_type)  . '">
655
        <span class="type_status">' . ucfirst($type_status) . "</span>: "
613 656
      . $specimen_type->label
657
      . ($citation_markup ? ' '. $citation_markup : '')
614 658
      . ($preferredStableUri ? " ". l($preferredStableUri,  $preferredStableUri) : '')
659
      . $media
615 660
      . '</div>');
616 661
  }
617 662
  return $render_array;
modules/cdm_dataportal/settings.php
390 390
define('TAXONPAGE_VISIBILITY_OPTIONS_DEFAULT', serialize(get_taxon_options_list()));
391 391
define('CDM_DATAPORTAL_GALLERY_SETTINGS', serialize($gallery_settings));
392 392
define('CDM_DATAPORTAL_SPECIMEN_GALLERY_NAME', 'specimen_gallery');
393
define('CDM_DATAPORTAL_TYPE_SPECIMEN_GALLERY_NAME', 'type_specimen_gallery');
393 394
define('CDM_DATAPORTAL_DESCRIPTION_GALLERY_NAME', "description_gallery");
394 395
define('CDM_DATAPORTAL_TAXON_MEDIA_GALLERY_NAME_TAB', "taxon_tab_media_gallery");
395 396
define('CDM_DATAPORTAL_SEARCH_GALLERY_NAME', "search_gallery");

Also available in: Unified diff