--- loncom/interface/portfolio.pm 2006/06/07 18:41:48 1.102 +++ loncom/interface/portfolio.pm 2006/06/07 21:15:01 1.103 @@ -136,21 +136,6 @@ sub display_directory { $current_permissions,$group); my %access_controls = &Apache::lonnet::get_access_controls($current_permissions,$group); my $now = time; - my $curr_access; - my $pub_access = 0; - foreach my $key (sort(keys(%access_controls))) { - my ($scope,$end,$start) = ($key =~ /^\d+:(\w+)_(\d*)_?(\d*)$/); - if (($now > $start) && (!$end || $end > $now)) { - if ($scope eq 'public') { - $pub_access = 1; - } - } - } - if (!$pub_access) { - $curr_access = 'Private' - } elsif ($pub_access) { - $curr_access = 'Public'; - } if ($env{"form.mode"} eq 'selectfile'){ &select_files($r); $checked_files =&Apache::lonnet::files_in_path($uname,$env{'form.currentpath'}); @@ -203,6 +188,8 @@ sub display_directory { $r->print(''); } else { $r->print(''); + my $fullpath = $current_path.$filename; + $fullpath = &prepend_group($fullpath,$group); if ($select_mode eq 'true'){ $r->print('print('>'); } else { - if (exists $locked_files{$current_path.$filename}){ + if (exists $locked_files{$fullpath}) { $r->print('Locked'); } else { my $cat=''.&mt('Catalog Information').
@@ -221,6 +208,22 @@ sub display_directory {
                             </td>');
                     }
                 }
+                my $curr_access;
+                my $pub_access = 0;
+                foreach my $key (sort(keys(%{$access_controls{$fullpath}}))) {
+                    my ($scope,$end,$start) = ($key =~ /^\d+:(\w+)_(\d*)_?(\d*)$/);
+                    if (($now > $start) && (!$end || $end > $now)) {
+                        if ($scope eq 'public')  {
+                            $pub_access = 1;
+                            last;
+                        }
+                    }
+                }
+                if (!$pub_access) {
+                    $curr_access = 'Private'
+                } elsif ($pub_access) {
+                    $curr_access = 'Public';
+                }
                 $r->print('<td><img src='); $r->print(''. $filename.''); @@ -554,10 +557,6 @@ sub lock_info { if (defined($file_name) && defined($$current_permissions{$file_name})) { foreach my $array_item (@{$$current_permissions{$file_name}}) { if (ref($array_item) eq 'ARRAY') { - if ($$array_item[0] eq 'access' || - $$array_item[0] eq 'accesscount' ) { - next; - } my $filetext; if (defined($group)) { $filetext = ''.$env{'form.lockinfo'}.