From 0453a6a6620a01854e6d66931d30c3b49927d4dc Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Tue, 26 Nov 2013 21:33:45 +0100 Subject: [PATCH] Render a tree out of the object representation. Ticket T6 --- syntax.php | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/syntax.php b/syntax.php index ec96be5..362a4b1 100644 --- a/syntax.php +++ b/syntax.php @@ -38,7 +38,7 @@ class syntax_plugin_navigation extends DokuWiki_Syntax_Plugin { } function connectTo ($mode) { - $this->Lexer->addSpecialPattern('{{indexmenu_n>(\d+)}}',$mode,'plugin_navigation'); + $this->Lexer->addSpecialPattern('{{indexmenu>.+?}}',$mode,'plugin_navigation'); $this->Lexer->addSpecialPattern ('\[Navigation\]', $mode, 'plugin_navigation'); } @@ -70,15 +70,16 @@ class syntax_plugin_navigation extends DokuWiki_Syntax_Plugin { } }); - $content = ''; + } // $data is what the function handle return'ed. if ($mode == 'xhtml') { @@ -87,4 +88,17 @@ class syntax_plugin_navigation extends DokuWiki_Syntax_Plugin { } return false; } + + private function RenderNodes(DokuWikiNameSpace $node) { + $output = ''; + foreach ($node->getNodes() as $node) { + /** @var DokuWikiNode $node */ + if ($node instanceof DokuWikiPage) { + $output .= '
  • ' . $node->getName() . '
  • '; + } else { + $output .= '
  • ' . $node->getName() . '
  • '; + } + } + return $output; + } } \ No newline at end of file