xref: /plugin/mikioplugin/syntax/cardbody.php (revision 6a8ce132ee7f679af64d1f8610f000730ef93359)
1<?php
2/**
3 * Mikio Syntax Plugin: Card Body
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();
10}
11if (!defined('DOKU_PLUGIN')) { define('DOKU_PLUGIN', DOKU_INC.'lib/plugins/');
12}
13require_once dirname(__FILE__).'/core.php';
14
15class syntax_plugin_mikioplugin_cardbody extends syntax_plugin_mikioplugin_core
16{
17    public $tag                 = 'card-body';
18    public $hasEndTag           = true;
19
20    public function __construct()
21    {
22        $this->addCommonOptions('text-color vertical-align');
23    }
24
25    public function getAllowedTypes()
26    {
27        return array('formatting', 'substition', 'disabled', 'container', 'protected');
28    }
29    public function getPType()
30    {
31        return 'normal';
32    }
33
34    public function render_lexer_enter(Doku_Renderer $renderer, $data)
35    {
36        $classes = $this->buildClass($data);
37        $styles = $this->buildStyle(array('color' => $data['text-color']), true);
38
39        $renderer->doc .= '<div class="' . $this->elemClass . ' ' . $this->classPrefix . 'card-body' . $classes . '"' . $styles . '>';
40    }
41
42
43    public function render_lexer_exit(Doku_Renderer $renderer, $data)
44    {
45        $renderer->doc .= '</div>';
46    }
47}
48?>