xref: /plugin/struct/syntax/table.php (revision 250c83c2ceae0b641fba1e6b4e45986acaa3145a)
1<?php
2/**
3 * DokuWiki Plugin struct (Syntax Component)
4 *
5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6 * @author  Andreas Gohr, Michael Große <dokuwiki@cosmocode.de>
7 */
8
9// must be run within Dokuwiki
10if (!defined('DOKU_INC')) die();
11
12class syntax_plugin_struct_table extends DokuWiki_Syntax_Plugin {
13    /**
14     * @return string Syntax mode type
15     */
16    public function getType() {
17        return 'FIXME: container|baseonly|formatting|substition|protected|disabled|paragraphs';
18    }
19    /**
20     * @return string Paragraph type
21     */
22    public function getPType() {
23        return 'FIXME: normal|block|stack';
24    }
25    /**
26     * @return int Sort order - Low numbers go before high numbers
27     */
28    public function getSort() {
29        return FIXME;
30    }
31
32    /**
33     * Connect lookup pattern to lexer.
34     *
35     * @param string $mode Parser mode
36     */
37    public function connectTo($mode) {
38        $this->Lexer->addSpecialPattern('<FIXME>',$mode,'plugin_struct_table');
39//        $this->Lexer->addEntryPattern('<FIXME>',$mode,'plugin_struct_table');
40    }
41
42//    public function postConnect() {
43//        $this->Lexer->addExitPattern('</FIXME>','plugin_struct_table');
44//    }
45
46    /**
47     * Handle matches of the struct syntax
48     *
49     * @param string $match The match of the syntax
50     * @param int    $state The state of the handler
51     * @param int    $pos The position in the document
52     * @param Doku_Handler    $handler The handler
53     * @return array Data for the renderer
54     */
55    public function handle($match, $state, $pos, Doku_Handler $handler){
56        $data = array();
57
58        return $data;
59    }
60
61    /**
62     * Render xhtml output or metadata
63     *
64     * @param string         $mode      Renderer mode (supported modes: xhtml)
65     * @param Doku_Renderer  $renderer  The renderer
66     * @param array          $data      The data from the handler() function
67     * @return bool If rendering was successful.
68     */
69    public function render($mode, Doku_Renderer $renderer, $data) {
70        if($mode != 'xhtml') return false;
71
72        return true;
73    }
74}
75
76// vim:ts=4:sw=4:et:
77