Diff for /loncom/homework/edit.pm between versions 1.110 and 1.115

version 1.110, 2007/09/07 00:39:21 version 1.115, 2008/08/26 03:18:29
Line 128  sub end_table { Line 128  sub end_table {
     return $result;      return $result;
 }  }
   
 sub start_spanning_row { return '<tr><td colspan="4" bgcolor="#DDDDDD">';}  sub start_spanning_row { return '<tr><td colspan="5" bgcolor="#DDDDDD">';}
 sub start_row          { return '<tr><td bgcolor="#DDDDDD">';            }  sub start_row          { return '<tr><td bgcolor="#DDDDDD">';            }
 sub end_row            { return '</td></tr>';          }  sub end_row            { return '</td></tr>';          }
   
Line 577  sub element_change_detection { Line 577  sub element_change_detection {
 }  }
   
 sub submit_ask_anyway {  sub submit_ask_anyway {
     return ' onclick="still_ask=true;" ';      my ($extra_action) = @_;
       return ' onclick="still_ask=true;'.$extra_action.'" ';
 }  }
   
 sub textarea_sizes {  sub textarea_sizes {
Line 597  sub textarea_sizes { Line 598  sub textarea_sizes {
 sub editline {  sub editline {
     my ($tag,$data,$description,$size)=@_;      my ($tag,$data,$description,$size)=@_;
     $data=&HTML::Entities::encode($data,'<>&"');      $data=&HTML::Entities::encode($data,'<>&"');
     if ($description) { $description="<br />".$description."<br />"; }      if ($description) { $description=$description."<br />"; }
     my $change_code = &element_change_detection();      my $change_code = &element_change_detection();
     my $result = <<"END";      my $result = <<"END";
 $description  $description
Line 619  sub editfield { Line 620  sub editfield {
     if ($cols > 80) { $cols = 80; }      if ($cols > 80) { $cols = 80; }
     if ($cols < $minwidth ) { $cols = $minwidth; }      if ($cols < $minwidth ) { $cols = $minwidth; }
     if ($rows < $minheight) { $rows = $minheight; }      if ($rows < $minheight) { $rows = $minheight; }
     if ($description) { $description="<br />".$description."<br />"; }      if ($description) { $description=$description."<br />"; }
     if ($usehtmlarea) {      if ($usehtmlarea) {
  &Apache::lonhtmlcommon::add_htmlareafields('homework_edit_'.   &Apache::lonhtmlcommon::add_htmlareafields('homework_edit_'.
    $Apache::lonxml::curdepth);     $Apache::lonxml::curdepth);
Line 672  sub get_new_args { Line 673  sub get_new_args {
  $token->[2]->{$arg}=$newvalue;   $token->[2]->{$arg}=$newvalue;
     }      }
     $rebuild=1;      $rebuild=1;
       # add new attributes to the of the attribute seq
       if (!grep { $arg eq $_ } (@{ $token->[3] })) {
    push(@{ $token->[3] },$arg);
       }
  } elsif (!defined($newvalue) && defined($value)) {   } elsif (!defined($newvalue) && defined($value)) {
     delete($token->[2]->{$arg});      delete($token->[2]->{$arg});
     $rebuild=1;      $rebuild=1;
Line 688  sub rebuild_tag { Line 693  sub rebuild_tag {
  $result = '<'.$token->[1];   $result = '<'.$token->[1];
  foreach my $attribute (@{ $token->[3] }) {   foreach my $attribute (@{ $token->[3] }) {
     my $value = $token->[2]{$attribute};      my $value = $token->[2]{$attribute};
       next if ($value eq '');
     $value =~s/^\s+|\s+$//g;      $value =~s/^\s+|\s+$//g;
     $value =~s/\"//g;      $value =~s/\"//g;
     &Apache::lonxml::debug("setting :$attribute: to  :$value:");      &Apache::lonxml::debug("setting :$attribute: to  :$value:");
Line 874  sub entercoords { Line 880  sub entercoords {
  $data{"imagechoice.$id.formwidth"}=$width.'_'.   $data{"imagechoice.$id.formwidth"}=$width.'_'.
     $Apache::edit::bgimgsrccurdepth;      $Apache::edit::bgimgsrccurdepth;
     }      }
     &Apache::lonnet::appenv(%data);      &Apache::lonnet::appenv(\%data);
     my $text="Click Coordinates";      my $text="Click Coordinates";
     my $result='<a href="/adm/imagechoice?token='.$id.'" target="imagechoice">'.$text.'</a>';      my $result='<a href="/adm/imagechoice?token='.$id.'" target="imagechoice">'.$text.'</a>';
     return $result;      return $result;
Line 907  sub entercoord { Line 913  sub entercoord {
  $data{"imagechoice.$id.formwidth"}=$width.'_'.   $data{"imagechoice.$id.formwidth"}=$width.'_'.
     $Apache::edit::bgimgsrccurdepth;      $Apache::edit::bgimgsrccurdepth;
     }      }
     &Apache::lonnet::appenv(%data);      &Apache::lonnet::appenv(\%data);
     my $text="Enter Coordinates";      my $text="Enter Coordinates";
     if ($type eq 'polygon') { $text='Create Polygon Data'; }      if ($type eq 'polygon') { $text='Create Polygon Data'; }
     my $result='<a href="/adm/imagechoice?token='.$id.'" target="imagechoice">'.$text.'</a>';      my $result='<a href="/adm/imagechoice?token='.$id.'" target="imagechoice">'.$text.'</a>';

Removed from v.1.110  
changed lines
  Added in v.1.115


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