xref: /plugin/qc/syntax.php (revision 76bbc49c3993db5faa9303ad0615cbeca3339685)
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 */
9
10// must be run within Dokuwiki
11if (!defined('DOKU_INC')) die();
12
13if (!defined('DOKU_LF')) define('DOKU_LF', "\n");
14if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t");
15if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
16
17require_once(DOKU_PLUGIN . 'syntax.php');
18
19class syntax_plugin_qc extends DokuWiki_Syntax_Plugin
20{
21
22    function getType()
23    {
24        return 'substition';
25    }
26
27    function getPType()
28    {
29        return 'normal';
30    }
31
32    function getSort()
33    {
34        return 150;
35    }
36
37
38    function connectTo($mode)
39    {
40        $this->Lexer->addSpecialPattern('~~NOQC~~', $mode, 'plugin_qc');
41    }
42
43    function handle($match, $state, $pos, Doku_Handler $handler)
44    {
45        $data = array();
46
47        return $data;
48    }
49
50    function render($mode, Doku_Renderer $R, $data)
51    {
52        if ($mode != 'metadata') return false;
53
54        $R->meta['relation']['qcplugin_disabled'] = true;
55        return true;
56    }
57}
58
59// vim:ts=4:sw=4:et:enc=utf-8:
60