version 1.110, 2001/08/10 16:22:23
|
version 1.116, 2001/08/16 11:25:03
|
Line 13
|
Line 13
|
# 6/12,6/13 H. K. Ng |
# 6/12,6/13 H. K. Ng |
# 6/16 Gerd Kortemeyer |
# 6/16 Gerd Kortemeyer |
# 7/27 H. K. Ng |
# 7/27 H. K. Ng |
# 8/7,8/9,8/10 Gerd Kortemeyer |
# 8/7,8/9,8/10,8/11,8/15,8/16 Gerd Kortemeyer |
|
|
package Apache::lonxml; |
package Apache::lonxml; |
use vars |
use vars |
Line 152 sub xmlend {
|
Line 152 sub xmlend {
|
return $discussion.'</html>'; |
return $discussion.'</html>'; |
} |
} |
|
|
|
sub maketoken { |
|
my ($target,$symb,$tuname,$tudom,$tcrsid)=@_; |
|
unless ($symb) { |
|
$symb=&Apache::lonnet::symbread(); |
|
} |
|
unless ($tuname) { |
|
$tuname=$ENV{'user.name'}; |
|
$tudom=$ENV{'user.domain'}; |
|
$tcrsid=$ENV{'request.course.id'}; |
|
} |
|
|
|
my $token=&Apache::lonnet::checkout($symb,$tuname,$tudom,$tcrsid); |
|
|
|
unless ($token) { return ''; } |
|
|
|
my %reply=&Apache::lonnet::get('environment', |
|
['firstname','middlename','lastname','generation'], |
|
$tudom,$tuname); |
|
my $plainname=$reply{'firstname'}.' '. |
|
$reply{'middlename'}.' '. |
|
$reply{'lastname'}.' '. |
|
$reply{'generation'}; |
|
|
|
if ($target eq 'web') { |
|
return |
|
'<img align="right" src="/cgi-bin/barcode.gif?encode='.$token.'" />'. |
|
'Checked out for '.$plainname. |
|
'<br />User: '.$tuname.' at '.$tudom. |
|
'<br />CourseID: '.$tcrsid.')'. |
|
'<br />DocID: '.$token. |
|
'<br />Time: '.localtime().'<hr />'; |
|
} else { |
|
return $token; |
|
} |
|
} |
|
|
sub fontsettings() { |
sub fontsettings() { |
my $headerstring=''; |
my $headerstring=''; |
if (($ENV{'browser.os'} eq 'mac') && (!$ENV{'browser.mathml'})) { |
if (($ENV{'browser.os'} eq 'mac') && (!$ENV{'browser.mathml'})) { |
Line 325 sub htmlclean {
|
Line 361 sub htmlclean {
|
|
|
my $output= $tree->as_HTML(undef,' '); |
my $output= $tree->as_HTML(undef,' '); |
|
|
$output=~s/\<(br|hr|img)([^\>\/]*)\>/\<$1$2 \/\>/gis; |
$output=~s/\<(br|hr|img|meta|allow)([^\>\/]*)\>/\<$1$2 \/\>/gis; |
$output=~s/\<\/(br|hr|img)\>//gis; |
$output=~s/\<\/(br|hr|img|meta|allow)\>//gis; |
unless ($full) { |
unless ($full) { |
$output=~s/\<[\/]*(body|head|html)\>//gis; |
$output=~s/\<[\/]*(body|head|html)\>//gis; |
} |
} |
Line 777 sub parstring {
|
Line 813 sub parstring {
|
|
|
sub writeallows { |
sub writeallows { |
my $thisurl='/res/'.&Apache::lonnet::declutter(shift); |
my $thisurl='/res/'.&Apache::lonnet::declutter(shift); |
|
if ($ENV{'httpref.'.$thisurl}) { |
|
$thisurl=$ENV{'httpref.'.$thisurl}; |
|
} |
my $thisdir=$thisurl; |
my $thisdir=$thisurl; |
$thisdir=~s/\/[^\/]+$//; |
$thisdir=~s/\/[^\/]+$//; |
my %httpref=(); |
my %httpref=(); |