version 1.12, 2005/02/02 20:08:05
|
version 1.15, 2005/05/25 22:31:51
|
Line 34 use strict;
|
Line 34 use strict;
|
### For standalone operation, set $loncapa to 0, and comment out both uses |
### For standalone operation, set $loncapa to 0, and comment out both uses |
my $loncapa=1; |
my $loncapa=1; |
use lib '/home/httpd/lib/perl'; |
use lib '/home/httpd/lib/perl'; |
use LONCAPA::loncgi(); |
use LONCAPA::loncgi; |
|
|
|
|
use GD; |
use GD; |
Line 66 sub unescape {
|
Line 66 sub unescape {
|
my ($id,$width,$ps,$png,@JMEstring); |
my ($id,$width,$ps,$png,@JMEstring); |
if ($loncapa) { |
if ($loncapa) { |
$id=$ENV{'QUERY_STRING'}; |
$id=$ENV{'QUERY_STRING'}; |
$width = $ENV{'cgi.'.$id.'.WIDTH'}; |
$width = $Apache::lonnet::env{'cgi.'.$id.'.WIDTH'}; |
if (!$width) { $width = 400; } |
if (!$width) { $width = 400; } |
$png = $ENV{'cgi.'.$id.'.PNG'}; |
$png = $Apache::lonnet::env{'cgi.'.$id.'.PNG'}; |
$ps = $ENV{'cgi.'.$id.'.PS'}; |
$ps = $Apache::lonnet::env{'cgi.'.$id.'.PS'}; |
@JMEstring=&unescape($ENV{'cgi.'.$id.'.JME'}); |
@JMEstring=&unescape($Apache::lonnet::env{'cgi.'.$id.'.JME'}); |
} else { |
} else { |
@JMEstring = @ARGV; |
@JMEstring = @ARGV; |
$width = shift @JMEstring; |
$width = shift @JMEstring; |
Line 396 foreach my $struct (@all_structs) {
|
Line 396 foreach my $struct (@all_structs) {
|
(shift @formula) =~ /([A-Z][a-z]?)(\d*)/; |
(shift @formula) =~ /([A-Z][a-z]?)(\d*)/; |
my $carrige = $x[$i]-stringWidth($1)/2; |
my $carrige = $x[$i]-stringWidth($1)/2; |
$carrige = printElement ($1,$2,$carrige,$y[$i]); |
$carrige = printElement ($1,$2,$carrige,$y[$i]); |
my $y = (@formula > 0) ? $y[$i] + fm2cm(800) : $y[$i]; |
my $y = (@formula > 0) ? $y[$i] + fm2cm(900) : $y[$i]; |
$carrige = |
$carrige = |
(@formula > 0) ? $x[$i]-stringWidth($1)/2 : $carrige; |
(@formula > 0) ? $x[$i]-stringWidth($1)/2 : $carrige; |
foreach (@formula) { |
foreach (@formula) { |
Line 409 foreach my $struct (@all_structs) {
|
Line 409 foreach my $struct (@all_structs) {
|
(shift @formula) =~ /([A-Z][a-z]?)(\d*)/; |
(shift @formula) =~ /([A-Z][a-z]?)(\d*)/; |
my $carrige = $x[$i]-stringWidth($1)/2; |
my $carrige = $x[$i]-stringWidth($1)/2; |
$carrige = printElement ($1,$2,$carrige,$y[$i]); |
$carrige = printElement ($1,$2,$carrige,$y[$i]); |
my $y = (@formula > 0) ? $y[$i] + fm2cm(-800) : $y[$i]; |
my $y = (@formula > 0) ? $y[$i] + fm2cm(-900) : $y[$i]; |
$carrige = |
$carrige = |
(@formula > 0) ? $x[$i]-stringWidth($1)/2 : $carrige; |
(@formula > 0) ? $x[$i]-stringWidth($1)/2 : $carrige; |
foreach (@formula) { |
foreach (@formula) { |