Revision 9ece0f7b
Added by Andreas Kohlbecker over 2 years ago
modules/cdm_dataportal/classes/footnote.php | ||
---|---|---|
32 | 32 |
* @todo please document this function. |
33 | 33 |
*/ |
34 | 34 |
public function doRender() { |
35 |
$variables = array( |
|
36 |
'footnoteKey' => $this->key, |
|
37 |
'footnoteText' => $this->object |
|
38 |
); |
|
35 |
|
|
36 |
$enclosing_tag = null; |
|
39 | 37 |
if(is_string($this->enclosing_tag)){ |
40 |
$variables['enclosing_tag'] = $this->enclosing_tag;
|
|
38 |
$enclosing_tag = $this->enclosing_tag;
|
|
41 | 39 |
} |
42 |
return theme('cdm_footnote', |
|
43 |
$variables |
|
44 |
); |
|
40 |
|
|
41 |
return footnote_markup($this->key, $this->object, $enclosing_tag); |
|
45 | 42 |
} |
46 | 43 |
} |
modules/cdm_dataportal/theme/cdm_dataportal.common.theme | ||
---|---|---|
274 | 274 |
} |
275 | 275 |
|
276 | 276 |
/** |
277 |
* @todo Please document this function. |
|
278 |
* @see http://drupal.org/node/1354 |
|
277 |
* @param null $footnoteKey |
|
278 |
* @param null $footnoteText |
|
279 |
* @param string $enclosing_tag |
|
280 |
* default is 'span' |
|
281 |
* |
|
282 |
* @return string |
|
279 | 283 |
*/ |
280 |
function theme_cdm_footnote($variables) { |
|
281 |
$footnoteKey = $variables['footnoteKey']; |
|
282 |
$footnoteText = $variables['footnoteText']; |
|
283 |
$enclosing_tag = $variables['enclosing_tag']; |
|
284 |
function footnote_markup($footnoteKey = null, $footnoteText = null, $enclosing_tag = 'span') { |
|
284 | 285 |
_add_js_footnotes(); |
285 |
$out = '<' . $enclosing_tag . ' class="footnote footnote-' . $footnoteKey . '">' |
|
286 |
if($enclosing_tag == null){ |
|
287 |
$enclosing_tag = 'span'; |
|
288 |
} |
|
289 |
return '<' . $enclosing_tag . ' class="footnote footnote-' . $footnoteKey . '">' |
|
286 | 290 |
. '<a name="footnote-' . $footnoteKey . '"></a>' |
287 | 291 |
. '<span class="footnote-anchor">' . $footnoteKey . '.</span> ' . $footnoteText |
288 | 292 |
. '</' . $enclosing_tag . '>'; |
289 |
return $out; |
|
290 | 293 |
} |
291 | 294 |
|
292 | 295 |
/** |
modules/cdm_dataportal/theme/theme_registry.inc | ||
---|---|---|
46 | 46 |
'highlightable' => TRUE, |
47 | 47 |
'separator_off' => FALSE, |
48 | 48 |
)), |
49 |
'cdm_footnote' => array('variables' => array('footnoteKey' => NULL, 'footnoteText' => NULL, 'enclosing_tag' => 'span')), |
|
50 | 49 |
'cdm_marker' => array('variables' => array('label' => NULL, 'attributes' => NULL)), |
51 | 50 |
'cdm_pager' => array('variables' => array('pager' => NULL, 'path' => NULL, 'parameters' => NULL)), |
52 | 51 |
'cdm_pager_link' => array('variables' => array( |
Also available in: Unified diff
ref #8543 refactoring cdm_footnotes to normal function