version 1.50, 2004/10/19 19:13:04
|
version 1.54, 2004/11/03 21:02:49
|
Line 82 sub display_directory {
|
Line 82 sub display_directory {
|
my ($r,$current_path,$is_empty,$dir_list)=@_; |
my ($r,$current_path,$is_empty,$dir_list)=@_; |
my $iconpath= $r->dir_config('lonIconsURL') . "/"; |
my $iconpath= $r->dir_config('lonIconsURL') . "/"; |
my $display_out; |
my $display_out; |
|
my %locked_files=&Apache::lonnet::dump('file_permissions', |
|
$ENV{'user.domain'},$ENV{'user.name'}); |
|
my $locked_file; |
|
foreach my $key (keys %locked_files) { |
|
$locked_file .= $locked_files{$key}.':'; |
|
} |
if ($is_empty && ($current_path ne '/')) { |
if ($is_empty && ($current_path ne '/')) { |
$display_out = '<form method="post" action="/adm/portfolio">'. |
$display_out = '<form method="post" action="/adm/portfolio">'. |
'<input type="hidden" name="action" value="deletedir" />'. |
'<input type="hidden" name="action" value="deletedir" />'. |
Line 105 sub display_directory {
|
Line 111 sub display_directory {
|
#$strip holds directory/file name |
#$strip holds directory/file name |
#$dom |
#$dom |
my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); |
my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); |
|
if ($Apache::lonhomework::results{"resource.$ENV{'user.domain'}.$ENV{'user.name'}.$filename"}eq'true'){ |
|
&Apache::lonnet::logthis("found submitted file"); |
|
&Apache::lonnet::logthis("resource.$ENV{'user.domain'}.$ENV{'user.name'}.$filename"); |
|
} else { |
|
&Apache::lonnet::logthis("$filename not found submitted file"); |
|
&Apache::lonnet::logthis("resource.$ENV{'user.domain'}.$ENV{'user.name'}.$filename"); |
|
} |
if (($filename ne '.') && ($filename ne '..')) { |
if (($filename ne '.') && ($filename ne '..')) { |
if ($dirptr&$testdir) { |
if ($dirptr&$testdir) { |
$r->print('<tr bgcolor="#FFAA99"><td><img src="'.$iconpath.'folder_closed.gif"></td>'); |
$r->print('<tr bgcolor="#FFAA99"><td><img src="'.$iconpath.'folder_closed.gif"></td>'); |
Line 327 sub select_files {
|
Line 340 sub select_files {
|
fileList = ""; |
fileList = ""; |
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[i].value + "," ; |
fileList = fileList + document.forms.checkselect.currentpath.value + document.forms.checkselect[i].value + "," ; |
} |
} |
} |
} |
opener.document.forms.lonhomework. |
opener.document.forms.lonhomework. |
Line 436 sub handler {
|
Line 449 sub handler {
|
$r->rflush(); |
$r->rflush(); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['selectfile','currentpath', |
['selectfile','currentpath', |
'currentfile','action','fieldname']); |
'currentfile','action','fieldname','mode']); |
if (($ENV{'form.storeupl'} eq 'Upload') & (!$ENV{'form.uploaddoc.filename'})){ |
if (($ENV{'form.storeupl'} eq 'Upload') & (!$ENV{'form.uploaddoc.filename'})){ |
$r->print('<font color="red"> No file was selected to upload.'. |
$r->print('<font color="red"> No file was selected to upload.'. |
'To upload a file, click <strong>Browse...</strong>'. |
'To upload a file, click <strong>Browse...</strong>'. |
Line 488 sub handler {
|
Line 501 sub handler {
|
# need to know if directory is empty so it can be removed if desired |
# need to know if directory is empty so it can be removed if desired |
my $is_empty=(@dir_list == 2); |
my $is_empty=(@dir_list == 2); |
&display_common($r,$current_path,$is_empty,\@dir_list); |
&display_common($r,$current_path,$is_empty,\@dir_list); |
if ($ENV{"form.mode"}='selectfile'){ |
if ($ENV{"form.mode"} eq 'selectfile'){ |
&select_files($r); |
&select_files($r); |
&display_file_select($r,$current_path,$is_empty,\@dir_list); |
&display_file_select($r,$current_path,$is_empty,\@dir_list); |
} else { |
} else { |