xref: /plugin/qc/syntax.php (revision 8ae469bf7217f195a3a1b4ddd0d2857bc1c123f9)
1<?php
2
3/**
4 * DokuWiki Plugin qc (Syntax Component)
5 *
6 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
7 * @author  Andreas Gohr <gohr@cosmocode.de>
8 */
9class syntax_plugin_qc extends DokuWiki_Syntax_Plugin
10{
11
12    /** @inheritdoc */
13    public function getType()
14    {
15        return 'substition';
16    }
17
18    /** @inheritdoc */
19    public function getPType()
20    {
21        return 'normal';
22    }
23
24    /** @inheritdoc */
25    public function getSort()
26    {
27        return 150;
28    }
29
30    /** @inheritdoc */
31    public function connectTo($mode)
32    {
33        $this->Lexer->addSpecialPattern('~~NOQC~~', $mode, 'plugin_qc');
34    }
35
36    /** @inheritdoc */
37    public function handle($match, $state, $pos, Doku_Handler $handler)
38    {
39        return [];
40    }
41
42    /** @inheritdoc */
43    public function render($mode, Doku_Renderer $R, $data)
44    {
45        if ($mode != 'metadata') return false;
46
47        $R->meta['relation']['qcplugin_disabled'] = true;
48        return true;
49    }
50}
51