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

banghart lon-capa-cvs@mail.lon-capa.org
Mon, 21 Aug 2006 19:26:28 -0000


banghart		Mon Aug 21 15:26:28 2006 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  	Associate group repository files with group course.
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.171 loncom/interface/lonmeta.pm:1.172
--- loncom/interface/lonmeta.pm:1.171	Mon Aug 21 14:04:20 2006
+++ loncom/interface/lonmeta.pm	Mon Aug 21 15:26:27 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.171 2006/08/21 18:04:20 banghart Exp $
+# $Id: lonmeta.pm,v 1.172 2006/08/21 19:26:27 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -745,10 +745,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',
@@ -1109,7 +1110,7 @@
 #####################################################
 #####################################################
 sub present_editable_metadata {
-    my ($r,$uri, $file_type) = @_;
+    my ($r,$uri,$file_type) = @_;
     # Construction Space Call
     # Header
     my $disuri=$uri;
@@ -1199,8 +1200,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'}) {
@@ -1211,7 +1216,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+)$/ );