[LON-CAPA-cvs] cvs: loncom /interface portfolio.pm
banghart
lon-capa-cvs@mail.lon-capa.org
Wed, 05 Jul 2006 22:29:05 -0000
banghart Wed Jul 5 18:29:05 2006 EDT
Modified files:
/loncom/interface portfolio.pm
Log:
Saving work in progress. Sneaking up on displaying versioned files.
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.129 loncom/interface/portfolio.pm:1.130
--- loncom/interface/portfolio.pm:1.129 Tue Jul 4 19:52:10 2006
+++ loncom/interface/portfolio.pm Wed Jul 5 18:29:05 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network
# portfolio browser
#
-# $Id: portfolio.pm,v 1.129 2006/07/04 23:52:10 banghart Exp $
+# $Id: portfolio.pm,v 1.130 2006/07/05 22:29:05 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -204,11 +204,11 @@
my ($filename,$dom,$testdir,$size,$mtime,$obs) = @$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;
if (exists($versioned{$filename})) {
- $version_flag = ' (*) ';
+ $version_flag{$filename} = '<a href="portfolio?open_version='.$filename.'"><img alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_pointer_closed.gif" /></a>';
} else {
- $version_flag = '';
+ $version_flag{$filename} = '';
}
if ($dirptr&$testdir) {
my $colspan='colspan="2"';
@@ -217,7 +217,7 @@
}
$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>'.&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>');
} else {
my $css_class = 'LC_browser_file';
@@ -247,7 +247,7 @@
my $cat='<img alt="'.&mt('Catalog Information').
'" src="'.&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif').'" />';
$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>';
}
@@ -288,8 +288,8 @@
}
}
$r->print('<td><img alt="" src="'.&Apache::loncommon::icon($filename).'" /></td>');
- $r->print('<td><a href="'.$href_location.$filename.'">'.
- $filename.'</a>'.$version_flag.'</td>');
+ $r->print('<td>'.$version_flag{$filename}.'<a href="'.$href_location.$filename.'">'.
+ $filename.'</a></td>');
$r->print('<td>'.$size.'</td>');
$r->print('<td>'.&Apache::lonlocal::locallocaltime($mtime).'</td>');
if ($select_mode ne 'true') {