Diff for /loncom/publisher/londiff.pm between versions 1.17 and 1.19

version 1.17, 2005/05/29 01:46:16 version 1.19, 2006/05/17 13:41:45
Line 32  package Apache::londiff; Line 32  package Apache::londiff;
 use strict;  use strict;
 use Apache::File;  use Apache::File;
 use File::Copy;  use File::Copy;
   use File::Compare;
 use Algorithm::Diff qw(diff);  use Algorithm::Diff qw(diff);
 use Apache::Constants qw(:common :http :methods);  use Apache::Constants qw(:common :http :methods);
 use Apache::loncacc;  use Apache::loncacc;
Line 44  sub get_split_file { Line 45  sub get_split_file {
     my ($fn,$style)=@_;      my ($fn,$style)=@_;
     my $f1;      my $f1;
     my @f1;      my @f1;
     if ($style='local') {      if ($style eq 'local') {
  if (-e $fn) {   if (-e $fn) {
     my $fh=Apache::File->new($fn);      my $fh=Apache::File->new($fn);
     my $line;      my $line;
Line 66  sub get_split_file { Line 67  sub get_split_file {
     return @f1;      return @f1;
 }  }
   
   sub are_different_files {
       my ($fileone,$filetwo)=@_;
       return &compare($fileone,$filetwo);
   }
   
 sub handler {  sub handler {
   
   my $r=shift;    my $r=shift;
Line 104  sub handler { Line 110  sub handler {
   &Apache::loncommon::content_type($r,'text/html');    &Apache::loncommon::content_type($r,'text/html');
   $r->send_http_header;    $r->send_http_header;
   
   $r->print('<html><head><title>LON-CAPA Construction Diffs</title></head>');    $r->print(&Apache::loncommon::start_page('Resource Differences'));
   
   $r->print(&Apache::loncommon::bodytag('Resource Differences'));  
   
       
   $r->print('<h1>'.($env{'form.filetwo'}?'':&mt('Compare versions of')).    $r->print('<h1>'.($env{'form.filetwo'}?'':&mt('Compare versions of')).
Line 126  sub handler { Line 130  sub handler {
  $r->print('<b>'.&mt('Construction Space Version').'</b>');   $r->print('<b>'.&mt('Construction Space Version').'</b>');
      } else {       } else {
  my $fn=   my $fn=
      '/home/httpd/html//res/'.$cudom.'/'.$cuname.'/';       '/home/httpd/html/res/'.$cudom.'/'.$cuname.'/';
  if ($env{'form.versionone'}) {   if ($env{'form.versionone'}) {
      my ($main,$suffix)=($efn=~/^(.+)\.(\w+)$/);       my ($main,$suffix)=($efn=~/^(.+)\.(\w+)$/);
      $fn.=$main.'.'.$env{'form.versionone'}.'.'.$suffix;       $fn.=$main.'.'.$env{'form.versionone'}.'.'.$suffix;
Line 192  sub handler { Line 196  sub handler {
  } else {   } else {
      $r->print('<h1><font color=red>'.&mt('Binary File').'</font></h1>');       $r->print('<h1><font color=red>'.&mt('Binary File').'</font></h1>');
  }   }
   $r->print('<center><a href="javascript:window.close();">'.&mt('Close This Window').'</a></center></body></html>');     $r->print('<center><a href="javascript:window.close();">'.&mt('Close This Window').'</a></center>');
     $r->print(&Apache::loncommon::end_page()); 
   return OK;      return OK;  
 }  }
   

Removed from v.1.17  
changed lines
  Added in v.1.19


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>