Diff for /loncom/xml/lonxml.pm between versions 1.78 and 1.79

version 1.78, 2001/05/26 15:31:33 version 1.79, 2001/05/26 17:27:28
Line 35  use Apache::run; Line 35  use Apache::run;
 use Apache::londefdef;  use Apache::londefdef;
 use Apache::scripttag;  use Apache::scripttag;
 use Apache::edit;  use Apache::edit;
   use Apache::lonnet;
   use Apache::File;
   
 #==================================================   Main subroutine: xmlparse    #==================================================   Main subroutine: xmlparse  
 #debugging control, to turn on debugging modify the correct handler  #debugging control, to turn on debugging modify the correct handler
 $Apache::lonxml::debug=0;  $Apache::lonxml::debug=0;
Line 571  ENDSCRIPT Line 574  ENDSCRIPT
     return $result;      return $result;
 }  }
   
   sub storefile {
       my ($file,$contents)=@_;
       if (my $fh=Apache::File->new('>'.$file)) {
    print $fh $contents;
           $fh->close();
       }
   }
   
 sub inserteditinfo {  sub inserteditinfo {
       my ($result,$filecontents)=@_;        my ($result,$filecontents)=@_;
       unless ($filecontents) {        unless ($filecontents) {
Line 621  sub handler { Line 632  sub handler {
       
   return OK if $request->header_only;    return OK if $request->header_only;
   
   
     my $file=&Apache::lonnet::filelocation("",$request->uri);
 #  #
 # Edit action? Save file.  # Edit action? Save file.
 #  #
   unless ($ENV{'request.state'} eq 'published') {    unless ($ENV{'request.state'} eq 'published') {
       if ($ENV{'form.savethisfile'}) {        if ($ENV{'form.savethisfile'}) {
     &storefile($file,$ENV{'form.filecont'});
       }        }
   }    }
   
   my $file=&Apache::lonnet::filelocation("",$request->uri);  
   my %mystyle;    my %mystyle;
   my $result = '';     my $result = ''; 
   my $filecontents=&Apache::lonnet::getfile($file);    my $filecontents=&Apache::lonnet::getfile($file);

Removed from v.1.78  
changed lines
  Added in v.1.79


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