Project

General

Profile

« Previous | Next » 

Revision 178d1ae6

Added by Andreas Kohlbecker almost 4 years ago

ref #9010 solving some problems regarding sources and annotations for TaxonNodes

View differences:

modules/cdm_dataportal/cdm_dataportal.module
2808 2808
 *
2809 2809
 * @return array of footnote keys
2810 2810
 */
2811
function cdm_annotations_as_footnotekeys($cdm_entities, $footnote_list_key_suggestion = NULL) {
2811
function cdm_annotations_as_footnotekeys(array $cdm_entities, $footnote_list_key_suggestion = NULL) {
2812 2812

  
2813 2813
  $foot_note_keys = array();
2814 2814

  
......
2842 2842
  return $foot_note_keys;
2843 2843
}
2844 2844

  
2845
/**
2846
 * Fetches the list of visible annotations for each of the cdm entities and returns the footnote keys for them.
2847
 *
2848
 * The footnotes are passed to the FootnoteManager in order to store the annotations and to create the footnote keys.
2849
 *
2850
 * @see cdm_fetch_visible_annotations()
2851
 *
2852
 * @param array $cdm_entities
2853
 *   An array of CdmBase instances or a single instance.
2854
 * @param $footnote_list_key_suggestion string
2855
 *    optional parameter. If this parameter is left empty (null, 0, "") the footnote key will be determined be set to
2856
 *    RenderHints::getFootnoteListKey().'-annotations' otherwise the supplied key will be used.
2857
 *
2858
 * @return array of footnote keys
2859
 */
2860
function cdm_entity_annotations_as_footnotekeys($cdm_entity, $footnote_list_key_suggestion = NULL) {
2861

  
2862
  $foot_note_keys = array();
2863

  
2864
  // Getting the key for the footnotemanager.
2865
  if (isset($footnote_list_key_suggestion)) {
2866
    $footnote_list_key = $footnote_list_key_suggestion;
2867
  } else {
2868
    $footnote_list_key = RenderHints::getFootnoteListKey() . '-annotations';
2869
  }
2870

  
2871
  // Adding the footnotes keys.
2872
  $annotations = cdm_fetch_visible_annotations($cdm_entity);
2873
  if (is_array($annotations)) {
2874
    foreach ($annotations as $annotation) {
2875
      $foot_note_keys[] = FootnoteManager::addNewFootnote($footnote_list_key, $annotation->text);
2876
    }
2877
  }
2878

  
2879
  return $foot_note_keys;
2880
}
2881

  
2845 2882

  
2846 2883
/**
2847 2884
 * Creates a CDM Dynabox.

Also available in: Unified diff