mirror of
https://github.com/til-schneider/slim-wiki.git
synced 2025-08-05 16:17:29 +02:00
Fixed: Directories were not shown any more in breadcrumbs
This commit is contained in:
@@ -147,13 +147,14 @@ class Main {
|
|||||||
$pathCount = count($requestPathArray);
|
$pathCount = count($requestPathArray);
|
||||||
$breadcrumbArray = array(array('name' => $wikiName, 'path' => '', 'active' => ($pathCount == 0)));
|
$breadcrumbArray = array(array('name' => $wikiName, 'path' => '', 'active' => ($pathCount == 0)));
|
||||||
|
|
||||||
|
$articleBaseDir = $this->context->getArticleBaseDir();
|
||||||
$currentPath = '';
|
$currentPath = '';
|
||||||
for ($i = 0; $i < $pathCount; $i++) {
|
for ($i = 0; $i < $pathCount; $i++) {
|
||||||
$pathPart = $requestPathArray[$i];
|
$pathPart = $requestPathArray[$i];
|
||||||
$currentPath .= ($i == 0 ? '' : '/') . $pathPart;
|
$currentPath .= ($i == 0 ? '' : '/') . $pathPart;
|
||||||
$isLast = ($i == $pathCount - 1);
|
$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
|
// This is the requested file or an directory having an index -> Add it
|
||||||
$breadcrumbArray[] = array(
|
$breadcrumbArray[] = array(
|
||||||
'name' => str_replace('_', ' ', $pathPart),
|
'name' => str_replace('_', ' ', $pathPart),
|
||||||
|
Reference in New Issue
Block a user