1<?php
2
3/**
4 * Mikio Syntax Plugin: Accordion
5 *
6 * @link        http://github.com/nomadjimbob/mikioplugin
7 * @license     GPL 2 (http://www.gnu.org/licenses/gpl.html)
8 * @author      James Collins <james.collins@outlook.com.au>
9 */
10if (!defined('DOKU_INC')) die();
11if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
12require_once(dirname(__FILE__) . '/core.php');
13
14class syntax_plugin_mikioplugin_accordion extends syntax_plugin_mikioplugin_core
15{
16    public $tag                 = 'accordion';
17    public $hasEndTag           = true;
18    public $options             = array(
19        'autoclose'   => array('type'     => 'boolean',   'default'   => 'false'),
20    );
21
22    public function __construct()
23    {
24        $this->addCommonOptions('shadow');
25    }
26
27    public function render_lexer_enter(Doku_Renderer $renderer, $data)
28    {
29        $classes = $this->buildClass($data, array('autoclose'));
30
31        $renderer->doc .= '<div class="' . $this->elemClass . ' ' . $this->classPrefix . 'accordian' . $classes . '">';
32    }
33
34
35    public function render_lexer_exit(Doku_Renderer $renderer, $data)
36    {
37        $renderer->doc .= '</div>';
38    }
39}
40