version 1.13, 2008/11/24 17:17:52
|
version 1.16, 2025/02/20 03:46:11
|
Line 46 use Apache::File;
|
Line 46 use Apache::File;
|
use Apache::lontexconvert; |
use Apache::lontexconvert; |
use Apache::Constants qw(:common); |
use Apache::Constants qw(:common); |
use Apache::lonnet; |
use Apache::lonnet; |
|
use Apache::loncommon; |
|
use Apache::lonmsg; |
|
use Apache::lonlocal; |
use tth; |
use tth; |
|
|
# ================================================================ Main Handler |
# ================================================================ Main Handler |
|
|
sub footer { |
sub footer { |
my ($errorstring) = @_; |
|
my $xmlstring=''; |
my $xmlstring=''; |
if ($env{'request.state'} eq 'construct') { |
if ($env{'request.state'} eq 'construct') { |
$xmlstring.='<address>'. |
$xmlstring.='<address>'. |
Line 84 sub handler {
|
Line 86 sub handler {
|
# ------------------------------------------------------------------- Read file |
# ------------------------------------------------------------------- Read file |
|
|
{ |
{ |
my $fh=Apache::File->new($r->filename); |
if (-e $r->filename) { |
@texcontents=<$fh>; |
my $fh=Apache::File->new($r->filename); |
|
@texcontents=<$fh>; |
|
close($fh); |
|
} else { |
|
my $filename=(split('/',$r->filename))[-1]; |
|
my $error = &mt('Unable to find [_1]', |
|
'<span class="LC_filename">'.$filename.'</span>'); |
|
&Apache::loncommon::simple_error_page($r,'Not available', |
|
$error,{'no_auto_mt_msg' => 1}); |
|
return OK; |
|
} |
} |
} |
|
|
$texstring=join("\n",@texcontents); |
$texstring=join("\n",@texcontents); |
Line 103 sub handler {
|
Line 115 sub handler {
|
($env{'form.inhibitmenu'} |
($env{'form.inhibitmenu'} |
eq 'yes'), })); |
eq 'yes'), })); |
|
|
|
my $displaymode; |
|
if (&Apache::lonnet::EXT('resource.0.texdisplay') =~ /^(tth|mathjax)$/i) { |
|
$displaymode = $1; |
|
} |
|
if ($env{'form.texengine'} =~ /^(tth|mathjax)$/i) { |
|
$displaymode = $1; |
|
} |
$r->print(&Apache::lontexconvert::converted(\$texstring, |
$r->print(&Apache::lontexconvert::converted(\$texstring, |
$env{'form.texengine'})); |
$displaymode)); |
$r->print(&footer()); |
$r->print(&footer()); |
|
|
return OK; |
return OK; |