Display the title if available and add a check for authentification.

Refs T6
This commit is contained in:
Tim Schumacher 2013-12-03 21:03:10 +01:00
parent 6f6d2a434c
commit 67d1c2dc65

View file

@ -98,11 +98,19 @@ class syntax_plugin_navigation extends DokuWiki_Syntax_Plugin {
$output = '';
foreach ($node->getNodes() as $node) {
/** @var DokuWikiNode $node */
$title = (strlen($node->getMetaData('title')) > 0 ? $node->getMetaData('title') : $node->getName());
$access = auth_quickaclcheck($node->getFullID());
if ($node instanceof DokuWikiPage) {
$output .= '<li><a href="' . wl($node->getFullID()) . '">' . $node->getName() . '</a></li>';
} else {
if ($access > 0) {
$output .= '<li><a href="' . wl($node->getFullID()) . '">' . $title . '</a></li>';
}
} else if($node instanceof DokuWikiNameSpace) {
/** @var DokuWikiNameSpace $node */
if ($this->depth <= $this->maxDepth) {
$output .= '<li>' . $node->getName() . '<ul>' . $this->RenderNodes($node) . '</ul></li>';
if ($access > 0) {
$output .= '<li>' . $title . '<ul>' . $this->RenderNodes($node) . '</ul></li>';
}
}
}
}