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 $requires_tag        = 'card';
19    public $hasEndTag           = true;
20
21    public function __construct()
22    {
23        $this->addCommonOptions('text-align text-color vertical-align');
24    }
25
26    public function getAllowedTypes()
27    {
28        return array('formatting', 'substition', 'disabled', 'container', 'protected');
29    }
30    public function getPType()
31    {
32        return 'normal';
33    }
34
35    public function render_lexer_enter(Doku_Renderer $renderer, $data)
36    {
37        $classes = $this->buildClass($data);
38        $styles = $this->buildStyle(array('color' => $data['text-color']), true);
39
40        $renderer->doc .= '<div class="' . $this->elemClass . ' ' . $this->classPrefix . 'card-body' . $classes . '"' . $styles . '>';
41    }
42
43
44    public function render_lexer_exit(Doku_Renderer $renderer, $data)
45    {
46        $renderer->doc .= '</div>';
47    }
48}
49?>