');
$r->print($line); # contains first two cells of table
- if ($$version_flag{$filename}) { # versioned can't be versioned, so TRUE when root file
+ my $lock_info;
+ if ($version_flag) { # versioned can't be versioned, so TRUE when root file
$r->print('
');
- $r->print('
'.$$version_flag{$filename}.'
');
+ $r->print('
'.$version_flag.'
');
} else { # this is a graded or handed back file
my ($user,$domain) = &get_name_dom();
my $permissions_hash = &Apache::lonnet::get_portfile_permissions($domain,$user);
- my $lock_info;
- foreach my $key (keys(%$permissions_hash)) {
- $key =~ s|^/||;
- if ($key =~ /$filename/) {
- &Apache::lonnet::logthis("filename match");
- my $value = $$permissions_hash{$key};
- if (ref($value) eq 'ARRAY') {
- my $info = pop(@$value);
- my $info2 = pop(@$info);
- &Apache::lonnet::logthis("the info2 is $info2");
- $lock_info = $info2;
- #foreach my $key2(keys(%hash)){
- # &Apache::lonnet::logthis("a key2 is $key2");
- #}
- foreach my $value_element (@$value) {
- #&Apache::lonnet::logthis("and the array element is $value_element");
- foreach my $sub_value (@$value_element) {
- #&Apache::lonnet::logthis("subvalue is $sub_value");
- }
+ if (defined($$permissions_hash{$fullpath})) {
+ foreach my $array_item (@{$$permissions_hash{$fullpath}}) {
+ if (ref($array_item) eq 'ARRAY') {
+ if ($$array_item[-1] eq 'handback') {
+ $lock_info = 'Handback';
+ } elsif ($$array_item[-1] eq 'graded') {
+ $lock_info = 'Graded';
}
- }
+ }
}
}
- $r->print('
'.$lock_info.'
');
+ if ($lock_info) {
+ my %anchor_fields = ('lockinfo' => $fullpath);
+ $lock_info = &make_anchor(undef,\%anchor_fields,$lock_info);
+ }
+ $r->print('
'.&mt('Allowing others to retrieve 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 ');
- $info .= &mt('more of the following types: public, passphrase-protected or conditional.');
+ my $info .= &mt('Access to this file by others can be set to be one or more of the following types: public or passphrase-protected.');
$info .= '
'.&mt('Public files are available to anyone without the need for login.');
- $info .= '
'.&mt('Passphrase-protected files do not require log-in, but will require ');
- $info .= &mt('the viewer to enter the passphrase you set.');
- $info .= '
'.&mt('Conditional files are accessible to logged-in users with accounts ');
- $info .= &mt('in the LON-CAPA network, who satisfy the conditions you set.').' ';
- $info .= &mt('The conditions can include affiliation with a particular course or group, ');
- $info .= &mt('or a user account in a specific domain.').' ';
- $info .= &mt('Alternatively access can be granted to people with specific LON-CAPA usernames and domains.').'
';
+ $info .= '
'.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.');
+# $info .= '
'.&mt('Conditional files are accessible to logged-in users with accounts in the LON-CAPA network, who satisfy the conditions you set.').' ';
+# $info .= &mt('The conditions can include affiliation with a particular course or group, or a user account in a specific domain.').' ';
+# $info .= &mt('Alternatively access can be granted to people with specific LON-CAPA usernames and domains.');
+ $info .= '
';
if ($group eq '') {
$info .= (&mt("Direct others to the 'Display file listing' link (shown when there are viewable files) on your personal information page: http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme"));
}
@@ -1102,24 +1090,24 @@ sub access_setting_table {
$passwd.'" />');
$r->print(&Apache::loncommon::end_data_table_row());
$r->print(&Apache::loncommon::end_data_table());
- $r->print('