Diff for /loncom/homework/edit.pm between versions 1.79 and 1.80

version 1.79, 2004/02/13 21:12:54 version 1.80, 2004/02/17 22:02:43
Line 703  ENDSELECTORTYPE Line 703  ENDSELECTORTYPE
 #----------------------------------------------------- image coordinates  #----------------------------------------------------- image coordinates
 # single image coordinates, x, y   # single image coordinates, x, y 
 sub entercoords {  sub entercoords {
     my ($idx,,$idy,$mode,$width,$height) = @_;      my ($idx,$idy,$mode,$width,$height) = @_;
     unless ($Apache::edit::bgimgsrc) { return ''; }      unless ($Apache::edit::bgimgsrc) { return ''; }
     if ($idx) { $idx.='_'; }      if ($idx) { $idx.='_'; }
     if ($idy) { $idy.='_'; }      if ($idy) { $idy.='_'; }
     my $bgfile=&Apache::lonnet::escape($Apache::edit::bgimgsrc);      my $bgfile=&Apache::lonnet::escape(&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc));
     my $form    = 'lonhomework';      my $form    = 'lonhomework';
     my $element;      my $element;
     if (! defined($mode) || $mode eq 'attribute') {      if (! defined($mode) || $mode eq 'attribute') {
Line 716  sub entercoords { Line 716  sub entercoords {
         $element = &Apache::lonnet::escape('homework_edit_'.          $element = &Apache::lonnet::escape('homework_edit_'.
                                            $Apache::lonxml::curdepth);                                             $Apache::lonxml::curdepth);
     }      }
     my $formheight='';      my $id=$Apache::lonxml::curdepth;
       my %data=("imagechoice.$id.type"      =>'point',
         "imagechoice.$id.formname"  =>$form,
         "imagechoice.$id.formx"     =>"$idx$element",
         "imagechoice.$id.formy"     =>"$idy$element",
         "imagechoice.$id.file"      =>$bgfile,
         "imagechoice.$id.formcoord" =>$element);
     if ($height) {      if ($height) {
  $formheight='&formheight='.$height.'_'.$Apache::edit::bgimgsrccurdepth;   $data{"imagechoice.$id.formheight"}=$height.'_'.
       $Apache::edit::bgimgsrccurdepth;
     }      }
     my $formwidth='';  
     if ($width) {      if ($width) {
  $formwidth='&formwidth='.$width.'_'.$Apache::edit::bgimgsrccurdepth;   $data{"imagechoice.$id.formwidth"}=$width.'_'.
       $Apache::edit::bgimgsrccurdepth;
     }      }
     my $result = <<"ENDBUTTON";      &Apache::lonnet::appenv(%data);
 <a href="/cgi-bin/imagechoice.pl?formname=$form&file=$bgfile&formx=$idx$element&formy=$idy$element$formheight$formwidth"      my $text="Click Coordinates";
 target="imagechoice">Click Coordinates</a>      my $result='<a href="/adm/imagechoice?token='.$id.'" target="imagechoice">'.$text.'</a>';
 ENDBUTTON  
     return $result;      return $result;
 }  }
   
Line 737  sub entercoord { Line 743  sub entercoord {
     my ($idx,$mode,$width,$height,$type) = @_;      my ($idx,$mode,$width,$height,$type) = @_;
     unless ($Apache::edit::bgimgsrc) { return ''; }      unless ($Apache::edit::bgimgsrc) { return ''; }
     my $bgfile=&Apache::lonnet::escape(&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc));      my $bgfile=&Apache::lonnet::escape(&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc));
     &Apache::lonnet::logthis($Apache::edit::bgfile);  
     my $form    = 'lonhomework';      my $form    = 'lonhomework';
     my $element;      my $element;
     if (! defined($mode) || $mode eq 'attribute') {      if (! defined($mode) || $mode eq 'attribute') {

Removed from v.1.79  
changed lines
  Added in v.1.80


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>