1<?php
2/**
3 * Include plugin (close last section edit)
4 *
5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author  Michael Hamann <michael@content-space.de>
7 */
8
9class syntax_plugin_include_closelastsecedit extends DokuWiki_Syntax_Plugin {
10
11    function getType() {
12        return 'formatting';
13    }
14
15    function getSort() {
16        return 50;
17    }
18
19    function handle($match, $state, $pos, Doku_Handler $handler) {
20        // this is a syntax plugin that doesn't offer any syntax, so there's nothing to handle by the parser
21    }
22
23    /**
24     * Finishes the last open section edit
25     */
26    function render($mode, Doku_Renderer $renderer, $data) {
27        if ($mode == 'xhtml') {
28            /** @var Doku_Renderer_xhtml $renderer */
29            list($endpos) = $data;
30            $renderer->finishSectionEdit($endpos);
31            return true;
32        }
33        return false;
34    }
35}
36// vim:ts=4:sw=4:et:
37