xref: /plugin/mikioplugin/syntax/column.php (revision 581a9aa1d8e0b7ee1008b23ff1d8ffb7340f2692)
1<?php
2/**
3 * Mikio Syntax Plugin: COLUMN
4 *
5 * Syntax:  <COLUMN></COLUMN>
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_column extends syntax_plugin_mikioplugin_core {
16    public $tag                 = 'col';
17    public $options             = array(
18        'size' => array('1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12')
19    );
20
21    public function render_lexer_enter(Doku_Renderer $renderer, $data) {
22        $classes = $this->buildClassString($data, array('size', 'smsize', 'mdsize', 'lgsize'), array('col-' => array('size', 'smsize', 'mdsize', 'lgsize')));
23
24        $renderer->doc .= '<div class="col ' . $classes . '">';
25    }
26
27
28    public function render_lexer_exit(Doku_Renderer $renderer, $data) {
29        $renderer->doc .= '</div>';
30    }
31}
32?>