1<?php
2// must be run within Dokuwiki
3if(!defined('DOKU_INC')) die();
4
5/**
6 * All DokuWiki plugins to extend the parser/rendering mechanism
7 * need to inherit from this class
8 */
9class syntax_plugin_poem_block extends DokuWiki_Syntax_Plugin {
10
11    function getType() { return 'container'; }
12    function getPType() { return 'stack'; }
13    function getAllowedTypes() { return array('formatting', 'substition', 'disabled', 'poem'); }
14    function getSort() { return 20; }
15
16    /**
17     * Connect pattern to lexer
18     */
19    function connectTo($mode) {
20        $this->Lexer->addEntryPattern('<poem>\n?',$mode,'plugin_poem_block');
21    }
22
23    function postConnect() {
24        $this->Lexer->addExitPattern('</poem>','plugin_poem_block');
25    }
26
27    /**
28     * Handle the match
29     */
30    function handle($match, $state, $pos, Doku_Handler $handler){
31        if ($state==DOKU_LEXER_UNMATCHED) {
32            $handler->_addCall('cdata', array($match), $pos);
33        }
34        return false;
35    }
36
37    /**
38     * Create output
39     */
40    function render($format, Doku_Renderer $renderer, $data) {}
41}
42