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_layout
13: *
14: * @author sebastian
15: */
16:
17:
18: class Layout extends Format {
19:
20: function init_formatting() {
21: $this->div_class = 'csl-entry';
22: parent::init_formatting();
23: }
24:
25: function render($data, $mode = NULL) {
26: $text = '';
27: $parts = array();
28: // $delimiter = $this->delimiter;
29:
30: foreach ($this->elements as $element) {
31: $parts[] = $element->render($data, $mode);
32: }
33:
34: $text = implode($this->delimiter, $parts);
35:
36: if ($mode == 'bibliography' || $mode == 'citation') {
37: return $this->format($text);
38: } else {
39: return $text;
40: }
41: }
42:
43: }
44: