1
0
mirror of https://github.com/til-schneider/slim-wiki.git synced 2025-08-04 23:57:30 +02:00

Fixed: Directories were not shown any more in breadcrumbs

This commit is contained in:
til-schneider
2015-12-23 19:24:50 +01:00
parent 664979eb56
commit 2f1878803a

View File

@@ -147,13 +147,14 @@ class Main {
$pathCount = count($requestPathArray);
$breadcrumbArray = array(array('name' => $wikiName, 'path' => '', 'active' => ($pathCount == 0)));
$articleBaseDir = $this->context->getArticleBaseDir();
$currentPath = '';
for ($i = 0; $i < $pathCount; $i++) {
$pathPart = $requestPathArray[$i];
$currentPath .= ($i == 0 ? '' : '/') . $pathPart;
$isLast = ($i == $pathCount - 1);
if ($isLast || file_exists($this->articleBaseDir . $currentPath . '/index.md')) {
if ($isLast || file_exists($articleBaseDir . $currentPath . '/index.md')) {
// This is the requested file or an directory having an index -> Add it
$breadcrumbArray[] = array(
'name' => str_replace('_', ' ', $pathPart),