--- loncom/interface/portfolio.pm 2004/11/09 21:51:14 1.55
+++ loncom/interface/portfolio.pm 2005/02/11 06:18:52 1.74
@@ -33,8 +33,8 @@ use Apache::lonlocal;
# 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) = @_;
- my $anchor = ''.$filename.'';
+ my ($filename, $current_path, $current_mode, $field_name) = @_;
+ my $anchor = ''.$filename.'';
return $anchor;
}
my $dirptr=16384;
@@ -48,6 +48,7 @@ sub display_common {
''.
''.
''.
+ ''.
''.
'';
$r->print($displayOut);
@@ -57,22 +58,23 @@ sub display_common {
''.
''.
''.
+ ''.
''.
'';
$r->print($displayOut);
$r->print('');
my @tree = split (/\//,$current_path);
- $r->print(''.&make_anchor('portfolio','/').'/');
+ $r->print(''.&make_anchor('portfolio','/',$ENV{"form.mode"},$ENV{"form.fieldname"}).'/');
if (@tree > 1){
my $newCurrentPath = '';
for (my $i = 1; $i< @tree; $i++){
$newCurrentPath .= $tree[$i].'/';
- $r->print(&make_anchor($tree[$i],'/'.$newCurrentPath).'/');
+ $r->print(&make_anchor($tree[$i],'/'.$newCurrentPath, $ENV{"form.mode"},$ENV{"form.fieldname"}).'/');
}
}
$r->print('');
&Apache::lonhtmlcommon::store_recent('portfolio',$current_path,$current_path);
- $r->print(' ");
@@ -81,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)=@_;
my $iconpath= $r->dir_config('lonIconsURL') . "/";
my $display_out;
+ my $checked_files = &Apache::lonnet::files_in_path($ENV{'user.name'}, $ENV{'form.currentpath'});
if ($is_empty && ($current_path ne '/')) {
$display_out = '
'.
''.
@@ -182,17 +174,20 @@ sub display_file_select {
#$strip holds directory/file name
#$dom
my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16);
+ $filename =~ s/\s+$//;
if (($filename ne '.') && ($filename ne '..')) {
if ($dirptr&$testdir) {
$r->print('