--- loncom/publisher/londiff.pm 2001/12/04 15:34:57 1.6 +++ loncom/publisher/londiff.pm 2002/09/16 13:05:49 1.9 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to show differences between file versions # -# $Id: londiff.pm,v 1.6 2001/12/04 15:34:57 albertel Exp $ +# $Id: londiff.pm,v 1.9 2002/09/16 13:05:49 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -41,6 +41,9 @@ # 03/31,04/03 Gerd Kortemeyer) # # 05/02/01,05/09 Gerd Kortemeyer +# 12/13 Scott Harrison +# +### package Apache::londiff; @@ -50,6 +53,8 @@ use File::Copy; use Algorithm::Diff qw(diff); use Apache::Constants qw(:common :http :methods); use Apache::loncacc; +use Apache::lonnet(); +use Apache::loncommon(); sub handler { @@ -57,18 +62,8 @@ sub handler { # Get query string for limited number of parameters - map { - my ($name, $value) = split(/=/,$_); - $value =~ tr/+/ /; - $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; - if (($name eq 'filename') || ($name eq 'versiontwo') || - ($name eq 'versionone')) { - unless ($ENV{'form.'.$name}) { - $ENV{'form.'.$name}=$value; - } - } - } (split(/&/,$ENV{'QUERY_STRING'})); - + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['filename','versiontwo','versionone']); # Get the files my $cuname=$ENV{'user.name'}; @@ -96,7 +91,7 @@ sub handler { $r->print('LON-CAPA Construction Diffs'); - $r->print(''); + $r->print(&Apache::loncommon::bodytag('Resource Differences')); $r->print('

Compare versions of '.$efn.'

'); @@ -107,7 +102,7 @@ sub handler { } - if (&Apache::lonnet::fileembstyle(($efn=~/\.(\w+)$/)) eq + if (&Apache::loncommon::fileembstyle(($efn=~/\.(\w+)$/)) eq 'ssi') { if ($ENV{'form.versionone'} eq 'priv') { my $fn='/home/'.$cuname.'/public_html/'.$efn;