button.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /**
  3. * DokuWiki Plugin lsb (Syntax Component)
  4. *
  5. * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
  6. * @author Fernando Ribeiro <pinguim.ribeiro@gmail.com>
  7. */
  8. // must be run within Dokuwiki
  9. if (!defined('DOKU_INC')) die();
  10. class syntax_plugin_lsb_button extends DokuWiki_Syntax_Plugin {
  11. /**
  12. * @return string Syntax mode type
  13. */
  14. public function getType() {
  15. return 'FIXME: container|baseonly|formatting|substition|protected|disabled|paragraphs';
  16. }
  17. /**
  18. * @return string Paragraph type
  19. */
  20. public function getPType() {
  21. return 'FIXME: normal|block|stack';
  22. }
  23. /**
  24. * @return int Sort order - Low numbers go before high numbers
  25. */
  26. public function getSort() {
  27. return FIXME;
  28. }
  29. /**
  30. * Connect lookup pattern to lexer.
  31. *
  32. * @param string $mode Parser mode
  33. */
  34. public function connectTo($mode) {
  35. $this->Lexer->addSpecialPattern('<FIXME>',$mode,'plugin_lsb_button');
  36. // $this->Lexer->addEntryPattern('<FIXME>',$mode,'plugin_lsb_button');
  37. }
  38. // public function postConnect() {
  39. // $this->Lexer->addExitPattern('</FIXME>','plugin_lsb_button');
  40. // }
  41. /**
  42. * Handle matches of the lsb syntax
  43. *
  44. * @param string $match The match of the syntax
  45. * @param int $state The state of the handler
  46. * @param int $pos The position in the document
  47. * @param Doku_Handler $handler The handler
  48. * @return array Data for the renderer
  49. */
  50. public function handle($match, $state, $pos, Doku_Handler &$handler){
  51. $data = array();
  52. return $data;
  53. }
  54. /**
  55. * Render xhtml output or metadata
  56. *
  57. * @param string $mode Renderer mode (supported modes: xhtml)
  58. * @param Doku_Renderer $renderer The renderer
  59. * @param array $data The data from the handler() function
  60. * @return bool If rendering was successful.
  61. */
  62. public function render($mode, Doku_Renderer &$renderer, $data) {
  63. if($mode != 'xhtml') return false;
  64. return true;
  65. }
  66. }
  67. // vim:ts=4:sw=4:et: