<?php
global $User;
+if (isset($Page->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);
$cal[$group][$date][$suffix] = $link;
}
}
+if (!$cal) {
+ return;
+}
$year = 3600 * 24 * 365; # seconds per year
$scale = 7; # em width per year
else {
print '<span>';
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('<a href="/%s">%s</a>', $url, $format);