xref: /plugin/mikioplugin/syntax/collapse.php (revision 2625d0cacd0f159fa4fb7c9d691615015291f7fd)
1<?php
2/**
3 * Mikio Syntax Plugin: Collapse
4 *
5 * @link        http://github.com/nomadjimbob/mikioplugin
6 * @license     GPL 2 (http://www.gnu.org/licenses/gpl.html)
7 * @author      James Collins <james.collins@outlook.com.au>
8 */
9if (!defined('DOKU_INC')) die();
10if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
11require_once(__DIR__.'/core.php');
12
13class syntax_plugin_mikioplugin_collapse extends syntax_plugin_mikioplugin_core {
14    public $tag                 = 'collapse';
15    public $hasEndTag           = true;
16    public $isContainer         = true;
17    public $options             = array(
18        'id'            => array('type' => 'text',  'default'   => ''),
19    );
20
21    public function render_lexer_enter(Doku_Renderer $renderer, $data) {
22        $renderer->doc .= '<div class="' . $this->elemClass . ' ' . $this->classPrefix . 'collapse" id="' . hsc($data['id']) . '">';
23    }
24
25    public function render_lexer_exit(Doku_Renderer $renderer, $data) {
26        $renderer->doc .= '</div>';
27    }
28}
29?>