xref: /plugin/include/syntax/closelastsecedit.php (revision 1403dce04142d4874c515f4f0c6b9b4a88d51d29)
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
9if (!defined('DOKU_PLUGIN'))
10    define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
11
12class syntax_plugin_include_closelastsecedit extends DokuWiki_Syntax_Plugin {
13
14    function getType() {
15        return 'formatting';
16    }
17
18    function getSort() {
19        return 50;
20    }
21
22    function handle($match, $state, $pos, &$handler) {
23        // this is a syntax plugin that doesn't offer any syntax, so there's nothing to handle by the parser
24    }
25
26    /**
27     * Finishes the last open section edit
28     */
29    function render($mode, &$renderer, $data) {
30        if ($mode == 'xhtml') {
31            $renderer->finishSectionEdit();
32            return true;
33        }
34        return false;
35    }
36}
37// vim:ts=4:sw=4:et:
38