X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/9c21cd6f446eccf22be5bd4e4075255e9a614c2d..b28c58864e20c556b65ec60f02c0df6401f73351:/widget/doclist.php diff --git a/widget/doclist.php b/widget/doclist.php index 589c8d6..123271b 100644 --- a/widget/doclist.php +++ b/widget/doclist.php @@ -1,8 +1,11 @@ place[0])) { + $Page->link .= '/'.$Page->place[0]; +} $cal = []; -foreach (glob("$Page$Args/2*") as $url) { +foreach (glob("{$Page->link}/2*") as $url) { $link = preg_replace('/\.html$/', '', $url); $name = pathinfo($link, PATHINFO_BASENAME); @list ($date, $suffix) = explode('.', $name, 2); @@ -14,6 +17,9 @@ foreach (glob("$Page$Args/2*") as $url) { $cal[$group][$date][$suffix] = $link; } } +if (!$cal) { + return; +} $year = 3600 * 24 * 365; # seconds per year $scale = 7; # em width per year @@ -42,7 +48,7 @@ foreach (array_reverse($cal, TRUE) as $group => $rows) { else { print ''; print $title; - if ($versions and $User->admin("edit $Page$Args")) { + if ($versions and $User->admin("edit {$Page->link}")) { printf(' (%s)', implode(', ', array_map( function ($format, $url) { return sprintf('%s', $url, $format);