Lexer->addSpecialPattern('<' . self::getTag() . '[^>]*>',$mode,'plugin_' . webcomponent::PLUGIN_NAME . '_' . $this->getPluginComponent()); } function handle($match, $state, $pos, Doku_Handler $handler) { switch ($state) { case DOKU_LEXER_SPECIAL : $init = array( 'ajax' => true, 'autocomplete' => true ); $match = utf8_substr($match, strlen($this->getPluginComponent()) + 1, -1); $parameters = array_merge($init, webcomponent::parseMatch($match)); return array($state, $parameters); } return array(); } function render($mode, Doku_Renderer $renderer, $data) { if ($mode == 'xhtml') { /** @var Doku_Renderer_xhtml $renderer */ list($state,$parameters)=$data; switch ($state) { case DOKU_LEXER_SPECIAL : global $lang; global $ACT; global $QUERY; // don't print the search form if search action has been disabled if (!actionOK('search')) return false; $renderer->doc .= ''; break; } return true; } // unsupported $mode return false; } public static function getTag() { list(/* $t */, /* $p */, /* $n */, $c) = explode('_', get_called_class(), 4); return (isset($c) ? $c : ''); } }