Add message for empty folders

This commit is contained in:
Skylar Ittner 2018-05-05 20:22:37 -06:00
parent dbe21d80e6
commit 7758c1db28
2 changed files with 15 additions and 0 deletions

View File

@ -115,4 +115,5 @@ define("STRINGS", [
"file not deleted" => "The file could not be deleted.",
"file deleted" => "File deleted.",
"folder deleted" => "Folder deleted.",
"nothing here" => "There doesn't seem to be anything here..."
]);

View File

@ -71,8 +71,10 @@ $fullpath = $base . $folder;
<div class="list-group">
<?php
$files = scandir($fullpath);
$count = 0;
foreach ($files as $f) {
if (strpos($f, '.') !== 0) {
$count++;
$link = "$folder/$f";
$target = "_BLANK";
$isdir = false;
@ -119,6 +121,18 @@ $fullpath = $base . $folder;
<?php
}
}
if ($count == 0) {
?>
<div class="list-group-item text-center">
<p class="text-muted">
<i class="far fa-folder-open fa-10x fa-fw"></i>
</p>
<p class="h4 text-muted">
<?php lang("nothing here"); ?>
</p>
</div>
<?php
}
?>
</div>
</div>