version 1.2, 2001/05/02 21:35:15
|
version 1.4, 2001/05/03 11:04:07
|
Line 71 sub handler {
|
Line 71 sub handler {
|
$f1[$#f1+1]=$line; |
$f1[$#f1+1]=$line; |
} |
} |
} |
} |
|
$r->print('<h3>Construction Space Version</h3>'); |
} else { |
} else { |
my $fn= |
my $fn= |
'/home/httpd/html//res/'.$ENV{'user.domain'}.'/'.$ENV{'user.name'}.'/'; |
'/home/httpd/html//res/'.$ENV{'user.domain'}.'/'.$ENV{'user.name'}.'/'; |
if ($ENV{'form.versionone'}) { |
if ($ENV{'form.versionone'}) { |
my ($main,$suffix)=($ENV{'form.filename'}=~/^(.+)\.(\w+)$/); |
my ($main,$suffix)=($ENV{'form.filename'}=~/^(.+)\.(\w+)$/); |
$fn.=$main.'.'.$ENV{'form.versionone'}.'.'.$suffix; |
$fn.=$main.'.'.$ENV{'form.versionone'}.'.'.$suffix; |
|
$r->print('<h3>Version '.$ENV{'form.versionone'}.'</h3>'); |
} else { |
} else { |
$fn.=$ENV{'form.filename'}; |
$fn.=$ENV{'form.filename'}; |
|
$r->print('<h3>Current Version</h3>'); |
} |
} |
@f1=split(/\n/,&Apache::lonnet::getfile($fn)); |
@f1=split(/\n/,&Apache::lonnet::getfile($fn)); |
} |
} |
|
|
|
$r->print('versus'); |
|
|
if ($ENV{'form.versiontwo'} eq 'priv') { |
if ($ENV{'form.versiontwo'} eq 'priv') { |
my $fn='/home/'.$ENV{'user.name'}.'/public_html/'.$ENV{'form.filename'}; |
my $fn='/home/'.$ENV{'user.name'}.'/public_html/'.$ENV{'form.filename'}; |
Line 94 sub handler {
|
Line 98 sub handler {
|
$f2[$#f2+1]=$line; |
$f2[$#f2+1]=$line; |
} |
} |
} |
} |
|
$r->print('<h3>Construction Space Version</h3>'); |
} else { |
} else { |
my $fn= |
my $fn= |
'/home/httpd/html/res/'.$ENV{'user.domain'}.'/'.$ENV{'user.name'}.'/'; |
'/home/httpd/html/res/'.$ENV{'user.domain'}.'/'.$ENV{'user.name'}.'/'; |
if ($ENV{'form.versiontwo'}) { |
if ($ENV{'form.versiontwo'}) { |
my ($main,$suffix)=($ENV{'form.filename'}=~/^(.+)\.(\w+)$/); |
my ($main,$suffix)=($ENV{'form.filename'}=~/^(.+)\.(\w+)$/); |
$fn.=$main.'.'.$ENV{'form.versiontwo'}.'.'.$suffix; |
$fn.=$main.'.'.$ENV{'form.versiontwo'}.'.'.$suffix; |
|
$r->print('<h3>Version '.$ENV{'form.versiontwo'}.'</h3>'); |
} else { |
} else { |
$fn.=$ENV{'form.filename'}; |
$fn.=$ENV{'form.filename'}; |
|
$r->print('<h3>Current Version</h3>'); |
} |
} |
@f2=split(/\n/,&Apache::lonnet::getfile($fn)); |
@f2=split(/\n/,&Apache::lonnet::getfile($fn)); |
} |
} |
Line 115 sub handler {
|
Line 122 sub handler {
|
my $chunk; |
my $chunk; |
my $line; |
my $line; |
|
|
$r->print('<table border=2><tr><th>Version '.$ENV{'form.versionone'}. |
$r->print('<pre>'); |
'</th><th>Version '.$ENV{'form.versiontwo'}.'</th>'); |
|
foreach $chunk (@$diffs) { |
foreach $chunk (@$diffs) { |
$r->print('</pre></tr><tr><td><pre>'); |
|
my $presign='-'; |
|
foreach $line (@$chunk) { |
foreach $line (@$chunk) { |
my ($sign, $lineno, $text) = @$line; |
my ($sign, $lineno, $text) = @$line; |
if ($sign ne $presign) { |
|
$r->print('</pre></td><td><pre>'); |
|
$presign=$sign; |
|
} |
|
$text=~s/\</\<\;/g; |
$text=~s/\</\<\;/g; |
$text=~s/\>/\>\;/g; |
$text=~s/\>/\>\;/g; |
$lineno=substr($lineno.' ',0,8); |
$lineno=substr($lineno.' ',0,7); |
$r->print($lineno.' '.$text."\n"); |
$r->print('<font color='.(($sign eq '+')?'green':'red').'>'. |
|
$sign.' '.$lineno.' '.$text."</font>\n"); |
} |
} |
|
$r->print("<hr>\n"); |
} |
} |
|
$r->print('</pre>'); |
|
|
$r->print('</tr></table>'); |
|
} else { |
} else { |
$r->print('<h1><font color=red>Binary File</font></h1>'); |
$r->print('<h1><font color=red>Binary File</font></h1>'); |
} |
} |