Revision c6473f6f
Added by Francisco Revilla about 13 years ago
modules/cdm_dataportal/classes/footnote.php | ||
---|---|---|
2 | 2 |
// $Id$ |
3 | 3 |
|
4 | 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 |
*/ |
|
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 | 12 |
|
13 | 13 |
|
14 | 14 |
class Footnote |
15 | 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 |
} |
|
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 |
$out = call_user_func_array('theme', $args); |
|
38 |
} else { |
|
39 |
$out = $this->object; |
|
40 |
} |
|
41 |
return theme('cdm_footnote', $this->key, $out); |
|
42 |
} |
|
44 | 43 |
|
45 | 44 |
} |
Also available in: Unified diff
css chages for footnotes list, related with ticket #1984