readmore.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. class syntax_plugin_include_readmore extends DokuWiki_Syntax_Plugin {
  9. function getType() {
  10. return 'formatting';
  11. }
  12. function getSort() {
  13. return 50;
  14. }
  15. function handle($match, $state, $pos, Doku_Handler $handler) {
  16. // this is a syntax plugin that doesn't offer any syntax, so there's nothing to handle by the parser
  17. }
  18. function render($mode, Doku_Renderer $renderer, $data) {
  19. list($page) = $data;
  20. if ($mode == 'xhtml') {
  21. $renderer->doc .= DOKU_LF.'<p class="include_readmore">'.DOKU_LF;
  22. } else {
  23. $renderer->p_open();
  24. }
  25. $renderer->internallink($page, $this->getLang('readmore'));
  26. if ($mode == 'xhtml') {
  27. $renderer->doc .= DOKU_LF.'</p>'.DOKU_LF;
  28. } else {
  29. $renderer->p_close();
  30. }
  31. return true;
  32. }
  33. }
  34. // vim:ts=4:sw=4:et: