version 1.81, 2004/03/30 08:20:49
|
version 1.84, 2004/06/08 01:32:01
|
Line 25
|
Line 25
|
# |
# |
# http://www.lon-capa.org/ |
# http://www.lon-capa.org/ |
# |
# |
# 3/20 Guy |
|
# 01/10/02 Matthew |
|
# 03/06/02 Matthew |
|
package Apache::edit; |
package Apache::edit; |
|
|
use strict; |
use strict; |
Line 486 END
|
Line 484 END
|
} |
} |
|
|
sub editfield { |
sub editfield { |
my ($tag,$data,$description,$minwidth,$minheight)=@_; |
my ($tag,$data,$description,$minwidth,$minheight,$usehtmlarea)=@_; |
|
|
my ($rows,$cols)=&textarea_sizes(\$data); |
my ($rows,$cols)=&textarea_sizes(\$data); |
|
if (&Apache::lonhtmlcommon::htmlareabrowser() && |
|
!&Apache::lonhtmlcommon::htmlareablocked()) { |
|
$rows+=7; # make room for HTMLarea |
|
$minheight+=7; # make room for HTMLarea |
|
} |
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="<br />".$description."<br />"; } |
|
if ($usehtmlarea) { |
|
push @Apache::lonxml::htmlareafields,'homework_edit_'. |
|
$Apache::lonxml::curdepth; |
|
} |
return $description."\n".' <textarea rows="'.$rows. |
return $description."\n".' <textarea rows="'.$rows. |
'" cols="'.$cols.'" name="homework_edit_'. |
'" cols="'.$cols.'" name="homework_edit_'. |
|
$Apache::lonxml::curdepth.'" id="homework_edit_'. |
$Apache::lonxml::curdepth.'">'. |
$Apache::lonxml::curdepth.'">'. |
&HTML::Entities::encode($data,'<>&"').'</textarea>'."\n"; |
&HTML::Entities::encode($data,'<>&"').'</textarea>'."\n"; |
} |
} |