version 1.49, 2001/01/30 21:01:36
|
version 1.53, 2001/02/14 02:57:02
|
Line 333 sub parstring {
|
Line 333 sub parstring {
|
map { |
map { |
unless ($_=~/\W/) { |
unless ($_=~/\W/) { |
my $val=$token->[2]->{$_}; |
my $val=$token->[2]->{$_}; |
if ($val =~ m/^[\%\@]/) { $val="\\".$val; } |
$val =~ s/([\%\@\\])/\\$1/g; |
|
#if ($val =~ m/^[\%\@]/) { $val="\\".$val; } |
$temp .= "my \$$_=\"$val\";" |
$temp .= "my \$$_=\"$val\";" |
} |
} |
} @{$token->[3]}; |
} @{$token->[3]}; |
Line 378 sub handler {
|
Line 379 sub handler {
|
|
|
$request->print('<body bgcolor="#FFFFFF">'."\n"); |
$request->print('<body bgcolor="#FFFFFF">'."\n"); |
|
|
my $file = "/home/httpd/html".$request->uri; |
my $file=&Apache::lonnet::filelocation("",$request->uri); |
my %mystyle; |
my %mystyle; |
my $result = ''; |
my $result = ''; |
$result = Apache::lonxml::xmlparse($target, &Apache::lonnet::getfile($file),'',%mystyle); |
my $filecontents=&Apache::lonnet::getfile($file); |
|
if ($filecontents == -1) { |
|
&Apache::lonxml::error("<b> Unable to find <i>$file</i></b>"); |
|
$filecontents=''; |
|
} else { |
|
$result = &Apache::lonxml::xmlparse($target,$filecontents,'',%mystyle); |
|
} |
$request->print($result); |
$request->print($result); |
|
|
|
|
$request->print('</body>'); |
$request->print('</body>'); |
$request->print(&Apache::lontexconvert::footer()); |
$request->print(&Apache::lontexconvert::footer()); |
writeallows($request->uri); |
writeallows($request->uri); |
Line 398 sub debug {
|
Line 406 sub debug {
|
} |
} |
|
|
sub error { |
sub error { |
print "ERROR:".$_[0]."<br>\n"; |
if ($Apache::lonxml::debug eq 1) { |
|
print "ERROR:".$_[0]."<br>\n"; |
|
} else { |
|
print "<b>An Error occured while processing this resource. The instructor has been notified.</b> <br />"; |
|
#notify author |
|
&Apache::lonmsg::author_res_msg($ENV{'request.filename'},$_[0]); |
|
#notify course |
|
if ( $ENV{'request.course.id'} ) { |
|
my $users=$ENV{'course.'.$ENV{'request.course.id'}.'.comment.email'}; |
|
foreach my $user (split /\,/, $users) { |
|
($user,my $domain) = split /:/, $user; |
|
&Apache::lonmsg::user_crit_msg($user,$domain,"Error in $ENV{'request.filename'}",$_[0]); |
|
} |
|
} |
|
|
|
#FIXME probably shouldn't have me get everything forever. |
|
&Apache::lonmsg::user_crit_msg('albertel','msu',"Error in $ENV{'request.filename'}",$_[0]); |
|
#&Apache::lonmsg::user_crit_msg('albertel','103',"Error in $ENV{'request.filename'}",$_[0]); |
|
} |
} |
} |
|
|
sub warning { |
sub warning { |
Line 409 sub warning {
|
Line 435 sub warning {
|
|
|
1; |
1; |
__END__ |
__END__ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|