version 1.68, 2003/10/24 21:09:24
|
version 1.71, 2003/11/05 21:53:48
|
Line 33 package Apache::edit;
|
Line 33 package Apache::edit;
|
use strict; |
use strict; |
use Apache::lonnet(); |
use Apache::lonnet(); |
use HTML::Entities(); |
use HTML::Entities(); |
|
use Apache::lonlocal; |
|
|
# Global Vars |
# Global Vars |
# default list of colors to use in editing |
# default list of colors to use in editing |
Line 273 sub handle_insertafter {
|
Line 274 sub handle_insertafter {
|
return $result; |
return $result; |
} |
} |
|
|
|
sub insert_img { |
|
return ' |
|
<img />'; |
|
} |
|
|
sub insert_responseparam { |
sub insert_responseparam { |
return ' |
return ' |
<responseparam />'; |
<responseparam />'; |
Line 477 sub editfield {
|
Line 483 sub editfield {
|
} |
} |
|
|
sub modifiedfield { |
sub modifiedfield { |
my ($token) = @_; |
my ($endtag,$parser) = @_; |
my $result; |
my $result; |
# foreach my $envkey (sort keys %ENV) { |
# foreach my $envkey (sort keys %ENV) { |
# &Apache::lonxml::debug("$envkey ---- $ENV{$envkey}"); |
# &Apache::lonxml::debug("$envkey ---- $ENV{$envkey}"); |
Line 485 sub modifiedfield {
|
Line 491 sub modifiedfield {
|
# &Apache::lonxml::debug("I want homework_edit_$Apache::lonxml::curdepth"); |
# &Apache::lonxml::debug("I want homework_edit_$Apache::lonxml::curdepth"); |
# &Apache::lonxml::debug($ENV{"form.homework_edit_$Apache::lonxml::curdepth"}); |
# &Apache::lonxml::debug($ENV{"form.homework_edit_$Apache::lonxml::curdepth"}); |
$result=$ENV{"form.homework_edit_$Apache::lonxml::curdepth"}; |
$result=$ENV{"form.homework_edit_$Apache::lonxml::curdepth"}; |
|
my $bodytext=&Apache::lonxml::get_all_text($endtag,$parser); |
|
# textareas throw away intial \n |
|
if ($bodytext=~/^\n/) { $result="\n".$result; } |
return $result; |
return $result; |
} |
} |
|
|
Line 553 sub checked_arg {
|
Line 562 sub checked_arg {
|
my $result; |
my $result; |
my $optionlist=""; |
my $optionlist=""; |
my $allselected=$token->[2]{$name}; |
my $allselected=$token->[2]{$name}; |
$result=$description; |
$result=&mt($description); |
foreach my $option (@$list) { |
foreach my $option (@$list) { |
my ($value,$text); |
my ($value,$text); |
if ( ref($option) eq 'ARRAY') { |
if ( ref($option) eq 'ARRAY') { |
Line 582 sub text_arg {
|
Line 591 sub text_arg {
|
my $result; |
my $result; |
if (!defined $size) { $size=20; } |
if (!defined $size) { $size=20; } |
my $arg=$token->[2]{$name}; |
my $arg=$token->[2]{$name}; |
$result=$description.' <input name="'.&html_element_name($name). |
$result=&mt($description).' <input name="'.&html_element_name($name). |
'" type="text" value="'.$arg.'" size="'.$size.'" />'; |
'" type="text" value="'.$arg.'" size="'.$size.'" />'; |
return '<nobr>'.$result.'</nobr>'; |
return '<nobr>'.$result.'</nobr>'; |
} |
} |
Line 640 sub select_or_text_arg {
|
Line 649 sub select_or_text_arg {
|
} |
} |
$optionlist.="<option value=\"TYPEDINVALUE\"". |
$optionlist.="<option value=\"TYPEDINVALUE\"". |
((!$found)?' selected="on"':''). |
((!$found)?' selected="on"':''). |
">Type in value</option>\n"; |
">".&mt('Type in value')."</option>\n"; |
# |
# |
my $element=&html_element_name($name); |
my $element=&html_element_name($name); |
my $selectelement='select_list_'.$element; |
my $selectelement='select_list_'.$element; |
Line 653 sub select_or_text_arg {
|
Line 662 sub select_or_text_arg {
|
'.options['.$selectedindex.'].value'; |
'.options['.$selectedindex.'].value'; |
my $typedinvalue='this.form.'.$typeinelement.'.value'; |
my $typedinvalue='this.form.'.$typeinelement.'.value'; |
my $selecttypeinindex='this.form.'.$selectelement.'.options.length'; |
my $selecttypeinindex='this.form.'.$selectelement.'.options.length'; |
|
$description=&mt($description); |
# |
# |
return (<<ENDSELECTORTYPE); |
return (<<ENDSELECTORTYPE); |
<nobr> |
<nobr> |