--- loncom/interface/portfolio.pm 2006/07/08 01:20:40 1.132
+++ 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.132 2006/07/08 01:20:40 raeburn Exp $
+# $Id: portfolio.pm,v 1.135 2006/07/18 02:20:19 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -128,6 +128,26 @@ TABLE
'this.form.submit();'));
$r->print("");
}
+sub display_directory_line {
+ 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);
+ $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('
'.$/);
+}
sub display_directory {
my ($r,$url,$current_path,$is_empty,$dir_list,$group,$can_upload,
$can_modify,$can_delete,$can_setacl)=@_;
@@ -214,7 +234,11 @@ sub display_directory {
$show_versions = 'true';
}
if (exists($versioned{$filename})) {
- $version_flag{$filename} = '';
+ if ($show_versions) {
+ $version_flag{$filename} = '';
+ } else {
+ $version_flag{$filename} = '';
+ }
} else {
$version_flag{$filename} = '';
}
@@ -260,8 +284,6 @@ sub display_directory {
$line .= '';
}
}
- $r->print('');
- $r->print($line);
my $curr_access;
if ($select_mode ne 'true') {
my $pub_access = 0;
@@ -295,19 +317,28 @@ 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.' | ');
+ &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);
+
}
- $r->print(''.$/);
}
}
}
@@ -534,7 +565,7 @@ sub rename_confirmed {
}
sub display_access {
- my ($r,$url,$group,$can_setacl) = @_;
+ my ($r,$url,$group,$can_setacl,$port_path) = @_;
my ($uname,$udom) = &get_name_dom($group);
my $file_name = $env{'form.currentpath'}.$env{'form.access'};
$file_name = &prepend_group($file_name,$group);
@@ -542,7 +573,7 @@ sub display_access {
$uname);
my %access_controls = &Apache::lonnet::get_access_controls($current_permissions,$group,$file_name);
my $aclcount = keys(%access_controls);
- my $header = ''.&mt('Allowing others to retrieve portfolio file: [_1]',$env{'form.currentpath'}.$env{'form.access'}).'
';
+ my $header = ''.&mt('Allowing others to retrieve portfolio file: [_1]',$port_path.$env{'form.currentpath'}.$env{'form.access'}).'
';
my $info .= &mt('Access to this file by others can be set to be one or more of the following types: public, passphrase-protected or conditional.').'
- '.&mt('Public files are available to anyone without the need for login.').'
- '.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.').'
- '.&mt('Conditional files are accessible to logged-in users with accounts in the LON-CAPA network, who satisfy the conditions you set.').'
'.&mt('The conditions can include affiliation with a particular course or group, or a user account in a specific domain.').'
'.&mt('Alternatively access can be granted to people with specific LON-CAPA usernames and domains.').'
';
if ($can_setacl) {
&open_form($r,$url);
@@ -698,7 +729,7 @@ sub build_access_summary {
sub update_access {
- my ($r,$url,$group) = @_;
+ my ($r,$url,$group,$port_path) = @_;
my $totalprocessed = 0;
my %processing;
my %title = (
@@ -724,7 +755,7 @@ sub update_access {
}
my $file_name = $env{'form.currentpath'}.$env{'form.selectfile'};
$r->print(''.&mt('Allowing others to retrieve portfolio file: [_1]',
- $file_name).'
'."\n");
+ $port_path.$file_name).''."\n");
$file_name = &prepend_group($file_name,$group);
my ($uname,$udom) = &get_name_dom($group);
my ($errors,$outcome,$deloutcome,$new_values,$translation);
@@ -820,7 +851,10 @@ sub update_access {
}
$r->print('
'.
- &mt('Display all access settings for this file').'');
+ &mt('Display all access settings for this file').''.
+ ' '.
+ ''.&mt('Return to directory listing').'');
}
return;
}
@@ -1774,6 +1808,7 @@ sub handler {
$can_setacl = 1;
}
+ my $port_path = &get_port_path($group);
&Apache::loncommon::no_cache($r);
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
@@ -1851,10 +1886,10 @@ sub handler {
} elsif ($env{'form.access'}) {
$env{'form.selectfile'} = $env{'form.access'};
$env{'form.action'} = 'chgaccess';
- &display_access($r,$url,$group,$can_setacl);
+ &display_access($r,$url,$group,$can_setacl,$port_path);
} elsif ($env{'form.action'} eq 'chgaccess') {
if ($can_setacl) {
- &update_access($r,$url,$group);
+ &update_access($r,$url,$group,$port_path);
} else {
&missing_priv($r,$url,'setacl',$group);
}