[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:14:20 -0000


albertel		Sun Aug 27 20:14:20 2006 EDT

  Modified files:              (Branch: version_2_2_X)
    /loncom/interface	lonmeta.pm 
  Log:
  - backport 1.172
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.168.2.1 loncom/interface/lonmeta.pm:1.168.2.2
--- loncom/interface/lonmeta.pm:1.168.2.1	Sun Aug 27 20:13:22 2006
+++ loncom/interface/lonmeta.pm	Sun Aug 27 20:14:19 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.168.2.1 2006/08/28 00:13:22 albertel Exp $
+# $Id: lonmeta.pm,v 1.168.2.2 2006/08/28 00:14:19 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -742,10 +742,11 @@
             &pre_select_course($r,$uri);
         }
     } elsif ($uri=~m|^/editupload/[^/]+/[^/]+/groups/|) {
-       $r->print(&Apache::loncommon::start_page('Edit Group Portfolio File Catalog Information',
+        $r->print(&Apache::loncommon::start_page('Edit Group Portfolio File Catalog Information',
 						 undef,
 						 {'domain' => $resdomain,}));
-        &present_editable_metadata($r,$uri,'portfolio');    
+						 
+        &present_editable_metadata($r,$uri,'groups');    
     } elsif ($uri=~m|^/~|) { 
         # Construction space
         $r->print(&Apache::loncommon::start_page('Edit Catalog nformation',
@@ -1106,7 +1107,7 @@
 #####################################################
 #####################################################
 sub present_editable_metadata {
-    my ($r,$uri, $file_type) = @_;
+    my ($r,$uri,$file_type) = @_;
     # Construction Space Call
     # Header
     my $disuri=$uri;
@@ -1196,8 +1197,12 @@
                  'lowestgradelevel','highestgradelevel','sourceavail','sourcerights',
                  'obsolete','obsoletereplacement');
         }
+        if ($file_type eq 'groups') {
+            $Apache::lonpublisher::metadatafields{'courserestricted'}=
+                'course.'.$env{'request.course.id'}; 
+        }
         if ((! $Apache::lonpublisher::metadatafields{'courserestricted'}) &&
-                (! $env{'form.new_courserestricted'})) {
+                (! $env{'form.new_courserestricted'}) && (! $file_type eq 'groups')) {
             $Apache::lonpublisher::metadatafields{'courserestricted'}=
                 'none';
         } elsif ($env{'form.new_courserestricted'}) {
@@ -1208,7 +1213,7 @@
                 $Apache::lonpublisher::metadatafields{'copyright'}=
 		    'default';
         }
-	if ($file_type eq 'portfolio') {
+	if (($file_type eq 'portfolio') || ($file_type eq 'groups'))  {
 	    if (! $Apache::lonpublisher::metadatafields{'mime'}) {
                 ($Apache::lonpublisher::metadatafields{'mime'}) =
 		    ( $target=~/\.(\w+)$/ );