commit d806934285188cf1dc6b479b2328c154b1753ff0
Author: Andreas Kohlbecker <a.kohlbecker@bgbm.org>
Date:   Wed Jul 29 12:02:06 2020 +0200

    ref #8543 further harmonizing footnote functions

diff --git a/modules/cdm_dataportal/classes/footnote.php b/modules/cdm_dataportal/classes/footnote.php
index fd6b5c0c..896bf86c 100644
--- a/modules/cdm_dataportal/classes/footnote.php
+++ b/modules/cdm_dataportal/classes/footnote.php
@@ -38,6 +38,6 @@ class Footnote {
       $enclosing_tag = $this->enclosing_tag;
     }
 
-    return footnote_markup($this->key, $this->object, $enclosing_tag);
+    return render_footnote($this->key, $this->object, $enclosing_tag);
   }
 }
diff --git a/modules/cdm_dataportal/includes/descriptions.inc b/modules/cdm_dataportal/includes/descriptions.inc
index f99c0b45..50579b41 100644
--- a/modules/cdm_dataportal/includes/descriptions.inc
+++ b/modules/cdm_dataportal/includes/descriptions.inc
@@ -527,7 +527,7 @@ function handle_annotations_and_sources_config($feature_block_settings){
       } // END of loop over sources
 
       // annotations footnotes separate from sources
