'.$/);
+ 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(''.$/);
}
}
}
if ($select_mode eq 'true') {
$r->print('
-
-
-
+
+
+
@@ -352,6 +407,10 @@ sub close_form {
if (defined($group)) {
$r->print("\n".'');
+ if (exists($env{'form.ref'})) {
+ $r->print("\n".'');
+ }
}
$r->print('');
$r->print('');
@@ -388,7 +451,7 @@ sub display_file {
}
sub done {
- my ($message,$url,$group)=@_;
+ my ($message,$url,$group,$refarg)=@_;
unless (defined $message) {
$message='Done';
}
@@ -397,14 +460,17 @@ sub done {
'&fieldname='.$env{'form.fieldname'}.
'&mode='.$env{'form.mode'};
if (defined($group)) {
- $result .= '&group='.$group;
+ $result .= '&group='.$group;
+ if ($refarg ne '') {
+ $result .= '&'.$refarg;
+ }
}
$result .= '">'.&mt($message).'';
return $result;
}
sub delete {
- my ($r,$url,$group)=@_;
+ my ($r,$url,$group,$refarg)=@_;
my @check;
my $file_name = $env{'form.currentpath'}.$env{'form.selectfile'};
$file_name = &prepend_group($file_name,$group);
@@ -412,7 +478,7 @@ sub delete {
my ($uname,$udom) = &get_name_dom($group);
if (&Apache::lonnet::is_locked($file_name,$udom,$uname) eq 'true') {
$r->print ("The file is locked and cannot be deleted. ");
- $r->print(&done('Back',$url,$group));
+ $r->print(&done('Back',$url,$group,$refarg));
} else {
if (scalar(@files)) {
&open_form($r,$url);
@@ -420,13 +486,13 @@ sub delete {
&close_form($r,$url,$group);
} else {
$r->print("No file was checked to delete. ");
- $r->print(&done(undef,$url,$group));
+ $r->print(&done(undef,$url,$group,$refarg));
}
}
}
sub delete_confirmed {
- my ($r,$url,$group)=@_;
+ my ($r,$url,$group,$refarg)=@_;
my @files=&Apache::loncommon::get_env_multiple('form.selectfile');
my $result;
my ($uname,$udom) = &get_name_dom($group);
@@ -440,7 +506,7 @@ sub delete_confirmed {
') while trying to delete '.&display_file(undef, $delete_file).' ');
}
}
- $r->print(&done(undef,$url,$group));
+ $r->print(&done(undef,$url,$group,$refarg));
}
sub delete_dir {
@@ -451,7 +517,7 @@ sub delete_dir {
}
sub delete_dir_confirmed {
- my ($r,$url,$group)=@_;
+ my ($r,$url,$group,$refarg)=@_;
my $directory_name = $env{'form.currentpath'};
$directory_name =~ s|/$||; # remove any trailing slash
my ($uname,$udom) = &get_name_dom($group);
@@ -476,17 +542,17 @@ sub delete_dir_confirmed {
}
$env{'form.currentpath'} = $directory_name;
}
- $r->print(&done(undef,$url,$group));
+ $r->print(&done(undef,$url,$group,$refarg));
}
sub rename {
- my ($r,$url,$group)=@_;
+ my ($r,$url,$group,$refarg)=@_;
my $file_name = $env{'form.currentpath'}.$env{'form.rename'};
my ($uname,$udom) = &get_name_dom($group);
$file_name = &prepend_group($file_name,$group);
if (&Apache::lonnet::is_locked($file_name,$udom,$uname) eq 'true') {
$r->print ("The file is locked and cannot be renamed. ");
- $r->print(&done(undef,$url,$group));
+ $r->print(&done(undef,$url,$group,$refarg));
} else {
&open_form($r,$url);
$r->print('
'.&mt('Rename').' '.&display_file().' to
@@ -496,7 +562,7 @@ sub rename {
}
sub rename_confirmed {
- my ($r,$url,$group)=@_;
+ my ($r,$url,$group,$refarg)=@_;
my $filenewname=&Apache::lonnet::clean_filename($env{'form.filenewname'});
my ($uname,$udom) = &get_name_dom($group);
my $port_path = &get_port_path($group);
@@ -504,7 +570,7 @@ sub rename_confirmed {
$r->print(''.
&mt("Error: no valid filename was provided to rename to.").
' ');
- $r->print(&done(undef,$url,$group));
+ $r->print(&done(undef,$url,$group,$refarg));
return;
}
my $result=
@@ -522,11 +588,11 @@ sub rename_confirmed {
''.&display_file('',$env{'form.filenewname'}).'',
''.&display_file('',$filenewname).''));
}
- $r->print(&done(undef,$url,$group));
+ $r->print(&done(undef,$url,$group,$refarg));
}
sub display_access {
- my ($r,$url,$group,$can_setacl) = @_;
+ my ($r,$url,$group,$can_setacl,$port_path,$refarg) = @_;
my ($uname,$udom) = &get_name_dom($group);
my $file_name = $env{'form.currentpath'}.$env{'form.access'};
$file_name = &prepend_group($file_name,$group);
@@ -534,21 +600,8 @@ 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 $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.').
- '
';
+ 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);
$r->print($header.$info);
@@ -564,12 +617,12 @@ sub display_access {
$r->print($info);
}
&view_access_settings($r,$url,$group,$access_controls{$file_name},
- $aclcount);
+ $aclcount,$refarg);
}
}
sub view_access_settings {
- my ($r,$url,$group,$access_controls,$aclcount) = @_;
+ my ($r,$url,$group,$access_controls,$aclcount,$refarg) = @_;
my ($showstart,$showend);
my %todisplay;
foreach my $key (sort(keys(%{$access_controls}))) {
@@ -593,6 +646,9 @@ sub view_access_settings {
my $group_arg;
if ($group) {
$group_arg = '&group='.$group;
+ if ($refarg ne '') {
+ $group_arg .= '&'.$refarg;
+ }
}
$r->print(' '.&mt('Return to directory listing').'');
@@ -703,7 +759,7 @@ sub build_access_summary {
sub update_access {
- my ($r,$url,$group) = @_;
+ my ($r,$url,$group,$port_path,$refarg) = @_;
my $totalprocessed = 0;
my %processing;
my %title = (
@@ -729,7 +785,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);
@@ -822,10 +878,16 @@ sub update_access {
my $group_arg;
if ($group) {
$group_arg = '&group='.$group;
+ if ($refarg) {
+ $group_arg .= '&'.$refarg;
+ }
}
$r->print(' '.
- &mt('Display all access settings for this file').'');
+ &mt('Display all access settings for this file').''.
+ ' '.
+ ''.&mt('Return to directory listing').'');
}
return;
}
@@ -995,25 +1057,24 @@ sub access_setting_table {
$passwd.'" />');
$r->print(&Apache::loncommon::end_data_table_row());
$r->print(&Apache::loncommon::end_data_table());
-
- #$r->print('