Revision b810c46f
Added by Andreas Kohlbecker over 3 years ago
modules/cdm_dataportal/theme/cdm_dataportal.common.theme | ||
---|---|---|
178 | 178 |
} |
179 | 179 |
|
180 | 180 |
/** |
181 |
* @todo Please document this function. |
|
182 |
* @see http://drupal.org/node/1354 |
|
181 |
* Create markup for the footnotes mapped to the $footnoteListKey. |
|
182 |
* |
|
183 |
* @param null $footnote_list_key |
|
184 |
* The footnote list key, see RenderHints::getFootnoteListKey() |
|
185 |
* @param $element_tag |
|
186 |
* The tag for the footnote element |
|
187 |
* |
|
188 |
* @return string |
|
189 |
* @throws \Exception |
|
183 | 190 |
*/ |
184 |
function cdm_annotation_footnotes($footnoteListKey = null, $enclosingTag = span) {
|
|
191 |
function cdm_annotation_footnotes($footnote_list_key = null, $element_tag = 'span') {
|
|
185 | 192 |
if (variable_get('cdm_dataportal_annotations_footnotes', CDM_DATAPORTAL_ALL_FOOTNOTES)) { |
186 | 193 |
return ''; |
187 | 194 |
} |
188 |
return theme('cdm_footnotes', array('footnoteListKey' => $footnoteListKey . '-annotations', 'enclosingTag' => $enclosingTag));
|
|
195 |
return cdm_footnotes($footnote_list_key . '-annotations', $element_tag);
|
|
189 | 196 |
} |
190 | 197 |
|
191 | 198 |
/** |
... | ... | |
283 | 290 |
} |
284 | 291 |
|
285 | 292 |
/** |
286 |
* @todo Please document this function. |
|
287 |
* @see http://drupal.org/node/1354 |
|
293 |
* Create markup for the footnotes mapped to the $footnoteListKey. |
|
294 |
* |
|
295 |
* @param null $footnote_list_key |
|
296 |
* The footnote list key, see RenderHints::getFootnoteListKey() |
|
297 |
* @param $element_tag |
|
298 |
* The tag for the footnote element |
|
299 |
* |
|
300 |
* @return string |
|
288 | 301 |
*/ |
289 |
function theme_cdm_footnotes($variables) { |
|
290 |
$footnoteListKey = $variables['footnoteListKey']; |
|
291 |
$enclosingTag = $variables['enclosingTag']; |
|
302 |
function cdm_footnotes($footnote_list_key = null, $element_tag = 'span') { |
|
303 |
|
|
292 | 304 |
if (variable_get('cdm_dataportal_all_footnotes', CDM_DATAPORTAL_ALL_FOOTNOTES)) { |
293 | 305 |
return ''; |
294 | 306 |
} |
295 | 307 |
|
296 |
$out = '<' . $enclosingTag . ' class="footnotes footnotes-' . $footnoteListKey . ' ">'
|
|
297 |
. FootnoteManager::renderFootnoteList($footnoteListKey)
|
|
298 |
. '</' . $enclosingTag . '>';
|
|
308 |
$out = '<' . $element_tag . ' class="footnotes footnotes-' . $footnote_list_key . ' ">'
|
|
309 |
. FootnoteManager::renderFootnoteList($footnote_list_key)
|
|
310 |
. '</' . $element_tag . '>';
|
|
299 | 311 |
|
300 |
FootnoteManager::removeFootnoteList($footnoteListKey);
|
|
312 |
FootnoteManager::removeFootnoteList($footnote_list_key);
|
|
301 | 313 |
return $out; |
302 | 314 |
} |
303 | 315 |
|
Also available in: Unified diff
ref #8543 refactoring theme_cdm_footnotes to normal function