version 1.99, 2005/12/22 22:06:54
|
version 1.102, 2006/05/30 12:45:36
|
Line 32 use strict;
|
Line 32 use strict;
|
use Apache::lonnet; |
use Apache::lonnet; |
use HTML::Entities(); |
use HTML::Entities(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
|
|
|
|
# Global Vars |
# Global Vars |
# default list of colors to use in editing |
# default list of colors to use in editing |
Line 577 sub editfield {
|
Line 580 sub editfield {
|
if ($rows < $minheight) { $rows = $minheight; } |
if ($rows < $minheight) { $rows = $minheight; } |
if ($description) { $description="<br />".$description."<br />"; } |
if ($description) { $description="<br />".$description."<br />"; } |
if ($usehtmlarea) { |
if ($usehtmlarea) { |
push @Apache::lonxml::htmlareafields,'homework_edit_'. |
&Apache::lonhtmlcommon::add_htmlareafields('homework_edit_'. |
$Apache::lonxml::curdepth; |
$Apache::lonxml::curdepth); |
} |
} |
return $description."\n".' <textarea style="width:100%" rows="'.$rows. |
return $description."\n".' <textarea style="width:100%" rows="'.$rows. |
'" cols="'.$cols.'" name="homework_edit_'. |
'" cols="'.$cols.'" name="homework_edit_'. |
Line 683 sub checked_arg {
|
Line 686 sub checked_arg {
|
$text=$option; |
$text=$option; |
$value='value="'.$option.'"'; |
$value='value="'.$option.'"'; |
} |
} |
$result.="<nobr><input type='checkbox' $value name='". |
$result.="<nobr><label><input type='checkbox' $value name='". |
&html_element_name($name)."'"; |
&html_element_name($name)."'"; |
foreach my $selected (split(/,/,$allselected)) { |
foreach my $selected (split(/,/,$allselected)) { |
if ( $selected eq $option ) { |
if ( $selected eq $option ) { |
Line 691 sub checked_arg {
|
Line 694 sub checked_arg {
|
last; |
last; |
} |
} |
} |
} |
$result.=&element_change_detection()." />$text</nobr>\n"; |
$result.=&element_change_detection()." />$text</label></nobr>\n"; |
} |
} |
return $result; |
return $result; |
} |
} |
Line 799 sub entercoords {
|
Line 802 sub entercoords {
|
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::lonnet::filelocation($Apache::lonxml::pwd[-1],$Apache::edit::bgimgsrc)); |
my $bgfile=&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') { |
$element = &Apache::lonnet::escape("$Apache::lonxml::curdepth"); |
$element = &escape("$Apache::lonxml::curdepth"); |
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag> |
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag> |
$element = &Apache::lonnet::escape('homework_edit_'. |
$element = &escape('homework_edit_'. |
$Apache::lonxml::curdepth); |
$Apache::lonxml::curdepth); |
} |
} |
my $id=$Apache::lonxml::curdepth; |
my $id=$Apache::lonxml::curdepth; |
Line 834 sub entercoords {
|
Line 837 sub entercoords {
|
sub entercoord { |
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=&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') { |
$element = &Apache::lonnet::escape("$idx\_$Apache::lonxml::curdepth"); |
$element = &escape("$idx\_$Apache::lonxml::curdepth"); |
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag> |
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag> |
$element = &Apache::lonnet::escape('homework_edit_'. |
$element = &escape('homework_edit_'. |
$Apache::lonxml::curdepth); |
$Apache::lonxml::curdepth); |
} |
} |
my $id=$Apache::lonxml::curdepth; |
my $id=$Apache::lonxml::curdepth; |
Line 874 sub browse {
|
Line 877 sub browse {
|
my $form = 'lonhomework'; |
my $form = 'lonhomework'; |
my $element; |
my $element; |
if (! defined($mode) || $mode eq 'attribute') { |
if (! defined($mode) || $mode eq 'attribute') { |
$element = &Apache::lonnet::escape("$id\_$Apache::lonxml::curdepth"); |
$element = &escape("$id\_$Apache::lonxml::curdepth"); |
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag> |
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag> |
$element = &Apache::lonnet::escape('homework_edit_'. |
$element = &escape('homework_edit_'. |
$Apache::lonxml::curdepth); |
$Apache::lonxml::curdepth); |
} |
} |
my $titleelement; |
my $titleelement; |
if ($titleid) { |
if ($titleid) { |
$titleelement=",'','','".&Apache::lonnet::escape("$titleid\_$Apache::lonxml::curdepth")."'"; |
$titleelement=",'','','".&escape("$titleid\_$Apache::lonxml::curdepth")."'"; |
} |
} |
my $result = <<"ENDBUTTON"; |
my $result = <<"ENDBUTTON"; |
<a href=\"javascript:openbrowser('$form','$element'$titleelement)\"\>Select</a> |
<a href=\"javascript:openbrowser('$form','$element'$titleelement)\"\>Select</a> |
Line 896 sub search {
|
Line 899 sub search {
|
my $form = 'lonhomework'; |
my $form = 'lonhomework'; |
my $element; |
my $element; |
if (! defined($mode) || $mode eq 'attribute') { |
if (! defined($mode) || $mode eq 'attribute') { |
$element = &Apache::lonnet::escape("$id\_$Apache::lonxml::curdepth"); |
$element = &escape("$id\_$Apache::lonxml::curdepth"); |
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag> |
} elsif ($mode eq 'textnode') { # for data between <tag> ... </tag> |
$element = &Apache::lonnet::escape('homework_edit_'. |
$element = &escape('homework_edit_'. |
$Apache::lonxml::curdepth); |
$Apache::lonxml::curdepth); |
} |
} |
my $titleelement; |
my $titleelement; |
if ($titleid) { |
if ($titleid) { |
$titleelement=",'".&Apache::lonnet::escape("$titleid\_$Apache::lonxml::curdepth")."'"; |
$titleelement=",'".&escape("$titleid\_$Apache::lonxml::curdepth")."'"; |
} |
} |
my $result = <<"ENDBUTTON"; |
my $result = <<"ENDBUTTON"; |
<a href=\"javascript:opensearcher('$form','$element'$titleelement)\"\>Search</a> |
<a href=\"javascript:opensearcher('$form','$element'$titleelement)\"\>Search</a> |