* build on the quickedit plugin by Arthur Lobert, Vincent Fleury */ // 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_inlineeditor extends DokuWiki_Syntax_Plugin { /** * return some info */ function getInfo(){ return array( 'author' => 'Simon-Shlomo Poil', 'email' => 'simon.shlomo@poil.dk', 'date' => '1 August 2011', 'name' => 'Plugin inlineeditor (syntax component)', 'desc' => 'Edit your page directly by doubleclicking the text', 'url' => 'http://dokuwiki.org/plugin:inlineeditor', ); } /** * Syntax Type * * Needs to return one of the mode types defined in $PARSER_MODES in parser.php */ function getType() { return 'substition'; } function getPType() { return 'block'; } function getSort() { return 304; } /** * Connect pattern to lexer */ function connectTo($mode) { $this->Lexer->addSpecialPattern('~~INLINEEDITORSTART~~',$mode,'plugin_inlineeditor'); // $this->Lexer->addSpecialPattern('~~QUICKEDIT~~',$mode,'plugin_quickedit'); } /** * Handle the match */ // function handle($match, $state, $pos, &$handler){ // } /** * Create output */ function render($mode, &$renderer, $data) { global $ID; if ($data[0] == 'start') { $tuto = $data[1]. $ID; $toto = 'quickedit_start'. $tuto; $titi = 'quickedit_stop'. $tuto; $renderer->doc .= "
"; } if ($data[0] == 'stop') { $tuto = $data[1]. $ID; $toto = 'quickedit_start'. $tuto; $titi = 'quickedit_stop'. $tuto; $renderer->doc .= "
";} } } // vim:ts=4:sw=4:et:enc=utf-8: