You are here

function theme_footnote_list in Footnotes 5.2

Same name and namespace in other branches
  1. 6.2 footnotes.module \theme_footnote_list()
  2. 7.3 footnotes.module \theme_footnote_list()
  3. 7.2 footnotes.module \theme_footnote_list()

Themed output of the footnotes list appearing at at [footnotes]

Accepts an array containing an ordered listing of associative arrays, each containing values on the following keys: text - the raw unprocessed text extracted from within the [fn] tag text_clean - a sanitized version of the previous, may be used as HTML attribute value value - the raw unprocessed footnote number or other identifying label fn_id - the globally unique identifier for the in-body footnote link anchor, used to allow links from the list to the body ref_id - the globally unique identifier for the footnote's anchor in the footnote listing, used to allow links to the list from the body

1 theme call to theme_footnote_list()
_footnotes_replace_callback in ./footnotes.module
Helper function called from preg_replace_callback() above

File

./footnotes.module, line 384
The Footnotes module is a filter that can be used to insert automatically numbered footnotes into Drupal texts.

Code

function theme_footnote_list($footnotes) {
  $str = '<ol class="footnotes">';

  // loop through the footnotes
  foreach ($footnotes as $fn) {
    $str .= '<li><a class="footnote" id="' . $fn['fn_id'] . '" href="#' . $fn['ref_id'] . '">' . $fn['value'] . '.</a> ';
    $str .= $fn['text'] . "</li>\n";
  }
  $str .= "</ol>\n";
  return $str;
}