5 foreach (glob("$Page$Args/2*") as $url) {
6 $link = preg_replace('/\.html$/', '', $url);
7 $name = pathinfo($link, PATHINFO_BASENAME);
8 @list ($date, $suffix) = explode('.', $name, 2);
13 $cal[$date][$suffix] = $link;
18 if (count($cal) > 5) print ' class="cols"';
20 foreach (array_reverse($cal) as $title => $versions) {
22 if ($url = @$versions['']) {
23 printf('<a href="/%s">%s</a>', $url, $title);
27 if ($versions and $User->admin('edit')) {
28 printf(' (%s)', implode(', ', array_map(
29 function ($format, $url) {
30 return sprintf('<a href="/%s">%s</a>', $url, $format);
32 array_keys($versions), $versions)