If we finished rendering a subtree we need to decrease the current depth.
Also if we dont render a subtree at least try to render the namespace as a normal page.
This commit is contained in:
parent
53b593400c
commit
5ce0007a7c
1 changed files with 10 additions and 0 deletions
10
syntax.php
Normal file → Executable file
10
syntax.php
Normal file → Executable file
|
@ -145,6 +145,16 @@ class syntax_plugin_navigation extends DokuWiki_Syntax_Plugin
|
|||
}
|
||||
}
|
||||
$output .= '<li>' . $title . '<ul>' . $this->RenderNodes($node) . '</ul></li>' . PHP_EOL;
|
||||
$this->depth--;
|
||||
}
|
||||
} else {
|
||||
// if we have reached the maximum depth, lets at least check if the namespace has a starting page and display this
|
||||
if ($start = $node->hasChild('start')) {
|
||||
$access = auth_quickaclcheck($start->getFullID());
|
||||
if ($access > 0) {
|
||||
$title = (strlen($start->getMetaData('title')) > 0 ? $start->getMetaData('title') : $start->getName());
|
||||
$output .= '<li><a href="' . wl($start->getFullID()) . '">' . $title . '</a></li>' . PHP_EOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue