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