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 10*b898877eSghiif(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 11*b898877eSghirequire_once DOKU_PLUGIN.'syntax.php'; 1265cfcae3Sghi/** 1365cfcae3Sghi * All DokuWiki plugins to extend the parser/rendering mechanism 1465cfcae3Sghi * need to inherit from this class 1565cfcae3Sghi */ 16*b898877eSghiclass syntax_plugin_bez_qlink extends DokuWiki_Syntax_Plugin { 1765cfcae3Sghi 1865cfcae3Sghi function getType() { return 'substition'; } 1965cfcae3Sghi function getSort() { return 34; } 2065cfcae3Sghi function connectTo($mode) { 21*b898877eSghi $this->Lexer->addSpecialPattern('#[0-9]+',$mode,'plugin_bez_qlink'); 2265cfcae3Sghi } 2365cfcae3Sghi 2465cfcae3Sghi 2565cfcae3Sghi function handle($match, $state, $pos, &$handler) { 2665cfcae3Sghi $whash = substr($match, 1, strlen($match)); 2765cfcae3Sghi $ex = explode(':', $whash); 2865cfcae3Sghi return array($ex[0], isset($ex[1]) ? $ex[1] : 0); 2965cfcae3Sghi } 3065cfcae3Sghi 3165cfcae3Sghi function render($mode, &$renderer, $data) { 3265cfcae3Sghi if ($mode == 'xhtml') { 3365cfcae3Sghi list($issue, $event) = $data; 3465cfcae3Sghi 35*b898877eSghi $helper = $this->loadHelper('bez'); 3665cfcae3Sghi $renderer->doc .= $bds->html_anchor_to_event($issue, $event, true); 3765cfcae3Sghi 3865cfcae3Sghi return true; 3965cfcae3Sghi } 4065cfcae3Sghi return false; 4165cfcae3Sghi } 4265cfcae3Sghi} 43