1<?php
2/**
3 * DokuWiki Plugin strata (Syntax Component)
4 *
5 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
6 * @author  Brend Wanders <b.wanders@utwente.nl>
7 */
8
9// must be run within Dokuwiki
10if (!defined('DOKU_INC')) die('Meh.');
11
12/**
13 * Simple plugin that sets the 'no data' flag.
14 */
15class syntax_plugin_strata_nodata extends DokuWiki_Syntax_Plugin {
16    public function __construct() {
17    }
18
19    public function getType() {
20        return 'substition';
21    }
22
23    public function getPType() {
24        return 'normal';
25    }
26
27    public function getSort() {
28        // sort at same level as notoc
29        return 30;
30    }
31
32
33    public function connectTo($mode) {
34        $this->Lexer->addSpecialPattern('~~NODATA~~',$mode,'plugin_strata_nodata');
35    }
36
37    public function handle($match, $state, $pos, Doku_Handler $handler){
38        return array();
39    }
40
41    public function render($mode, Doku_Renderer $R, $data) {
42        if($mode == 'metadata') {
43            $R->info['data'] = false;
44            return true;
45        }
46
47        return false;
48    }
49}
50