* * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html */ class syntax_plugin_encryptedpasswords extends SyntaxPlugin { /** @inheritDoc */ public function getType() { return 'substition'; } /** @inheritDoc */ public function getSort() { return 65; } /** @inheritDoc */ public function connectTo($mode) { $this->Lexer->addSpecialPattern('(?:.*?<\/decrypt>)', $mode, 'plugin_encryptedpasswords'); } /** @inheritDoc */ public function handle($match, $state, $pos, Doku_Handler $handler) { $crypt = substr($match, 9, -10); // remove tags return [$crypt]; } /** @inheritDoc */ public function render($mode, Doku_Renderer $renderer, $data) { if ($mode !== 'xhtml') { return false; } $crypt = hsc($data[0]); $renderer->doc .= ''; $renderer->doc .= '••••••••••'; $renderer->doc .= inlineSVG(__DIR__ . '/lock.svg'); $renderer->doc .= inlineSVG(__DIR__ . '/lock-open.svg'); $renderer->doc .= ''; return true; } }