');
$r->print($line); # contains first two cells of table
- $filename = $filename;
- $filename = &prepend_group($filename);
my $lock_info;
- if ($$version_flag{$filename}) { # versioned can't be versioned, so TRUE when root file
+ 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);
- if (defined($filename) && defined($$permissions_hash{'/'.$filename})) {
- foreach my $array_item (@{$$permissions_hash{'/'.$filename}}) {
+ if (defined($$permissions_hash{$fullpath})) {
+ foreach my $array_item (@{$$permissions_hash{$fullpath}}) {
if (ref($array_item) eq 'ARRAY') {
- if ($$array_item[(@$array_item - 1)] eq 'handback') {
+ if ($$array_item[-1] eq 'handback') {
$lock_info = 'Handback';
- } elsif ($$array_item[(@$array_item - 1)] eq 'graded') {
+ } elsif ($$array_item[-1] eq 'graded') {
$lock_info = 'Graded';
}
}
}
}
- if ($lock_info) {
- my %anchor_fields = (
- 'lockinfo' => '/'.$filename
- );
- $lock_info = &make_anchor(undef,\%anchor_fields,$lock_info);
- }
- $r->print('
'.$lock_info.'
');
+ if ($lock_info) {
+ my %anchor_fields = ('lockinfo' => $fullpath);
+ $lock_info = &make_anchor(undef,\%anchor_fields,$lock_info);
+ }
+ $r->print('
';
- if (($v_fname eq $fname)&&($v_extension eq $extension)) {
- &display_directory_line($r,$select_mode,$fullpath, $v_filename, $mtime, $size,
- $css_class, $line, \%access_controls, $curr_access, $now,
- \%version_flag, $href_location, $url, $current_path, $access_admin_text, 1);
- }
+ &display_directory_line($r,$select_mode, $v_filename, $mtime, $size,
+ $css_class, $line, \%access_controls, $curr_access, $now,
+ undef, $href_location, $url, $current_path, $access_admin_text, 1);
}
}
}
@@ -649,7 +643,7 @@ sub display_access {
$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.').'';
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"));
+ $info .= (&mt("A listing of files viewable without log-in is available at: http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme/portfolio. For logged in users a 'Display file listing' link will also appear (when there are viewable files) on your personal information page: http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme "));
}
if ($can_setacl) {
@@ -1609,35 +1603,35 @@ sub lock_info {
$file_name = &prepend_group($file_name);
if (defined($file_name) && defined($$current_permissions{$file_name})) {
foreach my $array_item (@{$$current_permissions{$file_name}}) {
- if (ref($array_item) eq 'ARRAY') {
- my $filetext;
- if (defined($group)) {
- $filetext = ''.$env{'form.lockinfo'}.
- ' (group: '.$group.')';
- } else {
- $filetext = ''.$file_name.'';
- }
- if ($$array_item[(@$array_item - 1)] eq 'graded') {
- $r->print(&mt('[_1] was submitted in response to problem: ',
- $filetext).
- ''.&Apache::lonnet::gettitle($$array_item[0]).
- ' ');
- my %course_description = &Apache::lonnet::coursedescription($$array_item[1]);
- $r->print(&mt('In the course: [_1] ',
- $course_description{'description'}));
- } elsif ($$array_item[(@$array_item - 1)] eq 'handback') {
- $r->print(&mt('[_1] was handed back in response to problem: ',
- $filetext).
- ''.&Apache::lonnet::gettitle($$array_item[0]).
- ' ');
- my %course_description = &Apache::lonnet::coursedescription($$array_item[1]);
- $r->print(&mt('In the course: [_1] ',
- $course_description{'description'}));
-
- }
- # $r->print('the third is '.$$array_item[2].' ');
- # $r->print("item is $$array_item[0] and $$array_item[0]");
- }
+ next if (ref($array_item) ne 'ARRAY');
+
+ my $filetext;
+ if (defined($group)) {
+ $filetext = ''.$env{'form.lockinfo'}.
+ ' (group: '.$group.')';
+ } else {
+ $filetext = ''.$file_name.'';
+ }
+
+ my $title =''.&Apache::lonnet::gettitle($$array_item[0]).
+ ' ';
+ if ($$array_item[-1] eq 'graded') {
+ $r->print(&mt('[_1] was submitted in response to problem: [_2]',
+ $filetext,$title));
+ } elsif ($$array_item[-1] eq 'handback') {
+ $r->print(&mt('[_1] was handed back in response to problem: [_2]',
+ $filetext,$title));
+ } else {
+ # submission style lock
+ $r->print(&mt('[_1] was submitted in response to problem: [_2]',
+ $filetext,$title));
+ }
+ my %course_description =
+ &Apache::lonnet::coursedescription($$array_item[1]);
+ if ( $course_description{'description'} ne '') {
+ $r->print(&mt('In the course: [_1] ',
+ $course_description{'description'}));
+ }
}
}
$r->print(&done('Back',$url));
@@ -1683,7 +1677,10 @@ sub createdir {
}
sub get_portfolio_root {
- my ($uname,$udom) = &get_name_dom();
+ my ($udom,$uname) = @_;
+ if (!(defined($udom)) || !(defined($uname))) {
+ ($uname,$udom) = &get_name_dom();
+ }
my $path;
if (defined($env{'form.group'})) {
$path = '/userfiles/groups/'.$env{'form.group'}.'/portfolio';