version 1.129, 2006/07/04 23:52:10
|
version 1.131, 2006/07/05 22:52:53
|
Line 183 sub display_directory {
|
Line 183 sub display_directory {
|
my $href_location="/uploaded/$udom/$uname/$port_path".$current_path; |
my $href_location="/uploaded/$udom/$uname/$port_path".$current_path; |
my $href_edit_location="/editupload/$udom/$uname/$port_path".$current_path; |
my $href_edit_location="/editupload/$udom/$uname/$port_path".$current_path; |
my @dir_lines; |
my @dir_lines; |
|
my @version_lines; |
my %versioned; |
my %versioned; |
foreach my $line (sort |
foreach my $line (sort |
{ |
{ |
Line 196 sub display_directory {
|
Line 197 sub display_directory {
|
$filename =~ s/\s+$//; |
$filename =~ s/\s+$//; |
my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename); |
my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename); |
if ($version) { |
if ($version) { |
|
push(@version_lines, [$filename,$dom,$testdir,$size,$mtime,$obs]); |
$versioned{$fname.'.'.$extension} .= $version.","; |
$versioned{$fname.'.'.$extension} .= $version.","; |
|
} else { |
|
push(@dir_lines, [$filename,$dom,$testdir,$size,$mtime,$obs]); |
} |
} |
push(@dir_lines, [$filename,$dom,$testdir,$size,$mtime,$obs]); |
|
} |
} |
foreach my $line (@dir_lines) { |
foreach my $line (@dir_lines) { |
my ($filename,$dom,$testdir,$size,$mtime,$obs) = @$line; |
my ($filename,$dom,$testdir,$size,$mtime,$obs) = @$line; |
my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename); |
my ($fname,$version,$extension) = &Apache::grades::file_name_version_ext($filename); |
if (($filename ne '.') && ($filename ne '..') && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(\d+)\.([^\.]*)$/)) { |
if (($filename ne '.') && ($filename ne '..') && ($filename !~ /\.meta$/ ) && ($filename !~ /(.*)\.(\d+)\.([^\.]*)$/)) { |
my $version_flag; |
my %version_flag; |
|
my $show_versions; |
|
if ($env{'form.showversions'} eq $filename) { |
|
$show_versions = 'true'; |
|
} |
if (exists($versioned{$filename})) { |
if (exists($versioned{$filename})) { |
$version_flag = ' (*) '; |
$version_flag{$filename} = '<a href="portfolio?showversions='.$filename.'"><img alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_pointer_closed.gif" /></a>'; |
} else { |
} else { |
$version_flag = ''; |
$version_flag{$filename} = ''; |
} |
} |
if ($dirptr&$testdir) { |
if ($dirptr&$testdir) { |
my $colspan='colspan="2"'; |
my $colspan='colspan="2"'; |
Line 217 sub display_directory {
|
Line 224 sub display_directory {
|
} |
} |
$r->print('<tr class="LC_browser_folder"><td '.$colspan.'><img alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_closed.gif" /></td>'); |
$r->print('<tr class="LC_browser_folder"><td '.$colspan.'><img alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_closed.gif" /></td>'); |
$r->print('<td>Go to ...</td>'); |
$r->print('<td>Go to ...</td>'); |
$r->print('<td>'.&make_anchor($url,$filename.'/',$current_path.$filename.'/',$env{'form.mode'},$env{"form.fieldname"},$env{'form.continue'},$group).$version_flag.'</td>'); |
$r->print('<td>'.$version_flag{$filename}.&make_anchor($url,$filename.'/',$current_path.$filename.'/',$env{'form.mode'},$env{"form.fieldname"},$env{'form.continue'},$group).'</td>'); |
$r->print('</tr>'); |
$r->print('</tr>'); |
} else { |
} else { |
my $css_class = 'LC_browser_file'; |
my $css_class = 'LC_browser_file'; |
Line 247 sub display_directory {
|
Line 254 sub display_directory {
|
my $cat='<img alt="'.&mt('Catalog Information'). |
my $cat='<img alt="'.&mt('Catalog Information'). |
'" src="'.&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif').'" />'; |
'" src="'.&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif').'" />'; |
$line .= '<a href="'.$url.'?rename='.$filename.'&currentpath='.$current_path.$groupecho.'">Rename</a>'; |
$line .= '<a href="'.$url.'?rename='.$filename.'&currentpath='.$current_path.$groupecho.'">Rename</a>'; |
$line .= '</td><td><a href="'.$href_edit_location.$filename.'.meta">'.$cat.'</a>'.$version_flag; |
$line .= '</td><td>'.$version_flag{$filename}.'<a href="'.$href_edit_location.$filename.'.meta">'.$cat.'</a>'; |
} |
} |
$line .= '</td>'; |
$line .= '</td>'; |
} |
} |
Line 288 sub display_directory {
|
Line 295 sub display_directory {
|
} |
} |
} |
} |
$r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>'); |
$r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>'); |
$r->print('<td><a href="'.$href_location.$filename.'">'. |
$r->print('<td>'.$version_flag{$filename}.'<a href="'.$href_location.$filename.'">'. |
$filename.'</a>'.$version_flag.'</td>'); |
$filename.'</a></td>'); |
$r->print('<td>'.$size.'</td>'); |
$r->print('<td>'.$size.'</td>'); |
$r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>'); |
$r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>'); |
if ($select_mode ne 'true') { |
if ($select_mode ne 'true') { |
Line 1674 sub handler {
|
Line 1681 sub handler {
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['selectfile','currentpath','meta','lockinfo','currentfile','action', |
['selectfile','currentpath','meta','lockinfo','currentfile','action', |
'fieldname','mode','rename','continue','group','access','setnum', |
'fieldname','mode','rename','continue','group','access','setnum', |
'cnum','cdom','type','setroles']); |
'cnum','cdom','type','setroles','showversions']); |
my ($uname,$udom,$portfolio_root,$url,$group,$caller,$title); |
my ($uname,$udom,$portfolio_root,$url,$group,$caller,$title); |
if ($r->uri =~ m|^(/adm/)([^/]+)|) { |
if ($r->uri =~ m|^(/adm/)([^/]+)|) { |
$url = $1.$2; |
$url = $1.$2; |