'.
- 'Actions | | Name | Size | Last Modified | Current Access Status |
');
+ 'Actions | | | Name'.
+ &Apache::loncommon::help_open_topic('Portfolio OpenFile').
+ ' | Size | Last Modified | Current Access Status'.
+ &Apache::loncommon::help_open_topic('Portfolio ShareFile').
+ ' |
');
}
$r->print("\n".&group_form_data()."\n");
my $href_location="/uploaded/$udom/$uname/$port_path".$current_path;
my $href_edit_location="/editupload/$udom/$uname/$port_path".$current_path;
my @dir_lines;
- my @version_lines;
my %versioned;
- foreach my $line (sort
+ foreach my $dir_line (sort
{
my ($afile)=split('&',$a,2);
my ($bfile)=split('&',$b,2);
@@ -228,33 +290,48 @@ sub display_directory {
} (@$dir_list)) {
#$strip holds directory/file name
#$dom
- 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(/\&/,$dir_line,16);
$filename =~ s/\s+$//;
my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename);
if ($version) {
- push(@version_lines, [$filename,$dom,$testdir,$size,$mtime,$obs]);
- $versioned{$fname.'.'.$extension} .= $version.",";
+ my $fullpath = &prepend_group($current_path.$fname.'.'.$extension);
+ push(@{ $versioned{$fullpath} },
+ [$filename,$dom,$testdir,$size,$mtime,$obs,]);
} else {
push(@dir_lines, [$filename,$dom,$testdir,$size,$mtime,$obs]);
}
}
- foreach my $line (@dir_lines) {
- my ($filename,$dom,$testdir,$size,$mtime,$obs) = @$line;
+ foreach my $dir_line (@dir_lines) {
+ my ($filename,$dom,$testdir,$size,$mtime,$obs) = @$dir_line;
my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename);
if (($filename ne '.') && ($filename ne '..') && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(\d+)\.([^\.]*)$/)) {
- my %version_flag;
+ my $version_flag;
my $show_versions;
- if ($env{'form.showversions'} eq $filename) {
+ my $fullpath = &prepend_group($current_path.$filename);
+ if ($env{'form.showversions'} =~ /$filename/) {
$show_versions = 'true';
}
- if (exists($versioned{$filename})) {
+ if (exists($versioned{$fullpath})) {
+ my %anchor_fields = (
+ 'selectfile' => $fullpath,
+ 'continue' => 'false',
+ 'currentpath' => $current_path,
+ );
if ($show_versions) {
- $version_flag{$filename} = '';
+ # Must preserve other possible showversion files
+ my $version_remainder = $env{'form.showversions'};
+ $version_remainder =~ s/$filename//g;
+ $anchor_fields{'showversions'} = $version_remainder;
+ $version_flag = &make_anchor('portfolio',\%anchor_fields,
+ '');
} else {
- $version_flag{$filename} = '';
+ # allow multiple files to show versioned
+ $anchor_fields{'showversions'} = $env{'form.showversions'}.','.$filename;
+ $version_flag = &make_anchor('portfolio',\%anchor_fields,
+ '');
}
} else {
- $version_flag{$filename} = '';
+ $version_flag = ' ';
}
if ($dirptr&$testdir) {
my $colspan='colspan="2"';
@@ -263,13 +340,18 @@ sub display_directory {
}
$r->print(' | ');
$r->print('Go to ... | ');
- $r->print(''.$version_flag{$filename}.&make_anchor($url,$filename.'/',$current_path.$filename.'/',$env{'form.mode'},$env{"form.fieldname"},$env{'form.continue'}).'/ | ');
+ my %anchor_fields = (
+ 'selectfile' => $filename.'/',
+ 'currentpath' => $current_path.$filename.'/',
+ 'mode' => $env{"form.mode"},
+ 'fieldname' => $env{"form.fieldname"},
+ 'continue' => $env{"form.continue"}
+ );
+ $r->print(''.$version_flag.' | '.&make_anchor($url,\%anchor_fields,$filename.'/').' | ');
$r->print('
');
} else {
my $css_class = 'LC_browser_file';
my $line;
- my $fullpath = $current_path.$filename;
- $fullpath = &prepend_group($fullpath);
if ($select_mode eq 'true') {
$line=' | ';
} else {
if (exists $locked_files{$fullpath}) {
- $line.='Locked | ';
+ my %anchor_fields = (
+ 'lockinfo' => $fullpath
+ );
+ $line.=''.&make_anchor($url,\%anchor_fields,'Locked').' | ';
$css_class= 'LC_browser_file_locked';
} else {
if (!$can_modify) {
@@ -290,10 +375,15 @@ sub display_directory {
$line .= '';
}
if ($can_modify) {
- my $cat='';
- $line .= 'Rename';
- $line .= ''.$version_flag{$filename}.''.$cat.'';
+ my %anchor_fields = (
+ 'rename' => $filename,
+ currentpath => $current_path
+ );
+ $line .= &make_anchor($url,\%anchor_fields,'Rename');
+ $line .= ' | '.&make_anchor($href_edit_location.$filename.'.meta',\%anchor_fields,$cat);
+ # ''.$cat.'';
}
$line .= ' | ';
}
@@ -331,27 +421,18 @@ sub display_directory {
$curr_access = join('+ ',@allaccesses);
}
}
- &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, $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('
'.$/);
+ &display_directory_line($r,$select_mode, $filename, $mtime, $size, $css_class, $line,
+ \%access_controls, $curr_access,$now, $version_flag, $href_location,
+ $url, $current_path, $access_admin_text);
if ($show_versions) {
- &display_directory_line($r,$select_mode,$fullpath, $css_class, $line, \%access_controls,
- $now, \%version_flag, $href_location, $url, $current_path, $access_admin_text);
-
+ foreach my $dir_line (@{ $versioned{$fullpath} }) {
+ my ($v_filename,$dom,$testdir,$size,$mtime,$obs) =
+ @$dir_line;
+ $line = ' | ';
+ &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);
+ }
}
}
}
@@ -369,7 +450,8 @@ sub display_directory {
$r->print('
');
if ($can_delete) {
$r->print('
-