1 | <?php |
||
15 | class WikitextSubPageListRenderer implements SubPageListRenderer { |
||
16 | |||
17 | private $options; |
||
18 | private $text; |
||
19 | |||
20 | /** |
||
21 | * @var HierarchyRendererFactory |
||
22 | */ |
||
23 | private $hierarchyRendererFactory; |
||
24 | |||
25 | 39 | public function __construct() { |
|
28 | |||
29 | /** |
||
30 | * @see SubPageListRenderer::render |
||
31 | * |
||
32 | * @param Page $page |
||
33 | * @param array $options |
||
34 | * |
||
35 | * @return string |
||
36 | */ |
||
37 | 31 | public function render( Page $page, array $options ) { |
|
47 | |||
48 | 31 | private function addHeader() { |
|
49 | 31 | if ( $this->options['intro'] !== '' ) { |
|
50 | 5 | $this->text .= $this->options['intro'] . "\n"; |
|
51 | } |
||
52 | 31 | } |
|
53 | |||
54 | 31 | private function addFooter() { |
|
55 | 31 | if ( $this->options['outro'] !== '' ) { |
|
56 | 4 | $this->text .= "\n". $this->options['outro']; |
|
57 | } |
||
58 | 31 | } |
|
59 | |||
60 | 31 | private function addPageHierarchy( Page $page ) { |
|
63 | |||
64 | 31 | private function wrapInElement( $text ) { |
|
65 | 31 | if ( $this->options['element'] === 'none' ) { |
|
80 | |||
81 | 30 | private function assertElementIsAllowed() { |
|
94 | |||
95 | } |
||
96 |