1649de279SAndreas Gohr<?php 2649de279SAndreas Gohr/** 3649de279SAndreas Gohr * Translation Plugin: Simple multilanguage plugin 4649de279SAndreas Gohr * 5649de279SAndreas Gohr * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 6649de279SAndreas Gohr * @author Andreas Gohr <andi@splitbrain.org> 7649de279SAndreas Gohr */ 8649de279SAndreas Gohr// must be run within Dokuwiki 9649de279SAndreas Gohrif(!defined('DOKU_INC')) die(); 10649de279SAndreas Gohr 11649de279SAndreas Gohrclass syntax_plugin_translation_trans extends DokuWiki_Syntax_Plugin { 12649de279SAndreas Gohr /** 13649de279SAndreas Gohr * What kind of syntax are we? 14649de279SAndreas Gohr */ 15649de279SAndreas Gohr function getType() { 16649de279SAndreas Gohr return 'substition'; 17649de279SAndreas Gohr } 18649de279SAndreas Gohr 19649de279SAndreas Gohr /** 20649de279SAndreas Gohr * Where to sort in? 21649de279SAndreas Gohr */ 22649de279SAndreas Gohr function getSort() { 23649de279SAndreas Gohr return 155; 24649de279SAndreas Gohr } 25649de279SAndreas Gohr 26649de279SAndreas Gohr /** 27649de279SAndreas Gohr * Connect pattern to lexer 28649de279SAndreas Gohr */ 29649de279SAndreas Gohr function connectTo($mode) { 30649de279SAndreas Gohr $this->Lexer->addSpecialPattern('~~TRANS~~', $mode, 'plugin_translation_trans'); 31649de279SAndreas Gohr } 32649de279SAndreas Gohr 33649de279SAndreas Gohr /** 34649de279SAndreas Gohr * Handle the match 35649de279SAndreas Gohr */ 36*26dc9401SGerry Weißbach function handle($match, $state, $pos, Doku_Handler $handler) { 37649de279SAndreas Gohr return array(); 38649de279SAndreas Gohr } 39649de279SAndreas Gohr 40649de279SAndreas Gohr /** 41649de279SAndreas Gohr * Create output 42649de279SAndreas Gohr */ 43*26dc9401SGerry Weißbach function render($format, Doku_Renderer $renderer, $data) { 44649de279SAndreas Gohr if($format != 'xhtml') return false; 45649de279SAndreas Gohr 46649de279SAndreas Gohr // disable caching 47649de279SAndreas Gohr $renderer->nocache(); 48649de279SAndreas Gohr 49649de279SAndreas Gohr /** @var helper_plugin_translation $hlp */ 50649de279SAndreas Gohr $hlp = plugin_load('helper', 'translation'); 51649de279SAndreas Gohr $renderer->doc .= $hlp->showTranslations(); 52649de279SAndreas Gohr return true; 53649de279SAndreas Gohr } 54649de279SAndreas Gohr 55649de279SAndreas Gohr} 56649de279SAndreas Gohr 57649de279SAndreas Gohr//Setup VIM: ex: et ts=4 enc=utf-8 : 58