*/ class syntax_plugin_versionswitch extends SyntaxPlugin { /** @inheritDoc */ public function getType() { return 'substition'; } /** @inheritDoc */ public function getPType() { return 'normal'; } /** @inheritDoc */ public function getSort() { return 255; } /** @inheritDoc */ public function connectTo($mode) { $this->Lexer->addSpecialPattern('~~VERSIONSWITCH~~', $mode, 'plugin_versionswitch'); } /** @inheritDoc */ public function handle($match, $state, $pos, Doku_Handler $handler) { return []; } /** @inheritDoc */ public function render($mode, Doku_Renderer $renderer, $data) { if ($mode !== 'xhtml') { return false; } $renderer->nocache(); $renderer->doc .= $this->versionSelector(); return true; } /** * Render the version selector HTML * * @return string */ public function versionSelector() { global $INFO; $version = new Version($this->getConf('regexes'), $INFO['id']); $base = $version->getBaseNamespace(); if ($base === '') return ''; $current = $version->getVersion(); $doc = ''; $doc .= ''; return $doc; } }