165cfcae3Sghi<?php 265cfcae3Sghi/** 365cfcae3Sghi * Plugin Now: Inserts a timestamp. 465cfcae3Sghi * 565cfcae3Sghi * @license GPL 3 (http://www.gnu.org/licenses/gpl.html) 665cfcae3Sghi */ 765cfcae3Sghi// must be run within DokuWiki 865cfcae3Sghiif(!defined('DOKU_INC')) die(); 965cfcae3Sghi 10b898877eSghiif(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 11b898877eSghirequire_once DOKU_PLUGIN.'syntax.php'; 1265cfcae3Sghi/** 1365cfcae3Sghi * All DokuWiki plugins to extend the parser/rendering mechanism 1465cfcae3Sghi * need to inherit from this class 1565cfcae3Sghi */ 16b898877eSghiclass syntax_plugin_bez_qlink extends DokuWiki_Syntax_Plugin { 1765cfcae3Sghi 1865cfcae3Sghi function getType() { return 'substition'; } 1965cfcae3Sghi function getSort() { return 34; } 2065cfcae3Sghi function connectTo($mode) { 21b898877eSghi $this->Lexer->addSpecialPattern('#[0-9]+',$mode,'plugin_bez_qlink'); 2265cfcae3Sghi } 2365cfcae3Sghi 2465cfcae3Sghi 2565cfcae3Sghi function handle($match, $state, $pos, &$handler) { 26*4913c0fbSghi $nr = substr($match, 1, strlen($match)); 27*4913c0fbSghi return $nr; 2865cfcae3Sghi } 2965cfcae3Sghi 30*4913c0fbSghi function render($mode, &$renderer, $nr) { 3165cfcae3Sghi if ($mode == 'xhtml') { 32b898877eSghi $helper = $this->loadHelper('bez'); 33*4913c0fbSghi $renderer->doc .= $helper->html_issue_link($nr); 3465cfcae3Sghi 3565cfcae3Sghi return true; 3665cfcae3Sghi } 3765cfcae3Sghi return false; 3865cfcae3Sghi } 3965cfcae3Sghi} 40