xref: /plugin/qc/syntax.php (revision cb13255c2f503e7ab49aa123ebd1f0ef673f6103)
1<?php
2/**
3 * DokuWiki Plugin qc (Syntax Component)
4 *
5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6 * @author  Andreas Gohr <gohr@cosmocode.de>
7 */
8
9// must be run within Dokuwiki
10if (!defined('DOKU_INC')) die();
11
12if (!defined('DOKU_LF')) define('DOKU_LF', "\n");
13if (!defined('DOKU_TAB')) define('DOKU_TAB', "\t");
14if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
15
16require_once(DOKU_PLUGIN.'syntax.php');
17
18class syntax_plugin_qc extends DokuWiki_Syntax_Plugin {
19
20    function getType() {
21        return 'substition';
22    }
23
24    function getPType() {
25        return 'normal';
26    }
27
28    function getSort() {
29        return 150;
30    }
31
32
33    function connectTo($mode) {
34        $this->Lexer->addSpecialPattern('~~NOQC~~',$mode,'plugin_qc');
35    }
36
37    function handle($match, $state, $pos, &$handler){
38        $data = array();
39
40        return $data;
41    }
42
43    function render($mode, &$R, $data) {
44        if($mode != 'metadata') return false;
45
46        $R->meta['relation']['qcplugin_disabled'] = true;
47        return true;
48    }
49}
50
51// vim:ts=4:sw=4:et:enc=utf-8:
52