1: <?php
2:
3: 4: 5: 6: 7:
8:
9: namespace academicpuma\citeproc;
10:
11: 12: 13: 14: 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: