version 1.61, 2004/12/04 18:37:36
|
version 1.63, 2004/12/06 18:13:10
|
Line 361 sub select_files {
|
Line 361 sub select_files {
|
# eventually, have to handle removing those not checked, but . . . |
# eventually, have to handle removing those not checked, but . . . |
my @items=&Apache::loncommon::get_env_multiple('form.selectedfile'); |
my @items=&Apache::loncommon::get_env_multiple('form.selectedfile'); |
&Apache::lonnet::save_selected_files($ENV{'user.name'}, $ENV{'form.currentpath'}, @items); |
&Apache::lonnet::save_selected_files($ENV{'user.name'}, $ENV{'form.currentpath'}, @items); |
|
} else { |
|
if ($ENV{'form.currentpath'} eq '/') { |
|
#empty the file for a fresh start |
|
# &Apache::lonnet::clear_selected_files($ENV{'user.name'}); |
|
} |
|
} |
|
my @files = &Apache::lonnet::files_not_in_path($ENV{'user.name'}, $ENV{'form.currentpath'}); |
|
my $java_files = join ",", @files; |
|
if ($java_files) { |
|
$java_files.=','; |
} |
} |
my $java_script =(<<ENDSMP); |
my $javascript =(<<ENDSMP); |
<script language='javascript'> |
<script language='javascript'> |
function finishSelect() { |
function finishSelect() { |
fileList = ""; |
ENDSMP |
|
$javascript .= 'fileList = "'.$java_files.'";'; |
|
$javascript .= (<<ENDSMP); |
for (i=0;i<document.forms.checkselect.length;i++) { |
for (i=0;i<document.forms.checkselect.length;i++) { |
if (document.forms.checkselect[i].checked){ |
if (document.forms.checkselect[i].checked){ |
fileList = fileList + document.forms.checkselect.currentpath.value + document.forms.checkselect[i].value + "," ; |
fileList = fileList + document.forms.checkselect.currentpath.value + document.forms.checkselect[i].value + "," ; |
Line 373 sub select_files {
|
Line 385 sub select_files {
|
} |
} |
opener.document.forms.lonhomework. |
opener.document.forms.lonhomework. |
ENDSMP |
ENDSMP |
$java_script .= $ENV{'form.fieldname'}; |
$javascript .= $ENV{'form.fieldname'}; |
$java_script .= (<<ENDSMP); |
$javascript .= (<<ENDSMP); |
.value=fileList; |
.value=fileList; |
self.close(); |
self.close(); |
} |
} |
</script> |
</script> |
ENDSMP |
ENDSMP |
$r->print($java_script); |
$r->print($javascript); |
$r->print("<h1>Select portfolio files</h1> |
$r->print("<h1>Select portfolio files</h1> |
Check as many as you wish in response to the essay problem.<br />"); |
Check as many as you wish in response to the essay problem.<br />"); |
$r->print("<strong>Files selected from other directories:</strong><br />"); |
$r->print("<strong>Files selected from other directories:</strong><br />"); |