If a namespace has a startpage, hide the page and link it on the namespace.

refs T6
This commit is contained in:
Tim Schumacher 2013-12-10 21:26:42 +01:00
parent 809799f84c
commit ac753695e9

View file

@ -106,18 +106,27 @@ class syntax_plugin_navigation extends DokuWiki_Syntax_Plugin {
$output = '';
foreach ($node->getNodes() as $node) {
/** @var DokuWikiNode $node */
if ($node->getName() == 'start')
continue;
$title = (strlen($node->getMetaData('title')) > 0 ? $node->getMetaData('title') : $node->getName());
$access = auth_quickaclcheck($node->getFullID());
if ($node instanceof DokuWikiPage) {
if ($access > 0) {
$output .= '<li><a href="' . wl($node->getFullID()) . '">' . $title . '</a></li>';
$output .= '<li><a href="' . wl($node->getFullID()) . '">' . $title . '</a></li>' . PHP_EOL;
}
} else if($node instanceof DokuWikiNameSpace) {
/** @var DokuWikiNameSpace $node */
if ($this->depth <= $this->maxDepth) {
if ($access > 0) {
$output .= '<li>' . $title . '<ul>' . $this->RenderNodes($node) . '</ul></li>';
// lets check if the the namespace has a startpage and if yes link to it
if ($start = $node->hasChild('start')) {
$access = auth_quickaclcheck($start->getFullID());
if ($access > 0) {
$title = '<a href="' . wl($start->getFullID()) . '">' . (strlen($node->getMetaData('title')) > 0 ? $node->getMetaData('title') : $node->getName()) . '</a>';
}
}
$output .= '<li>' . $title . '<ul>' . $this->RenderNodes($node) . '</ul></li>' . PHP_EOL;
}
}
}