[LON-CAPA-cvs] cvs: loncom /interface portfolio.pm

banghart lon-capa-cvs@mail.lon-capa.org
Thu, 24 Aug 2006 18:28:43 -0000


banghart		Thu Aug 24 14:28:43 2006 EDT

  Modified files:              
    /loncom/interface	portfolio.pm 
  Log:
  	Allow multiple versioned file "folders" to be opened and closed
  	independently.
  
  
Index: loncom/interface/portfolio.pm
diff -u loncom/interface/portfolio.pm:1.161 loncom/interface/portfolio.pm:1.162
--- loncom/interface/portfolio.pm:1.161	Thu Aug 24 13:38:21 2006
+++ loncom/interface/portfolio.pm	Thu Aug 24 14:28:43 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # portfolio browser
 #
-# $Id: portfolio.pm,v 1.161 2006/08/24 17:38:21 banghart Exp $
+# $Id: portfolio.pm,v 1.162 2006/08/24 18:28:43 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -294,7 +294,7 @@
     	    my $version_flag;
     	    my $show_versions;
 	    my $fullpath =  &prepend_group($current_path.$filename);
-    	    if ($env{'form.showversions'} eq $filename) {
+    	    if ($env{'form.showversions'} =~ /$filename/) {
     	        $show_versions = 'true';
     	    }
     	    if (exists($versioned{$fullpath})) {
@@ -304,10 +304,15 @@
     	            'currentpath' => $current_path,
     	        );
     	        if ($show_versions) {
+    	            # 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,
                         '<img class="LC_icon" alt="'.&mt('opened folder').'" src="'.$iconpath.'folder_pointer_opened.gif" />');
     	        } else {
-    	            $anchor_fields{'showversions'} = $filename;
+    	            # allow multiple files to show versioned
+    	            $anchor_fields{'showversions'} = $env{'form.showversions'}.','.$filename;
                     $version_flag = &make_anchor('portfolio',\%anchor_fields,
                         '<img class="LC_icon" alt="'.&mt('closed folder').'" src="'.$iconpath.'folder_pointer_closed.gif" />');
                 }