--- loncom/publisher/lonretrieve.pm 2005/04/07 06:56:27 1.27
+++ loncom/publisher/lonretrieve.pm 2005/12/12 21:59:12 1.28
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to retrieve an old version of a file
#
-# $Id: lonretrieve.pm,v 1.27 2005/04/07 06:56:27 albertel Exp $
+# $Id: lonretrieve.pm,v 1.28 2005/12/12 21:59:12 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -63,9 +63,17 @@ sub phaseone {
&mt('Version').''.
'
'.&mt('Published on ...').' | '.
''.&mt('Metadata').' | ');
- my $filename;
+
opendir(DIR,$resdir);
- while ($filename=readdir(DIR)) {
+ my @files = grep(/^\Q$main\E\.(\d+)\.\Q$suffix\E$/,readdir(DIR));
+ @files = sort {
+ my ($aver) = ($a=~/^\Q$main\E\.(\d+)\.\Q$suffix\E$/);
+ my ($bver) = ($b=~/^\Q$main\E\.(\d+)\.\Q$suffix\E$/);
+ return $aver <=> $bver;
+ } (@files);
+ closedir(DIR);
+
+ foreach my $filename (@files) {
if ($filename=~/^\Q$main\E\.(\d+)\.\Q$suffix\E$/) {
my $version=$1;
my $rmtime=&Apache::lonnet::metadata($resdir.'/'.$filename,'lastrevisiondate');