X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/0aa43066e7ac889d9bbba62344ed086d9b463366..d780bb75d42fe6e8c12f5e7fc82b50f005b37e92:/widget/doclist.php?ds=sidebyside
diff --git a/widget/doclist.php b/widget/doclist.php
index 78b8c49..589c8d6 100644
--- a/widget/doclist.php
+++ b/widget/doclist.php
@@ -1,31 +1,63 @@
5) print ' class="cols"';
-print ">\n";
-foreach (array_reverse($cal) as $title => $versions) {
- print '
';
- if ($url = @$versions['html']) {
- printf('%s', $url, $title);
- }
- elseif (implode('', array_keys($versions))) {
- list ($format, $url) = each($versions);
- include_once('format.inc.php');
- printf('%s (%sB %s)',
- $title, $url, showsize(filesize($url)), $format
+$year = 3600 * 24 * 365; # seconds per year
+$scale = 7; # em width per year
+$mindate = max(time(), strtotime($date) + ($year / $scale * 3)); # at least last entry plus 3em for centered text
+$length = ($mindate - strtotime(key(current($cal)))) / $year * $scale; # earliest entry position
+
+printf(''."\n", $length);
+foreach (array_reverse($cal, TRUE) as $group => $rows) {
+ if (count($rows) > 1) {
+ $time = ($mindate - strtotime("$group-12-31T23:59")) / $year * $scale;
+ printf('- ',
+ $time, $time + $scale > $length ? $length - $time + 2 : $scale
);
+ print "$group
\n";
}
else {
- print $title;
+ $time = 0;
+ }
+
+ foreach ($rows as $title => $versions) {
+ $subtime = ($mindate - strtotime($title)) / $year * $scale - $time;
+ printf('- ', $subtime);
+ if ($url = @$versions['']) {
+ printf('%s', $url, $title);
+ }
+ else {
+ print '';
+ print $title;
+ if ($versions and $User->admin("edit $Page$Args")) {
+ printf(' (%s)', implode(', ', array_map(
+ function ($format, $url) {
+ return sprintf('%s', $url, $format);
+ },
+ array_keys($versions), $versions
+ )));
+ }
+ print '';
+ }
+ print "
\n";
+ }
+
+ if (count($rows) > 1) {
+ print "
\n";
}
- print "\n";
}
print "
\n\n";