version 1.102, 2006/06/07 18:41:48
|
version 1.103, 2006/06/07 21:15:01
|
Line 136 sub display_directory {
|
Line 136 sub display_directory {
|
$current_permissions,$group); |
$current_permissions,$group); |
my %access_controls = &Apache::lonnet::get_access_controls($current_permissions,$group); |
my %access_controls = &Apache::lonnet::get_access_controls($current_permissions,$group); |
my $now = time; |
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'){ |
if ($env{"form.mode"} eq 'selectfile'){ |
&select_files($r); |
&select_files($r); |
$checked_files =&Apache::lonnet::files_in_path($uname,$env{'form.currentpath'}); |
$checked_files =&Apache::lonnet::files_in_path($uname,$env{'form.currentpath'}); |
Line 203 sub display_directory {
|
Line 188 sub display_directory {
|
$r->print('</tr>'); |
$r->print('</tr>'); |
} else { |
} else { |
$r->print('<tr bgcolor="#CCCCFF">'); |
$r->print('<tr bgcolor="#CCCCFF">'); |
|
my $fullpath = $current_path.$filename; |
|
$fullpath = &prepend_group($fullpath,$group); |
if ($select_mode eq 'true'){ |
if ($select_mode eq 'true'){ |
$r->print('<td><input type="checkbox" name="checkfile" value="'.$filename.'"'); |
$r->print('<td><input type="checkbox" name="checkfile" value="'.$filename.'"'); |
if ($$checked_files{$filename} eq 'selected') { |
if ($$checked_files{$filename} eq 'selected') { |
Line 210 sub display_directory {
|
Line 197 sub display_directory {
|
} |
} |
$r->print('></td>'); |
$r->print('></td>'); |
} else { |
} else { |
if (exists $locked_files{$current_path.$filename}){ |
if (exists $locked_files{$fullpath}) { |
$r->print('<td colspan="2"><a href="'.$url.'?lockinfo='.$current_path.$filename.$groupecho.'">Locked</a></td>'); |
$r->print('<td colspan="2"><a href="'.$url.'?lockinfo='.$current_path.$filename.$groupecho.'">Locked</a></td>'); |
} else { |
} else { |
my $cat='<img alt="'.&mt('Catalog Information'). |
my $cat='<img alt="'.&mt('Catalog Information'). |
Line 221 sub display_directory {
|
Line 208 sub display_directory {
|
</td>'); |
</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="'.&Apache::loncommon::icon($filename).'"></td>'); |
$r->print('<td><img src="'.&Apache::loncommon::icon($filename).'"></td>'); |
$r->print('<td><a href="'.$href_location.$filename.'">'. |
$r->print('<td><a href="'.$href_location.$filename.'">'. |
$filename.'</a></td>'); |
$filename.'</a></td>'); |
Line 554 sub lock_info {
|
Line 557 sub lock_info {
|
if (defined($file_name) && defined($$current_permissions{$file_name})) { |
if (defined($file_name) && defined($$current_permissions{$file_name})) { |
foreach my $array_item (@{$$current_permissions{$file_name}}) { |
foreach my $array_item (@{$$current_permissions{$file_name}}) { |
if (ref($array_item) eq 'ARRAY') { |
if (ref($array_item) eq 'ARRAY') { |
if ($$array_item[0] eq 'access' || |
|
$$array_item[0] eq 'accesscount' ) { |
|
next; |
|
} |
|
my $filetext; |
my $filetext; |
if (defined($group)) { |
if (defined($group)) { |
$filetext = '<strong>'.$env{'form.lockinfo'}. |
$filetext = '<strong>'.$env{'form.lockinfo'}. |