diff options
author | Yaco <franco@reevo.org> | 2022-10-30 20:29:56 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2022-10-30 20:29:56 -0300 |
commit | f6ada400510ba77a2840d1944cb0a184269c4849 (patch) | |
tree | 4869f00719ad1d2a40b41f3bdba19d270bcc751e /platform/www/lib/plugins/include/syntax/readmore.php | |
parent | 2a34419fc2b9240132303395dfa72534afb47e4b (diff) |
adds include plugin
Diffstat (limited to 'platform/www/lib/plugins/include/syntax/readmore.php')
-rw-r--r-- | platform/www/lib/plugins/include/syntax/readmore.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/platform/www/lib/plugins/include/syntax/readmore.php b/platform/www/lib/plugins/include/syntax/readmore.php new file mode 100644 index 0000000..689e11d --- /dev/null +++ b/platform/www/lib/plugins/include/syntax/readmore.php @@ -0,0 +1,43 @@ +<?php +/** + * Include plugin (editbtn header component) + * + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + * @author Michael Hamann <michael@content-space.de> + */ + +class syntax_plugin_include_readmore extends DokuWiki_Syntax_Plugin { + + function getType() { + return 'formatting'; + } + + function getSort() { + return 50; + } + + function handle($match, $state, $pos, Doku_Handler $handler) { + // this is a syntax plugin that doesn't offer any syntax, so there's nothing to handle by the parser + } + + function render($mode, Doku_Renderer $renderer, $data) { + list($page) = $data; + + if ($mode == 'xhtml') { + $renderer->doc .= DOKU_LF.'<p class="include_readmore">'.DOKU_LF; + } else { + $renderer->p_open(); + } + + $renderer->internallink($page, $this->getLang('readmore')); + + if ($mode == 'xhtml') { + $renderer->doc .= DOKU_LF.'</p>'.DOKU_LF; + } else { + $renderer->p_close(); + } + + return true; + } +} +// vim:ts=4:sw=4:et: |