closelastsecedit.php 925 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * Include plugin (close last section edit)
  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_closelastsecedit 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. /**
  19. * Finishes the last open section edit
  20. */
  21. function render($mode, Doku_Renderer $renderer, $data) {
  22. if ($mode == 'xhtml') {
  23. /** @var Doku_Renderer_xhtml $renderer */
  24. list($endpos) = $data;
  25. $renderer->finishSectionEdit($endpos);
  26. return true;
  27. }
  28. return false;
  29. }
  30. }
  31. // vim:ts=4:sw=4:et: