--- loncom/interface/portfolio.pm 2004/12/04 19:08:42 1.62
+++ loncom/interface/portfolio.pm 2004/12/11 19:54:22 1.64
@@ -83,12 +83,7 @@ sub display_directory {
my ($r,$current_path,$is_empty,$dir_list)=@_;
my $iconpath= $r->dir_config('lonIconsURL') . "/";
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}.':';
- }
+ my %locked_files = &Apache::lonnet::get_marked_as_readonly_hash ($ENV{'user.domain'},$ENV{'user.name'});
if ($is_empty && ($current_path ne '/')) {
$display_out = '
');
+ $r->print('
+
+
+
+ ');
}
sub display_file_select {
my ($r,$current_path,$is_empty,$dir_list)=@_;
@@ -321,7 +316,7 @@ sub delete_dir_confirmed {
sub rename {
my ($r)=@_;
- my $file_name = $ENV{'form.currentpath'}.$ENV{'form.selectfile'};
+ my $file_name = $ENV{'form.currentpath'}.$ENV{'form.rename'};
if (&Apache::lonnet::is_locked($file_name,$ENV{'user.domain'},$ENV{'user.name'}) eq 'true') {
$r->print ("The file is locked and cannot be renamed.
");
$r->print(&done());
@@ -372,12 +367,12 @@ sub select_files {
if ($java_files) {
$java_files.=',';
}
- my $java_script =(<
function finishSelect() {
ENDSMP
- $java_script .= 'fileList = "'.$java_files.'";';
- $java_script .= (<
ENDSMP
- $r->print($java_script);
+ $r->print($javascript);
$r->print("Select portfolio files
Check as many as you wish in response to the essay problem.
");
$r->print("Files selected from other directories:
");
@@ -493,7 +488,7 @@ sub handler {
$r->rflush();
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['selectfile','currentpath',
- 'currentfile','action','fieldname','mode']);
+ 'currentfile','action','fieldname','mode','rename']);
if (($ENV{'form.storeupl'} eq 'Upload') & (!$ENV{'form.uploaddoc.filename'})){
$r->print(' No file was selected to upload.'.
'To upload a file, click Browse...'.
@@ -511,7 +506,9 @@ sub handler {
&delete_dir($r);
} elsif ($ENV{'form.action'} eq 'rename' && $ENV{'form.confirmed'}) {
&rename_confirmed($r);
- } elsif ($ENV{'form.action'} eq 'rename') {
+ } elsif ($ENV{'form.rename'}) {
+ $ENV{'form.selectfile'} = $ENV{'form.rename'};
+ $ENV{'form.action'} = 'rename';
&rename($r);
} elsif ($ENV{'form.createdir'}) {
&createdir($r);