1<?php
2/**
3 * DokuWiki Plugin const (Syntax Component)
4 *
5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
6 * @author  lisps
7 */
8
9// must be run within DokuWiki
10if(!defined('DOKU_INC')) die();
11
12if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
13require_once DOKU_PLUGIN.'syntax.php';
14
15/**
16 * All DokuWiki plugins to extend the parser/rendering mechanism
17 * need to inherit from this class
18 */
19class syntax_plugin_const extends DokuWiki_Syntax_Plugin {
20
21
22	function getType() { return 'substition'; }
23	function getSort() { return 32; }
24
25	function connectTo($mode) {
26		$this->Lexer->addSpecialPattern('<const[^>]*>[^<]*</const>',$mode,'plugin_const');
27	}
28
29	function handle($match, $state, $pos, Doku_Handler $handler) {
30		return array($match, $state, $pos);
31	}
32
33	function render($mode, Doku_Renderer $renderer, $data) {
34	// $data is what the function handle return'ed.
35		if($mode == 'xhtml'){
36			$renderer->doc .="";
37			return true;
38		}
39		return false;
40	}
41}
42
43