Project

General

Profile

« Previous | Next » 

Revision 8c14d0ea

Added by Andreas Kohlbecker over 3 years ago

ref #8543 testing for erroneous usage of the dafault footnoteListKey

View differences:

modules/cdm_dataportal/includes/footnotes.inc
15 15
 * @author
16 16
 *   - Andreas Kohlbecker <a.kohlbecker@BGBM.org>
17 17
 */
18
const MEMBER_OF_FOOTNOTES = ' member-of-footnotes-';
18 19

  
19 20
/**
20 21
 * Creates the footnotes for the given CDM instance.
......
183 184
  if ($separator_off) {
184 185
    $separator = '';
185 186
  }
186
  $out = '<span class="footnote-key footnote-key-' . $footnoteKey->keyStr . ' member-of-footnotes-' . $footnoteKey->footnoteListKey . '">'
187
  $out = '<span class="footnote-key footnote-key-' . $footnoteKey->keyStr . MEMBER_OF_FOOTNOTES . $footnoteKey->footnoteListKey . '">'
187 188
    . $separator . '<a href="#footnote-' . $footnoteKey->keyStr . '">' . $footnoteKey->keyStr . '</a>' . '</span>';
188 189
  return $out;
189 190
}
190 191

  
191 192
/**
193
 * Create the markup for a footnote. This method is used in {@link Footnote::doRender()}
192 194
 * @param null $footnoteKey
193 195
 * @param null $footnoteText
194 196
 * @param string $enclosing_tag
195 197
 *   default is 'span'
196 198
 *
197 199
 * @return string
200
 *
198 201
 */
199
function render_footnote($footnoteKey = null, $footnoteText = null, $enclosing_tag = 'span') {
202
function render_footnote($footnoteKey = null, $footnoteText = null, $enclosing_tag = 'span', $footnote_list_key = null) {
200 203
  _add_js_footnotes();
201 204
  if($enclosing_tag == null){
202 205
    $enclosing_tag = 'span';
203 206
  }
204
  return '<' . $enclosing_tag . ' class="footnote footnote-' . $footnoteKey . '">'
207
  $class_attribute_member_of = '';
208
  if($footnote_list_key){
209
    $class_attribute_member_of = MEMBER_OF_FOOTNOTES . $footnote_list_key;
210
  }
211
  return '<' . $enclosing_tag . ' class="footnote footnote-' . $footnoteKey . $class_attribute_member_of . '">'
205 212
    . '<a name="footnote-' . $footnoteKey . '"></a>'
206 213
    . '<span class="footnote-anchor">' . $footnoteKey . '.</span>&nbsp;' . $footnoteText
207 214
    . '</' . $enclosing_tag . '>';

Also available in: Unified diff