Project

General

Profile

Download (835 Bytes) Statistics
| Branch: | Tag: | Revision:
1
<?php
2

    
3
class Footnote
4
{
5
  
6
    public $key, $object, $theme, $themeArguments;
7
    
8
    
9
    // private constructor
10
    public function __construct($footnoteKey, $object, $theme = null, array $themeArguments = array()) {
11
        $this->key = $footnoteKey;
12
        $this->object = $object;
13
        $this->theme = $theme;
14
        if(!is_array($themeArguments)){
15
          $themeArguments = array();
16
        }
17
        $this->themeArguments = $themeArguments;
18
    }
19

    
20
    public function doRender(){
21
      
22
      if($this->theme){
23
      $args = $this->themeArguments;
24
      array_unshift($this->object);
25
      array_unshift($this->theme);
26

    
27
        $out = call_user_func_array('theme', $args);
28
      } else {
29
        $out = $this->object;
30
      }
31
      return theme('cdm_footnode', $this->key, $out);
32
    }
33

    
34
}
(1-1/2)