Diff for /loncom/xml/lonxml.pm between versions 1.205 and 1.211

version 1.205, 2002/10/20 18:42:53 version 1.211, 2002/11/06 22:36:08
Line 106  use Apache::lonmsg(); Line 106  use Apache::lonmsg();
 #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;
   
   # keeps count of the number of warnings and errors generated in a parse
   $warningcount=0;
   $errorcount=0;
   
 #path to the directory containing the file currently being processed  #path to the directory containing the file currently being processed
 @pwd=();  @pwd=();
   
Line 524  sub xmlparse { Line 528  sub xmlparse {
 # do we have a course style file?  # do we have a course style file?
 #  #
   
  if ($ENV{'request.course.id'}) {   if ($ENV{'request.course.id'} && $ENV{'request.state'} ne 'construct') {
      my $bodytext=       my $bodytext=
  $ENV{'course.'.$ENV{'request.course.id'}.'.default_xml_style'};   $ENV{'course.'.$ENV{'request.course.id'}.'.default_xml_style'};
      if ($bodytext) {       if ($bodytext) {
Line 837  sub callsub { Line 841  sub callsub {
   if ($token->[0] eq 'S') {    if ($token->[0] eq 'S') {
     $currentstring = $token->[4];      $currentstring = $token->[4];
     $currentstring.=&Apache::edit::handle_insert();      $currentstring.=&Apache::edit::handle_insert();
     } elsif ($token->[0] eq 'E') {
       $currentstring = $token->[2];
               $currentstring.=&Apache::edit::handle_insertafter($token->[1]);
   } else {    } else {
     $currentstring = $token->[2];      $currentstring = $token->[2];
   }    }
Line 854  sub setup_globals { Line 861  sub setup_globals {
   $Apache::lonxml::registered = 0;    $Apache::lonxml::registered = 0;
   $errorcount=0;    $errorcount=0;
   $warningcount=0;    $warningcount=0;
     $Apache::lonxml::default_homework_loaded=0;
   &init_counter();    &init_counter();
   @Apache::lonxml::pwd=();    @Apache::lonxml::pwd=();
   @Apache::lonxml::extlinks=();    @Apache::lonxml::extlinks=();
Line 955  sub init_safespace { Line 963  sub init_safespace {
   &Apache::run::run($safeinit,$safeeval);    &Apache::run::run($safeinit,$safeeval);
 }  }
   
   sub default_homework_load {
       my ($safeeval)=@_;
       &Apache::lonxml::debug('Loading default_homework');
       my $default=&Apache::lonnet::getfile('/home/httpd/html/res/adm/includes/default_homework.lcpm');
       if ($default == -1) {
    &Apache::lonxml::error("<b>Unable to find <i>default_homework.lcpm</i></b>");
       } else {
    &Apache::run::run($default,$safeeval);
    $Apache::lonxml::default_homework_loaded=1;
       }
   }
   
 sub startredirection {  sub startredirection {
   $Apache::lonxml::redirection++;    $Apache::lonxml::redirection++;
   push (@Apache::lonxml::outputstack, '');    push (@Apache::lonxml::outputstack, '');
Line 1026  sub get_all_text_unbalanced { Line 1046  sub get_all_text_unbalanced {
    } elsif ($token->[0] eq 'E')  {     } elsif ($token->[0] eq 'E')  {
      $result.=$token->[2];       $result.=$token->[2];
    }     }
    if ($result =~ /(.*)$tag(.*)/) {     if ($result =~ /(.*)\Q$tag\E(.*)/s) {
      &Apache::lonxml::debug('Got a winner with leftovers ::'.$2);       &Apache::lonxml::debug('Got a winner with leftovers ::'.$2);
      &Apache::lonxml::debug('Result is :'.$1);       &Apache::lonxml::debug('Result is :'.$1);
      $result=$1;       $result=$1;
Line 1364  sub error { Line 1384  sub error {
     &Apache::lonmsg::author_res_msg($ENV{'request.filename'},join('<br />',@_));      &Apache::lonmsg::author_res_msg($ENV{'request.filename'},join('<br />',@_));
     #notify course      #notify course
     if ( $ENV{'request.course.id'} ) {      if ( $ENV{'request.course.id'} ) {
       my $users=$ENV{'course.'.$ENV{'request.course.id'}.'.comment.email'};        my (undef,%users)=&Apache::lonfeedback::decide_receiver(undef,0,1,1,1);
       my $declutter=&Apache::lonnet::declutter($ENV{'request.filename'});        my $declutter=&Apache::lonnet::declutter($ENV{'request.filename'});
       foreach my $user (split /\,/, $users) {        foreach (keys %users) {
  ($user,my $domain) = split /:/, $user;   my ($user,$domain) = split(/:/, $_);
  &Apache::lonmsg::user_normal_msg($user,$domain,   &Apache::lonmsg::user_normal_msg($user,$domain,
         "Error [$declutter]",join('<br />',@_));          "Error [$declutter]",join('<br />',@_));
       }        }

Removed from v.1.205  
changed lines
  Added in v.1.211


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