Add Directory Breadcrumbs

This commit is contained in:
seiichiro 2022-01-11 20:06:10 +01:00
parent 5e92c7e108
commit 7824793afe
2 changed files with 16 additions and 3 deletions

View file

@ -117,8 +117,14 @@ if (!empty($curfiles)| !empty($dirs)) {
$data['images'][] = $tmp; $data['images'][] = $tmp;
} }
} }
} if (!empty($dirs)) {
$tmppath = '';
foreach($dirs as $tmpdir) {
$tmppath=$tmppath.DIRECTORY_SEPARATOR.$tmpdir;
$data['crumbs'][$tmpdir] = $tmppath;
}
}
}
Template::view('tpl/gallery.html', $data); Template::view('tpl/gallery.html', $data);
} else { } else {
$data['gallery_page'] = ceil($page/$gslice); $data['gallery_page'] = ceil($page/$gslice);

View file

@ -5,7 +5,14 @@
{% block content %} {% block content %}
<div class="container"> <div class="container">
<div class="page-header"> <div class="page-header">
<div class="title"><a href="{{ $startpage }}">{{ $galleryname }}</a></div> <div class="title">
<a href="{{ $startpage }}">{{ $galleryname }}</a>
{% if (!empty($crumbs)): %}
{% foreach ($crumbs as $name => $path): %}
<p> / </p><a href="index.php?d={{ $path }}&s={{ $slice }}&p=1">{{ $name }}</a>
{% endforeach %}
{% endif %}
</div>
<div class="search"> <div class="search">
<form action="index.php" method="get"> <form action="index.php" method="get">
<input type="text"placeholder="Suche.." name="f" /> <input type="text"placeholder="Suche.." name="f" />