version 1.107, 2007/06/19 19:41:52
|
version 1.112, 2007/10/03 00:24:48
|
Line 597 sub textarea_sizes {
|
Line 597 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 619 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 672 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 686 sub rebuild_tag {
|
Line 690 sub rebuild_tag {
|
my $result; |
my $result; |
if ($token->[0] eq 'S') { |
if ($token->[0] eq 'S') { |
$result = '<'.$token->[1]; |
$result = '<'.$token->[1]; |
while (my ($key,$val)= each(%{$token->[2]})) { |
foreach my $attribute (@{ $token->[3] }) { |
$val=~s:^\s+|\s+$::g; |
my $value = $token->[2]{$attribute}; |
$val=~s:"::g; #" |
next if ($value eq ''); |
&Apache::lonxml::debug("setting :$key: to :$val:"); |
$value =~s/^\s+|\s+$//g; |
$result.=' '.$key.'="'.$val.'"'; |
$value =~s/\"//g; |
|
&Apache::lonxml::debug("setting :$attribute: to :$value:"); |
|
$result.=' '.$attribute.'="'.$value.'"'; |
} |
} |
if ($token->[4] =~ m:/>$:) { |
if ($token->[4] =~ m:/>$:) { |
$result.=' />'; |
$result.=' />'; |
Line 932 sub browse {
|
Line 938 sub browse {
|
my $titleelement; |
my $titleelement; |
if ($titleid) { |
if ($titleid) { |
$titleelement=",'$only','','".&escape("$titleid\_$Apache::lonxml::curdepth")."'"; |
$titleelement=",'$only','','".&escape("$titleid\_$Apache::lonxml::curdepth")."'"; |
|
} else { |
|
$titleelement=",'$only'"; |
} |
} |
my $result = <<"ENDBUTTON"; |
my $result = <<"ENDBUTTON"; |
<a href=\"javascript:openbrowser('$form','$element'$titleelement)\"\>Select</a> |
<a href=\"javascript:openbrowser('$form','$element'$titleelement)\"\>Select</a> |