login/pass: error messages below page title
[minimedit.git] / widget / doclist.php
index 2288340a1a609f923c446e996e88560049092dbb..e0751b0df77b1c593189c860ba4c824cfca64911 100644 (file)
@@ -1,5 +1,8 @@
 <?php
 global $User;
+if (isset($Page->place[0])) {
+       $Page->link .= '/'.$Page->place[0];
+}
 
 $cal = [];
 foreach (glob("{$Page->link}/2*") as $url) {
@@ -10,10 +13,13 @@ foreach (glob("{$Page->link}/2*") as $url) {
        if (!isset($cal[$group][$date])) {
                $cal[$group][$date] = [];
        }
-       if (!is_dir($url) and filesize($url)) {
+       if (is_dir($url) ? file_exists("$url/index.html") : filesize($url)) {
                $cal[$group][$date][$suffix] = $link;
        }
 }
+if (!$cal) {
+       return;
+}
 
 $year = 3600 * 24 * 365;  # seconds per year
 $scale = 7;  # em width per year