--- loncom/interface/londocs.pm 2005/02/21 00:32:45 1.168 +++ loncom/interface/londocs.pm 2005/03/10 02:34:58 1.170 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.168 2005/02/21 00:32:45 www Exp $ +# $Id: londocs.pm,v 1.170 2005/03/10 02:34:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1489,7 +1489,7 @@ sub checkonthis { if ($url=~/^\/res\//) { my $result=&Apache::lonnet::repcopy( &Apache::lonnet::filelocation('',$url)); - if ($result==OK) { + if ($result eq 'OK') { $r->print(''.&mt('ok').''); $r->rflush(); &Apache::lonnet::countacc($url); @@ -1501,23 +1501,19 @@ sub checkonthis { $r->print(' '); } $r->print('- '.&mt('Rendering').': '); - my $oldpath=$ENV{'request.filename'}; - $ENV{'request.filename'}=&Apache::lonnet::filelocation('',$url); - &Apache::lonxml::xmlparse($r,'web', - &Apache::lonnet::getfile( - &Apache::lonnet::filelocation('',$url))); - undef($Apache::lonhomework::parsing_a_problem); - $ENV{'request.filename'}=$oldpath; - if (($Apache::lonxml::errorcount) || - ($Apache::lonxml::warningcount)) { - if ($Apache::lonxml::errorcount) { + my ($errorcount,$warningcount)=split(/:/, + &Apache::lonnet::ssi_body($url, + ('return_only_error_and_warning_counts' => 1))); + if (($errorcount) || + ($warningcount)) { + if ($errorcount) { $r->print(''. - $Apache::lonxml::errorcount.' '. + $errorcount.' '. &mt('error(s)').' '); } - if ($Apache::lonxml::warningcount) { + if ($warningcount) { $r->print(''. - $Apache::lonxml::warningcount.' '. + $warningcount.' '. &mt('warning(s)').''); } } else { @@ -1532,9 +1528,9 @@ sub checkonthis { &checkonthis($r,$_,$level+1); } } - } elsif ($result==HTTP_SERVICE_UNAVAILABLE) { + } elsif ($result eq 'HTTP_SERVICE_UNAVAILABLE') { $r->print(''.&mt('connection down').''); - } elsif ($result==HTTP_NOT_FOUND) { + } elsif ($result eq 'HTTP_NOT_FOUND') { unless ($url=~/\$/) { $r->print(''.&mt('not found').''); } else {