[LON-CAPA-cvs] cvs: loncom(version_2_2_X) /interface lonmeta.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 28 Aug 2006 00:19:38 -0000


albertel		Sun Aug 27 20:19:38 2006 EDT

  Modified files:              (Branch: version_2_2_X)
    /loncom/interface	lonmeta.pm 
  Log:
  - backport 1.173
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.168.2.2 loncom/interface/lonmeta.pm:1.168.2.3
--- loncom/interface/lonmeta.pm:1.168.2.2	Sun Aug 27 20:14:19 2006
+++ loncom/interface/lonmeta.pm	Sun Aug 27 20:19:38 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.168.2.2 2006/08/28 00:14:19 albertel Exp $
+# $Id: lonmeta.pm,v 1.168.2.3 2006/08/28 00:19:38 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1288,14 +1288,16 @@
 		     '<>&"').
 		     '</'.$tag.'>';
 	    }
-	    if ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles/portfolio/|) {
-		my ($path, $new_fn) = ($fn =~ m|/(portfolio.*)/([^/]*)$|);
+	    if ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles|) {
+	        my ($path, $new_fn);
+	        if ($fn =~ m|\w+/groups/\w+/portfolio/|) {
+                    ($path, $new_fn) = ($fn =~ m|/(groups/\w+/portfolio.*)/([^/]*)$|);
+	        } else {
+		    ($path, $new_fn) = ($fn =~ m|/(portfolio.*)/([^/]*)$|);
+	        }
                 $r->print(&store_portfolio_metadata($formname,$file_content,$path,
                                                     $new_fn));    
-            } elsif ($fn =~  m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles/groups/\w+/portfolio/|) {
-                my ($path, $new_fn) = ($fn =~ m|/(groups/\w+/portfolio.*)/([^/]*)$|);
-                $r->print(&store_portfolio_metadata($formname,$file_content,$path,$new_fn));
-	    } else {
+            } else {
 		if (!  ($mfh=Apache::File->new('>'.$fn))) {
 		    $r->print('<p><font color="red">'.
 			      &mt('Could not write metadata').', '.