*/ class syntax_plugin_autoindex extends \dokuwiki\Extension\SyntaxPlugin { /** @inheritDoc */ public function getType() { return 'substition'; } /** @inheritDoc */ public function getSort() { return 155; } /** @inheritDoc */ public function getPType() { return 'block'; } /** @inheritDoc */ public function connectTo($mode) { $this->Lexer->addSpecialPattern('{{autoindex}}', $mode, 'plugin_autoindex'); } /** @inheritDoc */ public function handle($match, $state, $pos, Doku_Handler $handler) { $data = array(); return $data; } /** @inheritDoc */ public function render($format, Doku_Renderer $renderer, $data) { global $INFO; global $conf; if ($format === 'metadata') { return false; } $opts = [ 'listfiles' => true, 'pagesonly' => true, 'firsthead' => true, 'depth' => 1, ]; $data = []; $ns = ':' . cleanID(getNS($INFO['id'])); $ns = utf8_encodeFN(str_replace(':', '/', $ns)); search($data, $conf['datadir'], 'search_universal', $opts, $ns, 1, ''); uasort($data, [$this, 'titleSort']); if ($format === 'xhtml') { $renderer->doc .= '