1<?php
2/**
3 * Plugin nspages : Displays nicely a list of the pages of a namespace
4 *
5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 */
7
8if(!defined('DOKU_INC')) die();
9require_once 'printer.php';
10
11class nspages_printerSimpleList extends nspages_printer {
12    private $useNumberedList;
13
14    function __construct($plugin, $mode, $renderer, $data, $useNumberedList = false){
15        parent::__construct($plugin, $mode, $renderer, $data);
16        $this->useNumberedList = $useNumberedList;
17    }
18
19    function _print($tab, $type) {
20        $this->_openList();
21        $this->_printItems($tab);
22        $this->_closeList();
23    }
24
25    private function _openList() {
26        if ( $this->useNumberedList ){
27            $this->renderer->listo_open();
28        } else {
29            $this->renderer->listu_open();
30        }
31    }
32
33    private function _printItems($tab){
34        foreach($tab as $item) {
35            $this->_printElement($item);
36        }
37    }
38
39    private function _closeList() {
40        if ( $this->useNumberedList ){
41            $this->renderer->listo_close();
42        } else {
43            $this->renderer->listu_close();
44        }
45    }
46}
47