--- loncom/interface/portfolio.pm 2006/07/18 01:25:43 1.134
+++ loncom/interface/portfolio.pm 2006/07/18 02:20:19 1.135
@@ -1,7 +1,7 @@
# The LearningOnline Network
# portfolio browser
#
-# $Id: portfolio.pm,v 1.134 2006/07/18 01:25:43 banghart Exp $
+# $Id: portfolio.pm,v 1.135 2006/07/18 02:20:19 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -129,44 +129,11 @@ TABLE
$r->print("");
}
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)=@_;
- 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('
');
$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(' | ');
$r->print(''.$$version_flag{$filename}.''.
$filename.' | ');
@@ -317,10 +284,6 @@ sub display_directory {
$line .= '';
}
}
-# &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('
');
- $r->print($line);
my $curr_access;
if ($select_mode ne 'true') {
my $pub_access = 0;
@@ -354,21 +317,27 @@ sub display_directory {
$curr_access = join('+ ',@allaccesses);
}
}
- $r->print(' | ');
- $r->print(''.$version_flag{$filename}.''.
- $filename.' | ');
- $r->print(''.$size.' | ');
- $r->print(''.&Apache::lonlocal::locallocaltime($mtime).' | ');
- if ($select_mode ne 'true') {
- $r->print(''.
- &mt($curr_access).' ');
- $r->print(''.$access_admin_text.' | ');
- }
- $r->print('
'.$/);
+ &display_directory_line($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);
+# $r->print('');
+# $r->print($line);
+# $r->print(' | ');
+# $r->print(''.$version_flag{$filename}.''.
+# $filename.' | ');
+# $r->print(''.$size.' | ');
+# $r->print(''.&Apache::lonlocal::locallocaltime($mtime).' | ');
+# if ($select_mode ne 'true') {
+# $r->print(''.
+# &mt($curr_access).' ');
+# $r->print(''.$access_admin_text.' | ');
+# }
+# $r->print('
'.$/);
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);
+
}
}
}