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_bibliography
13:  *
14:  * @author sebastian
15:  */
16: 
17: class Bibliography extends Format {
18: 
19:     private $layout = NULL;
20: 
21:     function init($dom_node, $citeproc) {
22:         $hier_name_attr = $this->get_hier_attributes();
23:         $options = $dom_node->getElementsByTagName('option');
24:         foreach ($options as $option) {
25:             $value = $option->getAttribute('value');
26:             $name = $option->getAttribute('name');
27:             $this->attributes[$name] = $value;
28:         }
29: 
30:         $layouts = $dom_node->getElementsByTagName('layout');
31:         foreach ($layouts as $layout) {
32:             $this->layout = new Layout($layout, $citeproc);
33:         }
34:     }
35: 
36:     function init_formatting() {
37:         $this->div_class = 'csl-bib-body';
38:         parent::init_formatting();
39:     }
40: 
41:     function render($data, $mode = NULL) {
42:         $this->citeproc->quash = array();
43:         $text = $this->layout->render($data, 'bibliography');
44:         if ($this->{'hanging-indent'} == 'true') {
45:             $text = '<div style="text-indent: -25px; padding-left: 25px;">' . $text . '</div>';
46:         }
47:         $text = str_replace('?.', '?', str_replace('..', '.', $text));
48:         return $this->format($text);
49:     }
50: 
51: }
52: 
API documentation generated by ApiGen