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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 29 Dec 2005 19:42:45 -0000


albertel		Thu Dec 29 14:42:45 2005 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  -BUG#4530
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.148 loncom/interface/lonmeta.pm:1.149
--- loncom/interface/lonmeta.pm:1.148	Mon Dec 19 18:19:18 2005
+++ loncom/interface/lonmeta.pm	Thu Dec 29 14:42:44 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.148 2005/12/19 23:19:18 albertel Exp $
+# $Id: lonmeta.pm,v 1.149 2005/12/29 19:42:44 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -248,8 +248,13 @@
          'notes' => 'Notes',
          'abstract' => 'Abstract',
          'lowestgradelevel' => 'Lowest Grade Level',
-         'highestgradelevel' => 'Highest Grade Level',
-         'courserestricted' => 'Course Restricting Metadata');
+         'highestgradelevel' => 'Highest Grade Level');
+    
+    if (! defined($file_type) || $file_type ne 'portfolio') {
+        %fields = 
+	    (%fields,
+	     'courserestricted' => 'Course Restricting Metadata');
+    }
          
     if (! defined($file_type) || $file_type ne 'portfolio') {
         %fields = 
@@ -1164,12 +1169,14 @@
                 $Apache::lonpublisher::metadatafields{'copyright'}=
                 'default';
         }
-        if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none') {
-            $r->print(&mt('Associated with course [_1]','<strong>'.$env{$Apache::lonpublisher::metadatafields{'courserestricted'}.".description"}.
-                        '</strong>').'<br />');
-        } else {
-            $r->print("This resource is not associated with a course.<br />");
-        }
+	if ($file_type eq 'portfolio') {
+	    if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none') {
+		$r->print(&mt('Associated with course [_1]','<strong>'.$env{$Apache::lonpublisher::metadatafields{'courserestricted'}.".description"}.
+			      '</strong>').'<br />');
+	    } else {
+		$r->print("This resource is not associated with a course.<br />");
+	    }
+	}
         foreach my $field_name (@fields) {
 
             if (defined($env{'form.new_'.$field_name})) {
@@ -1260,12 +1267,14 @@
 	$r->print($output.'<br /><input type="submit" name="store" value="'.
                   &mt('Store Catalog Information').'">');
 
-         $r->print('</form>
+	if ($file_type eq 'portfolio') {
+	    $r->print('</form>
                <br /><br /><form method="POST" action="/adm/portfolio">'.
-              '<input type="hidden" name="currentpath" value="'.$path.'" />'.
-	      '<input type="submit" name="cancel" value="'.&mt('Discard Edits and Return to Portfolio').'">');
-
+		      '<input type="hidden" name="currentpath" value="'.$path.'" />'.
+		      '<input type="submit" name="cancel" value="'.&mt('Discard Edits and Return to Portfolio').'">');
+	}
     }
+    
     $r->print('</form>');
 
     return;