1<?php
2/**
3 * Mikio Syntax Plugin: Card Footer
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(dirname(__FILE__).'/core.php');
12
13class syntax_plugin_mikioplugin_cardfooter extends syntax_plugin_mikioplugin_core {
14    public $tag                 = 'card-footer';
15    public $requires_tag        = 'card';
16    public $hasEndTag           = true;
17    public $options             = array(
18        'small'         => array('type' => 'boolean',   'default'   => 'false')
19    );
20
21    public function __construct() {
22        $this->addCommonOptions('text-align text-color');
23    }
24
25    public function getPType() { return 'normal'; }
26
27    public function render_lexer_enter(Doku_Renderer $renderer, $data) {
28        $classes = $this->buildClass($data);
29        $styles = $this->buildStyle(array(
30            'color'             => $data['text-color'],
31        ), true);
32
33        $renderer->doc .= '<div class="' . $this->elemClass . ' ' . $this->classPrefix . 'card-footer ' . $classes . '"' . $styles . '>';
34        if($data['small'] != FALSE) $renderer->doc .= '<small>';
35    }
36
37
38    public function render_lexer_exit(Doku_Renderer $renderer, $data) {
39        if($data['small'] != FALSE) $renderer->doc .= '</small>';
40        $renderer->doc .= '</div>';
41    }
42}
43?>