--- loncom/publisher/londiff.pm 2006/05/17 13:41:45 1.19 +++ loncom/publisher/londiff.pm 2006/09/13 21:43:26 1.20 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to show differences between file versions # -# $Id: londiff.pm,v 1.19 2006/05/17 13:41:45 www Exp $ +# $Id: londiff.pm,v 1.20 2006/09/13 21:43:26 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,9 +35,10 @@ use File::Copy; use File::Compare; use Algorithm::Diff qw(diff); use Apache::Constants qw(:common :http :methods); -use Apache::loncacc; +use Apache::loncacc(); use Apache::lonnet; use Apache::loncommon(); +use Apache::lonretrieve(); use Apache::lonlocal; @@ -75,7 +76,6 @@ sub are_different_files { sub handler { my $r=shift; - # Get query string for limited number of parameters &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, @@ -122,7 +122,8 @@ sub handler { } - if (&Apache::loncommon::fileembstyle(($efn=~/\.(\w+)$/)) eq 'ssi') { + if (&Apache::loncommon::fileembstyle(($efn=~/\.(\w+)$/)) eq 'ssi' + || $efn =~ /\.meta$/) { $r->print('

'); if ($env{'form.versionone'} eq 'priv') { my $fn='/home/'.$cuname.'/public_html/'.$efn; @@ -132,7 +133,11 @@ sub handler { my $fn= '/home/httpd/html/res/'.$cudom.'/'.$cuname.'/'; if ($env{'form.versionone'}) { - my ($main,$suffix)=($efn=~/^(.+)\.(\w+)$/); + my ($main,$suffix,$is_meta)= + &Apache::lonretrieve::get_file_info($efn); + + $fn.=($efn =~m|(.*/)[^/]+|)[0]; + # add on to $fn the path information in $efn $fn.=$main.'.'.$env{'form.versionone'}.'.'.$suffix; $r->print(''.&mt('Version').' '.$env{'form.versionone'}.''); } else { @@ -158,7 +163,10 @@ sub handler { my $fn= '/home/httpd/html/res/'.$cudom.'/'.$cuname.'/'; if ($env{'form.versiontwo'}) { - my ($main,$suffix)=($efn=~/^(.+)\.(\w+)$/); + my ($main,$suffix,$is_meta)= + &Apache::lonretrieve::get_file_info($efn); + # add on to $fn the path information in $efn + $fn.=($efn =~m|(.*/)[^/]+|)[0]; $fn.=$main.'.'.$env{'form.versiontwo'}.'.'.$suffix; $r->print(''.&mt('Version').' '.$env{'form.versiontwo'}.''); } else {