Diff for /loncom/xml/londefdef.pm between versions 1.117 and 1.118

version 1.117, 2003/02/18 22:19:30 version 1.118, 2003/02/19 14:30:10
Line 44 Line 44
   
 package Apache::londefdef;   package Apache::londefdef; 
   
 use Apache::lonnet;  use Apache::lonnet();
 use strict;  use strict;
 use Apache::lonxml;  use Apache::lonxml();
 use Apache::File();  use Apache::File();
 use Image::Magick;  use Image::Magick;
 use Apache::lonmenu;  use Apache::lonmenu();
 #use Apache::lonmeta;  use Apache::lonmeta();
   
 BEGIN {  BEGIN {
   
Line 1797  sub start_allow { Line 1797  sub start_allow {
     $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=      $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=
  $token->[2]->{'src'};   $token->[2]->{'src'};
     my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval,undef,1);      my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval,undef,1);
       $src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src);
     &image_replication($src);      &image_replication($src);
     my $result;      my $result;
     if ($target eq 'edit') {      if ($target eq 'edit') {
Line 2612  sub end_allow { Line 2613  sub end_allow {
   
 sub image_replication {  sub image_replication {
     my $src = shift;      my $src = shift;
     if (not -e '/home/httpd/html'.$src) {      if (not -e $src) {
  #replicates image itself   #replicates image itself
  &Apache::lonnet::repcopy('/home/httpd/html'.$src);   &Apache::lonnet::repcopy($src);
  #replicates eps or ps    #replicates eps or ps 
  my $newsrc = $src;   my $newsrc = $src;
  $newsrc =~ s/\.(gif|jpg|png)$/.eps/;   $newsrc =~ s/\.(gif|jpg|jpeg|png)$/.eps/i;
  if (not-e $newsrc && &Apache::lonnet::repcopy('/home/httpd/html'.$newsrc) ne 'OK') {   if (not -e $newsrc) {
     $newsrc =~ s/\.eps$/\.ps/;             if (&Apache::lonnet::repcopy($newsrc) ne 'OK') {
     &Apache::lonnet::repcopy('/home/httpd/html'.$newsrc);         $newsrc =~ s/\.eps$/\.ps/;
          &Apache::lonnet::repcopy($newsrc);
      }
  }   }
     }      }
     return '';      return '';

Removed from v.1.117  
changed lines
  Added in v.1.118


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