Overview

Namespaces

  • academicpuma
    • citeproc

Classes

  • Bibliography
  • Choose
  • Citation
  • CiteProc
  • Collection
  • CSLUtils
  • Date
  • DatePart
  • Element
  • EtAl
  • Factory
  • Format
  • Group
  • Info
  • Label
  • Layout
  • Locale
  • Macro
  • Macros
  • Mapper
  • Name
  • Names
  • Number
  • Option
  • Options
  • PElse
  • PElseIf
  • PIf
  • RenderingElement
  • Sort
  • Style
  • Substitute
  • Terms
  • Text
  • Overview
  • Namespace
  • Class
 1: <?php
 2: 
 3: /*
 4:  * To change this license header, choose License Headers in Project Properties.
 5:  * To change this template file, choose Tools | Templates
 6:  * and open the template in the editor.
 7:  */
 8: 
 9: namespace academicpuma\citeproc;
10: 
11: /**
12:  * Description of csl_citation
13:  *
14:  * @author sebastian
15:  */
16: 
17: class Citation extends Format {
18: 
19:     private $layout = NULL;
20: 
21:     function init($dom_node, $citeproc) {
22:         $options = $dom_node->getElementsByTagName('option');
23:         foreach ($options as $option) {
24:             $value = $option->getAttribute('value');
25:             $name = $option->getAttribute('name');
26:             $this->attributes[$name] = $value;
27:         }
28: 
29:         $layouts = $dom_node->getElementsByTagName('layout');
30:         foreach ($layouts as $layout) {
31:             $this->layout = new Layout($layout, $citeproc);
32:         }
33:     }
34: 
35:     function render($data, $mode = NULL) {
36:         $this->citeproc->quash = array();
37: 
38:         $text = $this->layout->render($data, 'citation');
39: 
40:         return $this->format($text);
41:     }
42: 
43: }
44: 
API documentation generated by ApiGen