--- loncom/homework/drawimage.pm 2004/09/09 07:24:56 1.7 +++ loncom/homework/drawimage.pm 2008/03/12 02:46:52 1.10 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # programatic image drawing # -# $Id: drawimage.pm,v 1.7 2004/09/09 07:24:56 albertel Exp $ +# $Id: drawimage.pm,v 1.10 2008/03/12 02:46:52 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -29,6 +29,9 @@ package Apache::drawimage; use strict; use Apache::loncommon; +use lib '/home/httpd/lib/perl/'; +use LONCAPA; + my %args; my $cgi_id; @@ -61,7 +64,7 @@ sub end_drawimage { src='/adm/randomlabel.png?token=$cgi_id' />\n"; $args{"cgi.$cgi_id.SIZE"}=join(':',($width,$height)); $args{"cgi.$cgi_id.BGCOLOR"}=join(':',($bgcolor)); - &Apache::lonnet::appenv(%args); + &Apache::lonnet::appenv(\%args); if (@cgi_ids) { $cgi_id=pop(@cgi_ids); } else { @@ -96,7 +99,7 @@ sub end_text { my $color = &Apache::lonxml::get_param('color',$parstack,$safeeval); my $direction = &Apache::lonxml::get_param('direction',$parstack,$safeeval); my $text = &Apache::lonxml::endredirection(); - $text = &Apache::lonnet::escape($text); + $text = &escape($text); $args{"cgi.$cgi_id.OBJTYPE"}.='LABEL:'; my $i=$args{"cgi.$cgi_id.OBJCOUNT"}++; $args{"cgi.$cgi_id.OBJ$i"}=join(':',($x,$y,$text,$font,$color,$direction)); @@ -262,7 +265,6 @@ sub end_image { my $result; if ($target eq 'web' || $target eq 'tex') { my $bgimg=&Apache::lonxml::endredirection(); - &Apache::lonnet::logthis("image $bgimg"); my $x = &Apache::lonxml::get_param('x',$parstack,$safeeval); my $y = &Apache::lonxml::get_param('y',$parstack,$safeeval); my $clipx = &Apache::lonxml::get_param('clipx',$parstack,$safeeval); @@ -278,11 +280,10 @@ sub end_image { my $transparent = &Apache::lonxml::get_param('transparent',$parstack,$safeeval); $bgimg=&Apache::imageresponse::clean_up_image($bgimg); - &Apache::lonnet::logthis("image af clean $bgimg"); my $i=$args{"cgi.$cgi_id.OBJCOUNT"}++; $args{"cgi.$cgi_id.OBJTYPE"}.='IMAGE:'; $args{"cgi.$cgi_id.OBJ$i"} = - join(':',($x,$y,&Apache::lonnet::escape($bgimg),$transparent, + join(':',($x,$y,&escape($bgimg),$transparent, $clipx,$clipy,$scaledwidth,$scaledheight,$clipwidth,$clipheight)); } return $result;