1<?php
2/**
3 * Class syntax_plugin_extranet
4 */
5class syntax_plugin_extranet extends DokuWiki_Syntax_Plugin
6{
7    /**
8     * What kind of syntax are we?
9     */
10    public function getType() {
11        return 'substition';
12    }
13
14    /**
15     * Where to sort in?
16     */
17    public function getSort() {
18        return 200;
19    }
20
21    /**
22     * Connect pattern to lexer
23     * @param string $mode
24     */
25    public function connectTo($mode) {
26        $this->Lexer->addSpecialPattern('~~NOEXTRANET~~', $mode, 'plugin_changes');
27    }
28
29    /**
30     * Handler to prepare matched data for the rendering process
31     *
32     * @param   string       $match   The text matched by the patterns
33     * @param   int          $state   The lexer state for the match
34     * @param   int          $pos     The character position of the matched text
35     * @param   Doku_Handler $handler The Doku_Handler object
36     * @return  array Return an array with all data you want to use in render
37     */
38    public function handle($match, $state, $pos, Doku_Handler $handler) {
39        return substr($match, 2, -2);
40    }
41
42    /**
43     * Handles the actual output creation.
44     *
45     * @param string $mode output format being rendered
46     * @param Doku_Renderer $renderer the current renderer object
47     * @param array $data data created by handler()
48     * @return  boolean                 rendered correctly?
49     */
50    public function render($mode, Doku_Renderer $renderer, $data) {
51        $renderer->doc .= "<!-- NOEXTRANET -->";
52
53		return true;
54    }
55}
56