--- loncom/interface/portfolio.pm 2005/05/02 19:08:16 1.85 +++ loncom/interface/portfolio.pm 2005/12/19 20:41:45 1.91 @@ -43,28 +43,46 @@ my $dirptr=16384; sub display_common { my ($r,$current_path,$is_empty,$dir_list)=@_; my $iconpath= $r->dir_config('lonIconsURL') . "/"; - $r->print(''); - $r->print('
'); - my $displayOut = '
'; - $displayOut .= ''. - ''. - ''. - ''. - ''. - ''. - '
'; - $r->print($displayOut); - $r->print('
'); - $displayOut = '
'; - $displayOut .= ''. - ''. - ''. - ''. - ''. - ''. - '
'; - $r->print($displayOut); - $r->print('
'); + my %text=&Apache::lonlocal::texthash('upload' => 'Upload', + 'upload_label' => + 'Upload file to current directory:', + 'createdir' => 'Create Subdirectory', + 'createdir_label' => + 'Create subdirectory in current directory:'); + $r->print(<<"TABLE"); + + + + + + + + + + + + + +
+ $text{'upload_label'} + + + + + + + +
+ $text{'createdir_label'} + + + + + + + +
+TABLE my @tree = split (/\//,$current_path); $r->print(''.&make_anchor('portfolio','/',$env{"form.mode"},$env{"form.fieldname"},$env{"form.continue"}).'/'); if (@tree > 1){ @@ -114,7 +132,7 @@ sub display_directory { $r->print('
'); } my $href_location="/uploaded/$env{'user.domain'}/$env{'user.name'}/portfolio$current_path"; - my $href_edit_location="/editupload/$env{'user.domain'}/$env{'user.name'}/portfolio$current_path"; + my $href_edit_location="/editupload/$env{'user.domain'}/$env{'user.name'}/portfolio$current_path/"; foreach my $line (sort { my ($afile)=split('&',$a,2); @@ -147,13 +165,15 @@ sub display_directory { if (exists $locked_files{$current_path.$filename}){ $r->print('Locked'); } else { + my $cat=''.&mt('Catalog Information').
+			    ''; $r->print(' Rename - Meta + '.$cat.' '); } } - $r->print(''); + $r->print(''); $r->print(''. $filename.''); $r->print(''.$size.''); @@ -387,10 +407,13 @@ ENDSMP ENDSMP $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:
"); - foreach (&Apache::lonnet::files_not_in_path($env{'user.name'}, $env{'form.currentpath'})) { - $r->print($_."
"); + Check as many as you wish in response to the problem.
"); + my @otherfiles=&Apache::lonnet::files_not_in_path($env{'user.name'}, $env{'form.currentpath'}); + if (@otherfiles) { + $r->print("Files selected from other directories:
"); + foreach my $file (@otherfiles) { + $r->print($file."
"); + } } } sub upload { @@ -418,8 +441,8 @@ sub upload { } } my $current_disk_usage = &Apache::lonnet::diskusage($env{'user.domain'}, $env{'user.name'},$portfolio_root); - if ((($current_disk_usage/1000) + $filesize) > $disk_quota){ - $r->print('Unable to upload '.$fname.' (size = '.$filesize.' kilobytes. Disk quota will be exceeded.'. + if (($current_disk_usage + $filesize) > $disk_quota){ + $r->print('Unable to upload '.$fname.' (size = '.$filesize.' kilobytes). Disk quota will be exceeded.'. '
Disk quota is '.$disk_quota.' kilobytes. Your current disk usage is '.$current_disk_usage.' kilobytes.'); $r->print(&done('Back')); } @@ -529,7 +552,7 @@ sub handler { $r->print(&Apache::loncommon::bodytag('Portfolio Manager')); } $r->rflush(); - if (($env{'form.storeupl'} eq 'Upload') & (!$env{'form.uploaddoc.filename'})){ + if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){ $r->print(' No file was selected to upload.'. 'To upload a file, click Browse...'. ', select a file, then click Upload,'); @@ -595,8 +618,8 @@ sub handler { &display_common($r,$current_path,$is_empty,\@dir_list); &display_directory($r,$current_path,$is_empty,\@dir_list); $r->print("\n\n"); - return OK; } + return OK; } 1; __END__