--- loncom/interface/portfolio.pm 2005/03/15 23:11:08 1.80
+++ loncom/interface/portfolio.pm 2005/12/19 20:41:45 1.91
@@ -29,52 +29,72 @@ use Apache::lonnet;
use Apache::lontexconvert;
use Apache::lonfeedback;
use Apache::lonlocal;
+use Apache::lonnet;
# receives a file name and path stub from username/userfiles/portfolio/
# returns an anchor tag consisting encoding filename and currentpath
sub make_anchor {
- my ($filename, $current_path, $current_mode, $field_name) = @_;
- my $anchor = ''.$filename.'';
+ my ($filename, $current_path, $current_mode, $field_name, $continue_select) = @_;
+ if ($continue_select ne 'true') {$continue_select = 'false'};
+ my $anchor = ''.$filename.'';
return $anchor;
}
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 = '';
- $r->print($displayOut);
- $r->print(' |
');
- $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");
+
+TABLE
my @tree = split (/\//,$current_path);
- $r->print(''.&make_anchor('portfolio','/',$ENV{"form.mode"},$ENV{"form.fieldname"}).'/');
+ $r->print(''.&make_anchor('portfolio','/',$env{"form.mode"},$env{"form.fieldname"},$env{"form.continue"}).'/');
if (@tree > 1){
my $newCurrentPath = '';
for (my $i = 1; $i< @tree; $i++){
$newCurrentPath .= $tree[$i].'/';
- $r->print(&make_anchor($tree[$i],'/'.$newCurrentPath, $ENV{"form.mode"},$ENV{"form.fieldname"}).'/');
+ $r->print(&make_anchor($tree[$i],'/'.$newCurrentPath, $env{"form.mode"},$env{"form.fieldname"}, $env{"form.continue"}).'/');
}
}
$r->print('');
&Apache::lonhtmlcommon::store_recent('portfolio',$current_path,$current_path);
- $r->print('
");
@@ -85,10 +105,10 @@ sub display_directory {
my $display_out;
my $select_mode;
my $checked_files;
- my %locked_files = &Apache::lonnet::get_marked_as_readonly_hash ($ENV{'user.domain'},$ENV{'user.name'});
- if ($ENV{"form.mode"} eq 'selectfile'){
+ my %locked_files = &Apache::lonnet::get_marked_as_readonly_hash ($env{'user.domain'},$env{'user.name'});
+ if ($env{"form.mode"} eq 'selectfile'){
&select_files($r);
- $checked_files =&Apache::lonnet::files_in_path($ENV{'user.name'},$ENV{'form.currentpath'});
+ $checked_files =&Apache::lonnet::files_in_path($env{'user.name'},$env{'form.currentpath'});
$select_mode = 'true';
}
if ($is_empty && ($current_path ne '/')) {
@@ -111,8 +131,8 @@ sub display_directory {
'Actions | | Name | Size | Last Modified |
');
$r->print('