1<?php 2/** 3 * Include plugin (editbtn header component) 4 * 5 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 6 * @author Michael Hamann <michael@content-space.de> 7 */ 8 9class syntax_plugin_include_readmore extends DokuWiki_Syntax_Plugin { 10 11 function getType() { 12 return 'formatting'; 13 } 14 15 function getSort() { 16 return 50; 17 } 18 19 function handle($match, $state, $pos, Doku_Handler $handler) { 20 // this is a syntax plugin that doesn't offer any syntax, so there's nothing to handle by the parser 21 } 22 23 function render($mode, Doku_Renderer $renderer, $data) { 24 list($page) = $data; 25 26 if ($mode == 'xhtml') { 27 $renderer->doc .= DOKU_LF.'<p class="include_readmore">'.DOKU_LF; 28 } else { 29 $renderer->p_open(); 30 } 31 32 $renderer->internallink($page, $this->getLang('readmore')); 33 34 if ($mode == 'xhtml') { 35 $renderer->doc .= DOKU_LF.'</p>'.DOKU_LF; 36 } else { 37 $renderer->p_close(); 38 } 39 40 return true; 41 } 42} 43// vim:ts=4:sw=4:et: 44