xref: /plugin/mikioplugin/syntax/accordion.php (revision f5938de5b5926511c9beebf3b0b4360a6ae4f808)
1<?php
2/**
3 * Mikio Syntax Plugin: Accordion
4 *
5 * Syntax:  <ACCORDION [id=]></ACCORDION>
6 *
7 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
8 * @author     James Collins <james.collins@outlook.com.au>
9 */
10
11if (!defined('DOKU_INC')) die();
12if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
13require_once(dirname(__FILE__).'/core.php');
14
15class syntax_plugin_mikioplugin_accordion extends syntax_plugin_mikioplugin_core {
16    public $tag                 = 'accordion';
17    public $options             = array('id');
18
19    public function render_lexer_enter(Doku_Renderer $renderer, $data) {
20        $renderer->doc .= '<div' . (array_key_exists('id', $data) && $data['id'] != '' ? ' id="' . $data['id'] . '"' : '') . '>';
21    }
22
23
24    public function render_lexer_exit(Doku_Renderer $renderer, $data) {
25        $renderer->doc .= '</div>';
26    }
27}
28?>