*/ // must be run within DokuWiki if(!defined('DOKU_INC')) die(); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'syntax.php'); /** * All DokuWiki plugins to extend the parser/rendering mechanism * need to inherit from this class */ class syntax_plugin_ggb extends DokuWiki_Syntax_Plugin { function getType(){ return 'formatting'; } function getAllowedTypes() { return array('formatting', 'substition', 'disabled'); } function getSort(){ return 158; } function connectTo($mode) { $this->Lexer->addEntryPattern('(?=.*?)',$mode,'plugin_ggb'); } function postConnect() { $this->Lexer->addExitPattern('','plugin_ggb'); } /** * Handle the match */ function handle($match, $state, $pos, Doku_Handler $handler){ switch ($state) { case DOKU_LEXER_ENTER : list($strheight) = preg_split("/\//u", substr($match, 4, -1), 1); $height = intval($strheight); if (($height<100)||($height>480)) $height=480; return array($state, $height); case DOKU_LEXER_UNMATCHED : return array($state, $match); case DOKU_LEXER_EXIT : return array($state, ''); } return array(); } /** * Create output */ function render($mode, Doku_Renderer $renderer, $data) { if($mode == 'xhtml'){ list($state, $match) = $data; switch ($state) { case DOKU_LEXER_ENTER : //list($color, $background) = $match; $renderer->doc .= "

Sinus und Kosinus am Einheitskreis

doc .= $renderer->_xmlEntities($match); $renderer->doc .= wordwrap(base64_encode($inhalt), 40)."\">
\n"; break; case DOKU_LEXER_EXIT : $renderer->doc .= ""; break; } return true; } return false; } } ?>