Project

General

Profile

« Previous | Next » 

Revision 0fd965ee

Added by Andreas Kohlbecker over 4 years ago

ref #8134 simplifying code

View differences:

modules/cdm_dataportal/includes/descriptions.inc
307 307
  return $item;
308 308
}
309 309

  
310
/**
311
 * Creates the footnotes for the given CDM DescriptionElement instance.
312
 *
313
 * Footnotes are created for annotations and original sources,
314
 * optionally the sources are put into a separate bibliography.
315
 *
316
 * @param $descriptionElement
317
 *   A CDM DescriptionElement instance
318
 * @param $separator
319
 *   Optional parameter. The separator string to concatenate the footnote ids, default is ','
320
 * @param $footnote_list_key_suggestion string
321
 *    This paramter will be overridden for original sources if the bibliography block is enabled.
322
 *    optional parameter. If this paramter is left empty (null, 0, "") the footnote key will be determined by the nested
323
 *    method calls by calling RenderHints::getFootnoteListKey(). NOTE: the footnore key for annotations will be set to
324
 *    RenderHints::getFootnoteListKey().'-annotations'. @see cdm_annotations_as_footnotekeys()
325
 *
326
 * @return String
327
 *   The foot note keys
328
 */
329
function cdm_create_description_element_footnotes(
330
          $description_element,
331
          $separator = ',',
332
          $footnote_list_key_suggestion = null,
333
          $do_link_to_reference = FALSE,
334
          $do_link_to_name_used_in_source = FALSE
335
    )
336
{
337

  
338
  return cdm_create_footnotes($description_element,
339
    $separator,
340
    $footnote_list_key_suggestion,
341
    $do_link_to_reference,
342
    $do_link_to_name_used_in_source,
343
    true
344

  
345
  );
346
}
347

  
348 310
/**
349 311
 * Creates the footnotes for the given CDM instance.
350 312
 *
......
622 584

  
623 585
    } // END of references inline
624 586

  
625
    // sources as footnotes or put into into bibliography if requested ...
587
    // footnotes for sources and annotations or put into into bibliography if requested ...
626 588
    if ($config['add_footnote_keys'] == 1) {
627
      if(empty($config['bibliography_aware'])) {
628 589
        $annotations_and_sources['foot_note_keys'] = cdm_create_footnotes(
629 590
          $entity, ',',
630 591
          $footnote_list_key_suggestion,
631 592
          $config['link_to_reference'] == 1,
632
          $config['link_to_name_used_in_source'] == 1
633
        );
634
      } else {
635
        $annotations_and_sources['foot_note_keys'] = cdm_create_description_element_footnotes(
636
          $entity, ',',
637
          $footnote_list_key_suggestion,
638
          $config['link_to_reference'] == 1,
639
          $config['link_to_name_used_in_source'] == 1
593
          $config['link_to_name_used_in_source'] == 1,
594
          !empty($config['bibliography_aware'])
640 595
        );
641
      }
642 596
    }
643 597

  
644 598
    return $annotations_and_sources;

Also available in: Unified diff