xref: /plugin/struct/syntax/list.php (revision ab466032f0da9b849f2ea86b1e3228447590caae)
1549a0837SAndreas Gohr<?php
2549a0837SAndreas Gohr/**
3549a0837SAndreas Gohr * DokuWiki Plugin struct (Syntax Component)
4549a0837SAndreas Gohr *
5549a0837SAndreas Gohr * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6549a0837SAndreas Gohr * @author  Andreas Gohr, Michael Große <dokuwiki@cosmocode.de>
7549a0837SAndreas Gohr */
8549a0837SAndreas Gohr
9549a0837SAndreas Gohr// must be run within Dokuwiki
10549a0837SAndreas Gohrif (!defined('DOKU_INC')) die();
11549a0837SAndreas Gohr
12549a0837SAndreas Gohrclass syntax_plugin_struct_list extends DokuWiki_Syntax_Plugin {
13549a0837SAndreas Gohr    /**
14549a0837SAndreas Gohr     * @return string Syntax mode type
15549a0837SAndreas Gohr     */
16549a0837SAndreas Gohr    public function getType() {
17549a0837SAndreas Gohr        return 'FIXME: container|baseonly|formatting|substition|protected|disabled|paragraphs';
18549a0837SAndreas Gohr    }
19549a0837SAndreas Gohr    /**
20549a0837SAndreas Gohr     * @return string Paragraph type
21549a0837SAndreas Gohr     */
22549a0837SAndreas Gohr    public function getPType() {
23549a0837SAndreas Gohr        return 'FIXME: normal|block|stack';
24549a0837SAndreas Gohr    }
25549a0837SAndreas Gohr    /**
26549a0837SAndreas Gohr     * @return int Sort order - Low numbers go before high numbers
27549a0837SAndreas Gohr     */
28549a0837SAndreas Gohr    public function getSort() {
29549a0837SAndreas Gohr        return FIXME;
30549a0837SAndreas Gohr    }
31549a0837SAndreas Gohr
32549a0837SAndreas Gohr    /**
33549a0837SAndreas Gohr     * Connect lookup pattern to lexer.
34549a0837SAndreas Gohr     *
35549a0837SAndreas Gohr     * @param string $mode Parser mode
36549a0837SAndreas Gohr     */
37549a0837SAndreas Gohr    public function connectTo($mode) {
38549a0837SAndreas Gohr        $this->Lexer->addSpecialPattern('<FIXME>',$mode,'plugin_struct_list');
39549a0837SAndreas Gohr//        $this->Lexer->addEntryPattern('<FIXME>',$mode,'plugin_struct_list');
40549a0837SAndreas Gohr    }
41549a0837SAndreas Gohr
42549a0837SAndreas Gohr//    public function postConnect() {
43549a0837SAndreas Gohr//        $this->Lexer->addExitPattern('</FIXME>','plugin_struct_list');
44549a0837SAndreas Gohr//    }
45549a0837SAndreas Gohr
46549a0837SAndreas Gohr    /**
47549a0837SAndreas Gohr     * Handle matches of the struct syntax
48549a0837SAndreas Gohr     *
49549a0837SAndreas Gohr     * @param string $match The match of the syntax
50549a0837SAndreas Gohr     * @param int    $state The state of the handler
51549a0837SAndreas Gohr     * @param int    $pos The position in the document
52549a0837SAndreas Gohr     * @param Doku_Handler    $handler The handler
53549a0837SAndreas Gohr     * @return array Data for the renderer
54549a0837SAndreas Gohr     */
55*ab466032SAndreas Gohr    public function handle($match, $state, $pos, Doku_Handler $handler){
56549a0837SAndreas Gohr        $data = array();
57549a0837SAndreas Gohr
58549a0837SAndreas Gohr        return $data;
59549a0837SAndreas Gohr    }
60549a0837SAndreas Gohr
61549a0837SAndreas Gohr    /**
62549a0837SAndreas Gohr     * Render xhtml output or metadata
63549a0837SAndreas Gohr     *
64549a0837SAndreas Gohr     * @param string         $mode      Renderer mode (supported modes: xhtml)
65549a0837SAndreas Gohr     * @param Doku_Renderer  $renderer  The renderer
66549a0837SAndreas Gohr     * @param array          $data      The data from the handler() function
67549a0837SAndreas Gohr     * @return bool If rendering was successful.
68549a0837SAndreas Gohr     */
69*ab466032SAndreas Gohr    public function render($mode, Doku_Renderer $renderer, $data) {
70549a0837SAndreas Gohr        if($mode != 'xhtml') return false;
71549a0837SAndreas Gohr
72549a0837SAndreas Gohr        return true;
73549a0837SAndreas Gohr    }
74549a0837SAndreas Gohr}
75549a0837SAndreas Gohr
76549a0837SAndreas Gohr// vim:ts=4:sw=4:et:
77