version 1.107, 2005/05/16 21:58:41
|
version 1.108, 2005/05/31 22:15:32
|
Line 39 use Apache::lonnet;
|
Line 39 use Apache::lonnet;
|
|
|
use vars qw/$weboutputformat $versionstring/; |
use vars qw/$weboutputformat $versionstring/; |
|
|
|
# |
|
# This variable allows a callback to be registered |
|
# if a gnuplot tag block is performed. |
|
# |
|
my $notify_callback; |
|
|
BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::lonplot',('gnuplot')); |
&Apache::lonxml::register('Apache::lonplot',('gnuplot')); |
# |
# |
Line 48 BEGIN {
|
Line 54 BEGIN {
|
if ($versionstring =~ /^gnuplot 4/) { |
if ($versionstring =~ /^gnuplot 4/) { |
$weboutputformat = 'png'; |
$weboutputformat = 'png'; |
} |
} |
|
$notify_callback = undef; |
|
|
|
} |
|
|
|
# register_callback(\&callback) |
|
# Arranges for callback to be invoked on the </gnuplot> |
|
# tag. |
|
# |
|
sub register_callback { |
|
$notify_callback = shift; |
|
} |
|
# clear_callback(); |
|
# Undefs the callback. |
|
# |
|
sub clear_callback { |
|
$notify_callback = undef; |
|
} |
|
# invoke_callback() |
|
# Invokes the callback if defined |
|
# |
|
sub invoke_callback { |
|
if (defined $notify_callback) { |
|
&$notify_callback(); |
|
} |
} |
} |
|
|
## |
## |
Line 540 ENDIMAGE
|
Line 570 ENDIMAGE
|
} elsif ($target eq 'edit') { |
} elsif ($target eq 'edit') { |
$result.=&Apache::edit::tag_end($target,$token); |
$result.=&Apache::edit::tag_end($target,$token); |
} |
} |
|
&invoke_callback(); |
return $result; |
return $result; |
} |
} |
|
|