version 1.134, 2006/07/18 01:25:43
|
version 1.135, 2006/07/18 02:20:19
|
Line 129 TABLE
|
Line 129 TABLE
|
$r->print("</form>"); |
$r->print("</form>"); |
} |
} |
sub display_directory_line { |
sub display_directory_line { |
my ($r,$select_mode,$fullpath, $css_class, $line, $access_controls, |
my ($r,$select_mode,$fullpath, $filename, $mtime, $size, $css_class, $line, $access_controls, $curr_access, |
$now, $version_flag, $href_location, $url, $current_path, $groupecho, $access_admin_text)=@_; |
$now, $version_flag, $href_location, $url, $current_path, $groupecho, $access_admin_text)=@_; |
my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); |
# my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); |
$r->print('<tr class="'.$css_class.'">'); |
$r->print('<tr class="'.$css_class.'">'); |
$r->print($line); |
$r->print($line); |
my $curr_access; |
|
if ($select_mode ne 'true') { |
|
my $pub_access = 0; |
|
my $guest_access = 0; |
|
my $cond_access = 0; |
|
foreach my $key (sort(keys(%{$$access_controls{$fullpath}}))) { |
|
my ($num,$scope,$end,$start) = &unpack_acc_key($key); |
|
if (($now > $start) && (!$end || $end > $now)) { |
|
if ($scope eq 'public') { |
|
$pub_access = 1; |
|
} elsif ($scope eq 'guest') { |
|
$guest_access = 1; |
|
} else { |
|
$cond_access = 1; |
|
} |
|
} |
|
} |
|
if (!$pub_access && !$guest_access && !$cond_access) { |
|
$curr_access = &mt('Private'); |
|
} else { |
|
my @allaccesses; |
|
if ($pub_access) { |
|
push(@allaccesses,&mt('Public')); |
|
} |
|
if ($guest_access) { |
|
push(@allaccesses,&mt('Passphrase-protected')); |
|
} |
|
if ($cond_access) { |
|
push(@allaccesses,&mt('Conditional')); |
|
} |
|
$curr_access = join('+ ',@allaccesses); |
|
} |
|
} |
|
$r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>'); |
$r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>'); |
$r->print('<td>'.$$version_flag{$filename}.'<a href="'.$href_location.$filename.'">'. |
$r->print('<td>'.$$version_flag{$filename}.'<a href="'.$href_location.$filename.'">'. |
$filename.'</a></td>'); |
$filename.'</a></td>'); |
Line 317 sub display_directory {
|
Line 284 sub display_directory {
|
$line .= '</td>'; |
$line .= '</td>'; |
} |
} |
} |
} |
# &display_directory_line($r,$select_mode,$fullpath, $css_class, $line, \%access_controls, |
|
# $now, \%version_flag, $href_location, $url, $current_path, $groupecho, $access_admin_text); |
|
$r->print('<tr class="'.$css_class.'">'); |
|
$r->print($line); |
|
my $curr_access; |
my $curr_access; |
if ($select_mode ne 'true') { |
if ($select_mode ne 'true') { |
my $pub_access = 0; |
my $pub_access = 0; |
Line 354 sub display_directory {
|
Line 317 sub display_directory {
|
$curr_access = join('+ ',@allaccesses); |
$curr_access = join('+ ',@allaccesses); |
} |
} |
} |
} |
$r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>'); |
&display_directory_line($r,$select_mode,$fullpath, $filename, $mtime, $size, $css_class, $line, \%access_controls, $curr_access, |
$r->print('<td>'.$version_flag{$filename}.'<a href="'.$href_location.$filename.'">'. |
$now, \%version_flag, $href_location, $url, $current_path, $groupecho, $access_admin_text); |
$filename.'</a></td>'); |
# $r->print('<tr class="'.$css_class.'">'); |
$r->print('<td>'.$size.'</td>'); |
# $r->print($line); |
$r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>'); |
# $r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>'); |
if ($select_mode ne 'true') { |
# $r->print('<td>'.$version_flag{$filename}.'<a href="'.$href_location.$filename.'">'. |
$r->print('<td><span style="white-space: nowrap">'. |
# $filename.'</a></td>'); |
&mt($curr_access).' '); |
# $r->print('<td>'.$size.'</td>'); |
$r->print('<a href="'.$url.'?access='.$filename. |
# $r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>'); |
'&currentpath='.$current_path.$groupecho. |
# if ($select_mode ne 'true') { |
'">'.$access_admin_text.'</a></span></td>'); |
# $r->print('<td><span style="white-space: nowrap">'. |
} |
# &mt($curr_access).' '); |
$r->print('</tr>'.$/); |
# $r->print('<a href="'.$url.'?access='.$filename. |
|
# '&currentpath='.$current_path.$groupecho. |
|
# '">'.$access_admin_text.'</a></span></td>'); |
|
# } |
|
# $r->print('</tr>'.$/); |
if ($show_versions) { |
if ($show_versions) { |
|
&display_directory_line($r,$select_mode,$fullpath, $css_class, $line, \%access_controls, |
|
$now, \%version_flag, $href_location, $url, $current_path, $groupecho, $access_admin_text); |
|
|
} |
} |
} |
} |
} |
} |