cdm-dataportal / modules / cdm_dataportal / classes / footnote.php @ 806baeb2
History | View | Annotate | Download (1.09 KB)
1 |
<?php
|
---|---|
2 |
// $Id$
|
3 |
|
4 |
/**
|
5 |
* Copyright (C) 2007 EDIT
|
6 |
* European Distributed Institute of Taxonomy
|
7 |
* http://www.e-taxonomy.eu
|
8 |
*
|
9 |
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
10 |
* See http://www.mozilla.org/MPL/MPL-1.1.html for the full license terms.
|
11 |
*/
|
12 |
|
13 |
|
14 |
class Footnote |
15 |
{ |
16 |
|
17 |
public $key, $object, $theme, $themeArguments; |
18 |
|
19 |
|
20 |
// private constructor
|
21 |
public function __construct($footnoteKey, $object, $theme = null, array $themeArguments = array()) { |
22 |
$this->key = $footnoteKey; |
23 |
$this->object = $object; |
24 |
$this->theme = $theme; |
25 |
if(!is_array($themeArguments)){ |
26 |
$themeArguments = array(); |
27 |
} |
28 |
$this->themeArguments = $themeArguments; |
29 |
} |
30 |
|
31 |
public function doRender(){ |
32 |
|
33 |
if($this->theme){ |
34 |
$args = $this->themeArguments; |
35 |
array_unshift($this->object); |
36 |
array_unshift($this->theme); |
37 |
|
38 |
$out = call_user_func_array('theme', $args); |
39 |
} else {
|
40 |
$out = $this->object; |
41 |
} |
42 |
return theme('cdm_footnote', $this->key, $out); |
43 |
} |
44 |
|
45 |
} |