mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 11:05:56 +02:00
BUGFIX Fixed DocumentationViewer->_getModulePagesNested(), wasn't comparing anything lower than first level properly
This commit is contained in:
parent
ac5b0e53e8
commit
160b527dfc
@ -432,7 +432,11 @@ class DocumentationViewer extends Controller {
|
|||||||
private function _getModulePagesNested(&$page, $module, $level = 0) {
|
private function _getModulePagesNested(&$page, $module, $level = 0) {
|
||||||
// only support 2 more levels
|
// only support 2 more levels
|
||||||
if(isset($this->Remaining[$level])) {
|
if(isset($this->Remaining[$level])) {
|
||||||
if(strtolower($this->Remaining[$level]) == trim($page->Filename, '/')) {
|
// compare segment successively, e.g. with "changelogs/alpha/2.4.0-alpha",
|
||||||
|
// first comparison on $level=0 is against "changelogs",
|
||||||
|
// second comparison on $level=1 is against "changelogs/alpha", etc.
|
||||||
|
$segments = array_slice($this->Remaining, 0, $level+1);
|
||||||
|
if(strtolower(implode('/', $segments)) == trim($page->getRelativeLink(), '/')) {
|
||||||
|
|
||||||
// its either in this section or is the actual link
|
// its either in this section or is the actual link
|
||||||
$page->LinkingMode = (isset($this->Remaining[$level + 1])) ? 'section' : 'current';
|
$page->LinkingMode = (isset($this->Remaining[$level + 1])) ? 'section' : 'current';
|
||||||
|
Loading…
Reference in New Issue
Block a user