Project

General

Profile

« Previous | Next » 

Revision 61658f41

Added by Andreas Kohlbecker over 3 years ago

ref #8543 unification of annotation and source footnotes in synonymy

View differences:

modules/cdm_dataportal/includes/pages.inc
719 719
    }
720 720

  
721 721
    // handle annotations of the name and taxon
722
    $bibliography_settings = get_bibliography_settings();
723
    $annotations_and_sources_config = [
724
      'sources_as_content' => FALSE,
725
      'link_to_name_used_in_source' => TRUE,
726
      'link_to_reference' => TRUE,
727
      'add_footnote_keys' => TRUE,
728
      'bibliography_aware' => $bibliography_settings['enabled'] == 1
729
    ];
730 722
    $annotations_and_sources_taxon = handle_annotations_and_sources(
731 723
      $taxon,
732
      $annotations_and_sources_config,
724
      synonymy_annotations_and_source_config(),
733 725
      '',
734 726
      RenderHints::getFootnoteListKey());
735 727
    $annotations_and_sources_name = handle_annotations_and_sources(
736 728
      $taxon->name,
737
      $annotations_and_sources_config,
729
      synonymy_annotations_and_source_config(),
738 730
      '',
739 731
      RenderHints::getFootnoteListKey());
740 732

  
......
775 767
  return markup_to_render_array($out);
776 768
}
777 769

  
770
/**
771
 * Provides the default configuration for handle_annotations_and_sources() in the
772
 * synonymy.
773
 *
774
 * @return bool[]
775
 */
776
function synonymy_annotations_and_source_config() {
777
  static $annotations_and_sources_config = null;
778
  if(!$annotations_and_sources_config){
779
    $bibliography_settings = get_bibliography_settings();
780
    $annotations_and_sources_config = [
781
      'sources_as_content' => FALSE,
782
      'link_to_name_used_in_source' => TRUE,
783
      'link_to_reference' => TRUE,
784
      'add_footnote_keys' => TRUE,
785
      'bibliography_aware' => $bibliography_settings['enabled'] == 1
786
    ];
787
  }
788
  return $annotations_and_sources_config;
789
}
790

  
778 791

  
779 792
/**
780 793
 * composes and returns an render array for the experts associated with the given taxon
modules/cdm_dataportal/includes/taxon.inc
435 435
      $referenceUri = url(path_to_reference($synonym->name->nomenclaturalReference->uuid));
436 436
    }
437 437
    $out .= render_taxon_or_name($synonym->name, NULL, $referenceUri);
438
    $out .= render_entities_annotations_as_footnote_keys([$synonym]);
438
    $annotations_and_sources = handle_annotations_and_sources(
439
      $synonym,
440
      annotations_and_source_config(),
441
      '',
442
      RenderHints::getFootnoteListKey());
443
    $out .= $annotations_and_sources['foot_note_keys'];
439 444
    $out .= '</span>';
440 445
  }
441 446
  RenderHints::popFromRenderStack();

Also available in: Unified diff