Project

General

Profile

« Previous | Next » 

Revision 7370f4f7

Added by Andreas Kohlbecker over 5 years ago

fix #7907 centalizing annotation filtering:
- annotation type filter settings are general
- render hint for reference page
- cdm_fetch_visible_annotations() implemented

View differences:

modules/cdm_dataportal/cdm_dataportal.module
2593 2593
}
2594 2594

  
2595 2595
/**
2596
 * @todo Please document this function.
2597
 * @see http://drupal.org/node/1354
2596
 * Fetches the list of visible annotations for each of the cdm entities and returns the footnote keys for them.
2597
 *
2598
 * The footnotes are passed to the FootnoteManager in order to store the annotations and to create the footnote keys.
2599
 *
2600
 * @see cdm_fetch_visible_annotations()
2598 2601
 *
2599 2602
 * @param array $cdm_entities
2600 2603
 *   An array of CdmBase instances or a single instance.
2601 2604
 * @param string $footnote_list_key_suggestion
2602 2605
 *
2603
 * @return unknown
2606
 * @return array of footnote keys
2604 2607
 */
2605 2608
function cdm_annotations_as_footnotekeys($cdm_entities, $footnote_list_key_suggestion = NULL) {
2606 2609

  
2607
   static $annotations_types_filter = null;
2608
   if(!$annotations_types_filter) {
2609
     $annotations_types_filter = unserialize(ANNOTATIONS_TYPES_AS_FOOTNOTES_DEFAULT);
2610
   }
2611

  
2612 2610
  $footNoteKeys = array();
2613 2611

  
2614 2612
  // Is argument cdmBase an array?
......
2630 2628

  
2631 2629
  // Adding the footnotes keys.
2632 2630
  foreach ($cdmBase_array as $cdmBase_element) {
2633
    $annotations = cdm_ws_getAnnotationsFor($cdmBase_element, variable_get('annotations_types_as_footnotes', $annotations_types_filter));
2631
    $annotations = cdm_fetch_visible_annotations($cdmBase_element);
2634 2632
    if (is_array($annotations)) {
2635 2633
      foreach ($annotations as $annotation) {
2636 2634
        $footNoteKeys[] = FootnoteManager::addNewFootnote($footnote_list_key, $annotation->text);

Also available in: Unified diff