-      $annotations_and_sources['foot_note_keys'] = footnote_keys_to_markup(
+      $annotations_and_sources['foot_note_keys'] = render_footnote_keys(
         cdm_entity_annotations_as_footnote_keys($entity, $footnote_list_key_suggestion), ', '
       );
 
@@ -535,7 +535,7 @@ function handle_annotations_and_sources_config($feature_block_settings){
 
     // footnotes for sources and annotations or put into into bibliography if requested ...
     if ($config['add_footnote_keys'] == 1) {
-        $annotations_and_sources['foot_note_keys'] = cdm_entity_footnotes(
+        $annotations_and_sources['foot_note_keys'] = render_entity_footnotes(
           $entity, ',',
           $footnote_list_key_suggestion,
           $config['link_to_reference'] == 1,
@@ -736,9 +736,9 @@ function cdm_entity_sources_sorted($entity) {
             /*
              * Footnotes for the feature block
              */
-            $block->content[] = markup_to_render_array(cdm_footnotes(PSEUDO_FEATURE_BIBLIOGRAPHY . '-' . $feature_node->term->uuid));
-            $block->content[] = markup_to_render_array(cdm_footnotes($feature_node->term->uuid));
-            $block->content[] = markup_to_render_array(cdm_annotation_footnotes($feature_node->term->uuid));
+            $block->content[] = markup_to_render_array(render_footnotes(PSEUDO_FEATURE_BIBLIOGRAPHY . '-' . $feature_node->term->uuid));
+            $block->content[] = markup_to_render_array(render_footnotes($feature_node->term->uuid));
+            $block->content[] = markup_to_render_array(render_annotation_footnotes($feature_node->term->uuid));
           }
         } // END all other features
 
@@ -1035,9 +1035,9 @@ function compose_feature_block_items_nested($feature_node, &$media_list, $featur
       );
     }
 
-    $block->content[] = markup_to_render_array(cdm_footnotes('BIBLIOGRAPHY-' . UUID_DISTRIBUTION));
-    $block->content[] = markup_to_render_array(cdm_footnotes(UUID_DISTRIBUTION));
-    $block->content[] = markup_to_render_array(cdm_annotation_footnotes(UUID_DISTRIBUTION));
+    $block->content[] = markup_to_render_array(render_footnotes('BIBLIOGRAPHY-' . UUID_DISTRIBUTION));
+    $block->content[] = markup_to_render_array(render_footnotes(UUID_DISTRIBUTION));
+    $block->content[] = markup_to_render_array(render_annotation_footnotes(UUID_DISTRIBUTION));
 
     return $block;
   }
@@ -1659,9 +1659,9 @@ function compose_feature_block_items_feature_common_name($elements, $feature, $w
     $text_data_out, $feature
   );
 
-  $footnotes = cdm_footnotes('BIBLIOGRAPHY-' . $footnote_key_suggestion);
-  $footnotes .= cdm_footnotes($footnote_key_suggestion); // FIXME is this needed at all?
-  $footnotes .= cdm_annotation_footnotes($footnote_key_suggestion);
+  $footnotes = render_footnotes('BIBLIOGRAPHY-' . $footnote_key_suggestion);
+  $footnotes .= render_footnotes($footnote_key_suggestion); // FIXME is this needed at all?
+  $footnotes .= render_annotation_footnotes($footnote_key_suggestion);
 
   return  markup_to_render_array(  // FIXME markup_to_render_array should no longer be needed
     '<div class="common-taxon-name">' . $common_name_out . '</div>'
diff --git a/modules/cdm_dataportal/includes/footnotes.inc b/modules/cdm_dataportal/includes/footnotes.inc
index 10e3fa8c..76f1016e 100644
--- a/modules/cdm_dataportal/includes/footnotes.inc
+++ b/modules/cdm_dataportal/includes/footnotes.inc
@@ -49,7 +49,7 @@ const FOOTNOTE_KEY_SUFFIX_ANNOTATIONS = '-annotations';
  *    Put source references into the bibliography when this param is TRUE.
  *
  * @return String
- *   The foot note keys
+ *   The foot note keys as markup
  *
  * @throws \Exception re-throw exception from theme()
  * @see cdm_entities_annotations_footnote_keys()
@@ -58,7 +58,7 @@ const FOOTNOTE_KEY_SUFFIX_ANNOTATIONS = '-annotations';
  * @$original_source_footnote_tag
  *    null will cause bibliography_footnote_list_key to use the default
  */
-function cdm_entity_footnotes(
+function render_entity_footnotes(
   $cdm_entity,
   $separator = ',',
   $footnote_list_key_suggestion = null,
@@ -104,7 +104,7 @@ function cdm_entity_footnotes(
   }
   // Sort and render footnote keys.
   asort($footnote_keys);
-  return footnote_keys_to_markup($footnote_keys, $separator);
+  return render_footnote_keys($footnote_keys, $separator);
 }
 
 /**
@@ -152,7 +152,7 @@ function cdm_entity_annotations_as_footnote_keys(stdClass $cdm_entity, $footnote
 
   $foot_note_keys = [];
 
-  // Getting the key for the footnotemanager.
+  // Getting the key for the FootnoteManager.
   if (isset($footnote_list_key_suggestion)) {
     $footnote_list_key = $footnote_list_key_suggestion;
   } else {
@@ -170,6 +170,58 @@ function cdm_entity_annotations_as_footnote_keys(stdClass $cdm_entity, $footnote
   return $foot_note_keys;
 }
 
+/**
+ * Created and registers footnotes in the FootnoteManager and returns the
+ * footnote keys as markup.
+ *
+ * The following cdm cdm classes are annotatable:
+ *
+ * - DescriptionElementBase
+ * - EventBase
+ * - HomotypicalGroup
+ * - IdentifiableEntity
+ * - DescriptionBase
+ * - IdentifiableMediaEntity
+ * - Media
+ * - Sequence
+ * - TaxonBase
+ * - TaxonName
+ * - TaxonomicTree
+ * - TermBase
+ * - LanguageStringBase
+ * - ReferencedEntityBase
+ * - NomenclaturalStatus
+ * - OriginalSourceBase
+ * - RelationshipBase
+ * - TypeDesignationBase
+ * - TaxonNode
+ * - WorkingSet
+ *
+ * @param array $cdm_entities
+ *   An array of CdmBase instances.
+ * @param $footnote_list_key_suggestion string
+ *    optional parameter. If this parameter is left empty (null, 0, "") the
+ *   footnote key will be determined be set to
+ *   RenderHints::getFootnoteListKey().FOOTNOTE_KEY_SUFFIX_ANNOTATIONS otherwise the supplied
+ *   key will be used.
+ *
+ * @return string
+ *   The markup.
+ */
+function render_entities_annotations_as_footnote_keys(array $cdm_entities, $footnote_list_key =null){
+
+  // check if footnotes for annotations are disabled completely
+  if (variable_get('cdm_dataportal_annotations_footnotes', CDM_DATAPORTAL_ALL_FOOTNOTES)) {
+    return '';
+  }
+  $markup = '';
+  $footNoteKeys = cdm_entities_annotations_footnote_keys($cdm_entities, $footnote_list_key);
+  foreach ($footNoteKeys as $a) {
+    $markup .= render_footnote_key($a, ($markup ? ',' : ''));
+  }
+  return $markup;
+}
+
 /**
  * Creates markup for an array of foot note keys
  *
@@ -178,12 +230,12 @@ function cdm_entity_annotations_as_footnote_keys(stdClass $cdm_entity, $footnote
  *
  * @return string
  */
-function footnote_keys_to_markup(array $footnote_keys, $separator) {
+function render_footnote_keys(array $footnote_keys, $separator) {
 
   $footnotes_markup = '';
   foreach ($footnote_keys as $foot_note_key) {
     try {
-      $footnotes_markup .= cdm_footnote_key($foot_note_key, ($footnotes_markup ? $separator : ''));
+      $footnotes_markup .= render_footnote_key($foot_note_key, ($footnotes_markup ? $separator : ''));
     } catch (Exception $e) {
       drupal_set_message("Exception: " . $e->getMessage(), 'error');
     }
@@ -202,11 +254,11 @@ function footnote_keys_to_markup(array $footnote_keys, $separator) {
  * @return string
  * @throws \Exception
  */
-function cdm_annotation_footnotes($footnote_list_key = null, $element_tag = 'span') {
+function render_annotation_footnotes($footnote_list_key = null, $element_tag = 'span') {
   if (variable_get('cdm_dataportal_annotations_footnotes', CDM_DATAPORTAL_ALL_FOOTNOTES)) {
     return '';
   }
-  return cdm_footnotes($footnote_list_key . FOOTNOTE_KEY_SUFFIX_ANNOTATIONS, $element_tag);
+  return render_footnotes($footnote_list_key . FOOTNOTE_KEY_SUFFIX_ANNOTATIONS, $element_tag);
 }
 
 /**
@@ -219,7 +271,7 @@ function cdm_annotation_footnotes($footnote_list_key = null, $element_tag = 'spa
  * @return string
  *   The footnote key markup
  */
-function cdm_footnote_key($footnoteKey = null, $separator = '', $separator_off = false) {
+function render_footnote_key($footnoteKey = null, $separator = '', $separator_off = false) {
 
   if (!is_object($footnoteKey) or !isset($footnoteKey->footnoteListKey)) {
     return '';
@@ -244,7 +296,7 @@ function cdm_footnote_key($footnoteKey = null, $separator = '', $separator_off =
  *
  * @return string
  */
-function footnote_markup($footnoteKey = null, $footnoteText = null, $enclosing_tag = 'span') {
+function render_footnote($footnoteKey = null, $footnoteText = null, $enclosing_tag = 'span') {
   _add_js_footnotes();
   if($enclosing_tag == null){
     $enclosing_tag = 'span';
@@ -267,7 +319,7 @@ function footnote_markup($footnoteKey = null, $footnoteText = null, $enclosing_t
  *
  * @return string
  */
-function cdm_footnotes($footnote_list_key = null, $element_tag = 'span') {
+function render_footnotes($footnote_list_key = null, $element_tag = 'span') {
 
   if (variable_get('cdm_dataportal_all_footnotes', CDM_DATAPORTAL_ALL_FOOTNOTES)) {
     return '';
diff --git a/modules/cdm_dataportal/includes/name.inc b/modules/cdm_dataportal/includes/name.inc
index e5d7a49f..b160b0fd 100644
--- a/modules/cdm_dataportal/includes/name.inc
+++ b/modules/cdm_dataportal/includes/name.inc
@@ -580,7 +580,7 @@ function render_taxon_or_name($taxon_name_or_taxon_base, $name_link = NULL, $ref
   }
   $out .= '</span>';
   if ($show_annotations) {
-    // $out .= theme('cdm_entities_annotations_as_footnotekeys', $taxonName);
+    // $out .= render_entities_annotations_as_footnote_keys([$taxonName]);
   }
   return $out;
 }
@@ -984,7 +984,7 @@ function render_type_designations($type_designations, $enclosing_tag = 'ul', $el
           // footnotes should be rendered in the parent element so we
           // are relying on the FootnoteListKey set there
           $_fkey2 = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $citation_footnote_str);
-          $footnote_key_markup = cdm_footnote_key($_fkey2, $separator, TRUE);
+          $footnote_key_markup = render_footnote_key($_fkey2, $separator, TRUE);
         }
 
         $type_citation_markup .= '&nbsp;(' . t('designated by') . '&nbsp;<span class="typeReference">' . $authorteam_str . '</span>';
@@ -1064,7 +1064,7 @@ function render_type_designations($type_designations, $enclosing_tag = 'ul', $el
     RenderHints::getFootnoteListKey(),
     (isset($derivedUnitFacadeInstance->collection->titleCache) ? $derivedUnitFacadeInstance->collection->titleCache : FALSE)
   );
-  $out .= cdm_footnote_key($_fkey, $separator);
+  $out .= render_footnote_key($_fkey, $separator);
   $out .= '</' . $enclosing_tag .'>';
 
   RenderHints::popFromRenderStack();
@@ -1435,7 +1435,7 @@ function compose_name_relationships_list($name_relations, $current_name_uuid, $c
 
   RenderHints::popFromRenderStack();
   if(RenderHints::getFootnoteListKey() == $key) {
-    $render_array['footnotes'] = markup_to_render_array(cdm_footnotes(RenderHints::getFootnoteListKey()));
+    $render_array['footnotes'] = markup_to_render_array(render_footnotes(RenderHints::getFootnoteListKey()));
     RenderHints::clearFootnoteListKey();
   }
   return $render_array;
@@ -1590,7 +1590,7 @@ function name_relationship_footnote_markup($name_rel)
   }
   if ($footnote_markup) {
     $fnkey = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $footnote_markup);
-    $footnote_key_markup = cdm_footnote_key($fnkey,',',TRUE);
+    $footnote_key_markup = render_footnote_key($fnkey,',',TRUE);
   }
   return $footnote_key_markup;
 }
@@ -1622,7 +1622,7 @@ function nomenclatural_reference_footnote_key_markup($name)
   }
   if ($footnote_markup) {
     $fnkey = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $footnote_markup);
-    $footnote_key_markup = cdm_footnote_key($fnkey, ',',TRUE);
+    $footnote_key_markup = render_footnote_key($fnkey, ',',TRUE);
   }
   return $footnote_key_markup;
 }
@@ -1990,7 +1990,7 @@ function type_designation_citation_layout($typeDesignation, $footnote_separator
     // footnotes should be rendered in the parent element so we
     // are relying on the FootnoteListKey set there
     $fkey_typeDesignation = FootnoteManager::addNewFootnote(RenderHints::getFootnoteListKey(), $typeDesignation->citation->titleCache);
-    $res .= cdm_footnote_key($fkey_typeDesignation, $footnote_separator,TRUE) . ')';
+    $res .= render_footnote_key($fkey_typeDesignation, $footnote_separator,TRUE) . ')';
   }
   return $res;
 }
diff --git a/modules/cdm_dataportal/includes/occurrences.inc b/modules/cdm_dataportal/includes/occurrences.inc
index 9d3a8c0e..1325b24d 100755
--- a/modules/cdm_dataportal/includes/occurrences.inc
+++ b/modules/cdm_dataportal/includes/occurrences.inc
@@ -761,7 +761,7 @@ function compose_cdm_specimen_or_observation($specimen_or_observation, $isSpecim
 
         $derivatives[] = $occurrence_elements;
         // all footnotes which has been assembled so far (e.g. from typeDesignations) to here
-//       $foonote_li_elements = cdm_footnotes(RenderHints::getFootnoteListKey(), 'span');
+//       $foonote_li_elements = render_footnotes(RenderHints::getFootnoteListKey(), 'span');
 //        if (!empty($foonote_li_elements)) {
 //            $derivatives[] =  array(
 //                '#markup' =>  '<div class="footnotes">' . $foonote_li_elements . '</div>',
diff --git a/modules/cdm_dataportal/includes/pages.inc b/modules/cdm_dataportal/includes/pages.inc
index 2a8e7ea0..ed3c3b2a 100755
--- a/modules/cdm_dataportal/includes/pages.inc
+++ b/modules/cdm_dataportal/includes/pages.inc
@@ -722,7 +722,7 @@ function compose_cdm_taxon_page_synonymy($taxon, $add_accepted_taxon) {
     $special_annotations_array = array();
     $special_annotations_array[] = $taxon->name;
     $special_annotations_array[] = $taxon;
-    $accepted_name .= cdm_entities_annotations_as_footnotekeys($special_annotations_array,  $synonymy_render_path . FOOTNOTE_KEY_SUFFIX_ANNOTATIONS);
+    $accepted_name .= render_entities_annotations_as_footnote_keys($special_annotations_array,  $synonymy_render_path . FOOTNOTE_KEY_SUFFIX_ANNOTATIONS);
     $accepted_name .= '</div>';
     RenderHints::popFromRenderStack();
   }
diff --git a/modules/cdm_dataportal/includes/taxon-node.inc b/modules/cdm_dataportal/includes/taxon-node.inc
index 0e7d40f6..e14ed03a 100644
--- a/modules/cdm_dataportal/includes/taxon-node.inc
+++ b/modules/cdm_dataportal/includes/taxon-node.inc
@@ -72,7 +72,7 @@ function compose_taxon_node_status(array $taxon_nodes){
           $status_markup[] = sprintf($tokes['status'], '');
         }
       }
-      $render_array['taxon-node-status'] = markup_to_render_array($label . ': ' . join('; ', $status_markup) . cdm_footnotes(RenderHints::getFootnoteListKey()));
+      $render_array['taxon-node-status'] = markup_to_render_array($label . ': ' . join('; ', $status_markup) . render_footnotes(RenderHints::getFootnoteListKey()));
       $render_array['taxon-node-status']['#prefix'] = '<div class="taxon-node-status">';
       $render_array['taxon-node-status']['#suffix'] = '</div>';
     }
diff --git a/modules/cdm_dataportal/includes/taxon.inc b/modules/cdm_dataportal/includes/taxon.inc
index ee29db42..d173bc83 100644
--- a/modules/cdm_dataportal/includes/taxon.inc
+++ b/modules/cdm_dataportal/includes/taxon.inc
@@ -145,7 +145,7 @@ function cdm_taxonRelationships($taxonRelationshipsDTO, $focusedTaxon){
       if($sensu_strings['order_by_key'] != $sensu_reference->titleCache){
         $sensu_reference_markup = cdm_reference_markup($sensu_reference);
         $footnote_key = FootnoteManager::addNewFootnote($footnote_list_key, $sensu_reference_markup);
-        $footnote_key = cdm_footnote_key($footnote_key);
+        $footnote_key = render_footnote_key($footnote_key);
         $joined_refs[$ref_key]['markup'] = '<span class="sensu">' . $sensu_strings['markup'] . $footnote_key . '</span>';
       }
     }
@@ -209,8 +209,8 @@ function cdm_taxonRelationships($taxonRelationshipsDTO, $focusedTaxon){
     $out .= '</ul>';
   }
 
-  $footnotes = cdm_footnotes($footnote_list_key, 'li');
-  $footnotes .= cdm_annotation_footnotes($footnote_list_key,'li');
+  $footnotes = render_footnotes($footnote_list_key, 'li');
+  $footnotes .= render_annotation_footnotes($footnote_list_key,'li');
 
   $out .= '<ul class="footnotes">' . $footnotes . '</ul>';
   $out .= '</div>';
@@ -393,7 +393,7 @@ function cdm_related_taxon($taxon, $reltype_uuid = NULL, $relsign = NULL, $relty
     $referenceUri = FALSE;
   }
   $out_taxon_part = render_taxon_or_name($taxon, $taxonUri, $referenceUri, TRUE, FALSE, $skip_tags, $is_invalid);
-  $taxon_footnotes = cdm_entities_annotations_as_footnotekeys([$taxon->name,$taxon], $footnoteListKey);
+  $taxon_footnotes = render_entities_annotations_as_footnote_keys([$taxon->name,$taxon], $footnoteListKey);
   $name_relations = cdm_name_relationships_for_taxon($taxon);
   $name_relations_render_array = compose_name_relationships_inline($name_relations, $taxon->name->uuid, $taxon->uuid);
 
@@ -435,7 +435,7 @@ function cdm_accepted_for($accepted_for_uuid) {
       $referenceUri = url(path_to_reference($synonym->name->nomenclaturalReference->uuid));
     }
     $out .= render_taxon_or_name($synonym->name, NULL, $referenceUri);
-    $out .= cdm_entities_annotations_as_footnotekeys($synonym);
+    $out .= render_entities_annotations_as_footnote_keys([$synonym]);
     $out .= '</span>';
   }
   RenderHints::popFromRenderStack();
@@ -566,7 +566,7 @@ function compose_list_of_taxa($taxon_list, $freetext_search_results = array(), $
             }
             $out .= '<span class="classifications"><span class="separator"> : </span>' . implode(', ', $classification_titles) . '</span>';
           }
-          $out .= cdm_entities_annotations_as_footnotekeys($taxon);
+          $out .= render_entities_annotations_as_footnote_keys([$taxon]);
           if ($showMedia_synonyms) {
             $out .= theme('cdm_taxon_list_thumbnails', array('taxon' => $acceptedTaxon));
           }
@@ -594,7 +594,7 @@ function compose_list_of_taxa($taxon_list, $freetext_search_results = array(), $
         }
         $out .= '<span class="classifications"><span class="separator"> : </span>' . implode(', ', $classification_titles) . '</span>';
       }
-      $out .= cdm_entities_annotations_as_footnotekeys($taxon);
+      $out .= render_entities_annotations_as_footnote_keys([$taxon]);
 
       if ($showMedia_taxa) {
         $out .= theme('cdm_taxon_list_thumbnails', array('taxon' => $taxon));
diff --git a/modules/cdm_dataportal/theme/cdm_dataportal.common.theme b/modules/cdm_dataportal/theme/cdm_dataportal.common.theme
index a150bacb..90ddaff9 100644
--- a/modules/cdm_dataportal/theme/cdm_dataportal.common.theme
+++ b/modules/cdm_dataportal/theme/cdm_dataportal.common.theme
@@ -119,65 +119,6 @@ function tagNameParts($name, $numOfNameTokens) {
 
 /* ============================ annotations ============================= */
 
-/**
- * Returns HTML for annotations to cdm objects.
- *
- * Almost any cdmObject may be annotated. Therefore we provide a generic way to
- * display as well as create or update annotations. The following cdm classes
- * are annotatable:
- *
- * - DescriptionElementBase
- * - EventBase
- * - HomotypicalGroup
- * - IdentifiableEntity
- * - DescriptionBase
- * - IdentifiableMediaEntity
- * - Media
- * - Sequence
- * - TaxonBase
- * - TaxonName
- * - TaxonomicTree
- * - TermBase
- * - LanguageStringBase
- * - ReferencedEntityBase
- * - NomenclaturalStatus
- * - OriginalSourceBase
- * - RelationshipBase
- * - TypeDesignationBase
- * - TaxonNode
- * - WorkingSet
- *
- * @param array $cdm_entities
- *   An array of CdmBase instances.
- * @param $footnote_list_key_suggestion string
- *    optional parameter. If this parameter is left empty (null, 0, "") the
- *   footnote key will be determined be set to
- *   RenderHints::getFootnoteListKey().FOOTNOTE_KEY_SUFFIX_ANNOTATIONS otherwise the supplied
- *   key will be used.
- *
- * @return string
- *   The markup.
- */
-function cdm_entities_annotations_as_footnotekeys($cdm_entities, $footnote_list_key =null){
-
-  // check if footnotes for annotations are disabled completely
-  if (variable_get('cdm_dataportal_annotations_footnotes', CDM_DATAPORTAL_ALL_FOOTNOTES)) {
-    return '';
-  }
-  $out = '';
-  if(is_array($cdm_entities)){
-    // array of entities
-    $footNoteKeys = cdm_entities_annotations_footnote_keys($cdm_entities, $footnote_list_key);
-  } else {
-    // single entity
-    $footNoteKeys = cdm_entity_annotations_as_footnote_keys($cdm_entities, $footnote_list_key);
-  }
-  foreach ($footNoteKeys as $a) {
-    $out .= cdm_footnote_key($a, ($out ? ',' : ''));
-  }
-  return $out;
-}
-
 /**
  * Created markup for the annotations
  * @param null $annotations
diff --git a/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme b/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
index a43a29dd..3aa5d3c9 100644
--- a/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
+++ b/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
@@ -330,7 +330,7 @@ function theme_cdm_list_IdentificationKeys($variables) {
     $out .= '</li>';
   }
   $out .= '</ul>';
-  $out .= cdm_annotation_footnotes(RenderHints::getRenderPath());
+  $out .= render_annotation_footnotes(RenderHints::getRenderPath());
   RenderHints::popFromRenderStack();
 
   return $out;
diff --git a/modules/cdm_dataportal/theme/cdm_dataportal.media.theme b/modules/cdm_dataportal/theme/cdm_dataportal.media.theme
index 3c1ea9c4..211e626f 100644
--- a/modules/cdm_dataportal/theme/cdm_dataportal.media.theme
+++ b/modules/cdm_dataportal/theme/cdm_dataportal.media.theme
@@ -308,7 +308,7 @@ function theme_cdm_media_caption($variables) {
   );
   $out .= drupal_render($description_list_item);
 
-  $out .= cdm_footnotes($footnote_list_key);
+  $out .= render_footnotes($footnote_list_key);
 
   return $out;
 }
diff --git a/modules/cdm_dataportal/theme/cdm_dataportal.name.theme b/modules/cdm_dataportal/theme/cdm_dataportal.name.theme
index 32a72256..e2f012ea 100755
--- a/modules/cdm_dataportal/theme/cdm_dataportal.name.theme
+++ b/modules/cdm_dataportal/theme/cdm_dataportal.name.theme
@@ -59,8 +59,8 @@ function theme_cdm_heterotypicSynonymyGroup($variables) {
 
   // ------- footnotes ------- //
   $out .= '<ul class="footnotes">';
-  $out .= cdm_annotation_footnotes(RenderHints::getFootnoteListKey(), 'li');
-  $out .= cdm_footnotes(RenderHints::getFootnoteListKey(), 'li');
+  $out .= render_annotation_footnotes(RenderHints::getFootnoteListKey(), 'li');
+  $out .= render_footnotes(RenderHints::getFootnoteListKey(), 'li');
   $out .= '</ul>';
 
   $out .= '</div>';
@@ -124,8 +124,8 @@ function theme_cdm_homotypicSynonymyGroup($variables) {
   // all foonotes of the homotypic group and also of the accepted taxon are
   // rendered here, both should have the same footnote key
   $out .= '<ul class="footnotes">';
-  $out .= cdm_annotation_footnotes(RenderHints::getFootnoteListKey(), 'li');
-  $out .= cdm_footnotes(RenderHints::getFootnoteListKey(), 'li');
+  $out .= render_annotation_footnotes(RenderHints::getFootnoteListKey(), 'li');
+  $out .= render_footnotes(RenderHints::getFootnoteListKey(), 'li');
   $out .= '</ul>';
 
   $out .= '</div>';
