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

banghart lon-capa-cvs@mail.lon-capa.org
Tue, 15 Nov 2005 19:20:13 -0000


banghart		Tue Nov 15 14:20:13 2005 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  	Don't display courserestricted as if it's a metadata tag.
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.126 loncom/interface/lonmeta.pm:1.127
--- loncom/interface/lonmeta.pm:1.126	Fri Nov 11 17:46:56 2005
+++ loncom/interface/lonmeta.pm	Tue Nov 15 14:20:12 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.126 2005/11/11 22:46:56 banghart Exp $
+# $Id: lonmeta.pm,v 1.127 2005/11/15 19:20:12 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1101,22 +1101,38 @@
                 $Apache::lonpublisher::metadatafields{$_}=
                     join(',',&Apache::loncommon::get_env_multiple('form.new_'.$_));
             }
+            my $field_name = $_;
             if ($metacourse ne 'none') {
                 # handle restrictions here
-                if (($env{$metacourse.'.metadata.'.$_.'.options'} =~ m/active/)||
-                    ($_ eq 'courserestricted'))  {
+                if ($env{$metacourse.'.metadata.'.$_.'.options'} =~ m/active/){
                     $output.=('<p>'.$lt{$_}.': '.
-                            &prettyinput($_,
+                              &prettyinput($_,
 				   $Apache::lonpublisher::metadatafields{$_},
 				   'new_'.$_,'defaultmeta',undef,undef,undef,undef,$metacourse).'</p>');
-                }
+                 } elsif ($_ eq 'courserestricted') {
+                            $output.=(
+                                &prettyinput($field_name,
+				    $Apache::lonpublisher::metadatafields{$_},
+				    'new_'.$field_name,'defaultmeta',undef,undef,undef,undef,$metacourse));
+                 }
             } else {
-                $output.=('<p>'.$lt{$_}.': '.
+                if ($_ ne 'courserestricted') {
+                    $output.=('<p>'.$lt{$_}.': '.
                             &prettyinput($_,
 				   $Apache::lonpublisher::metadatafields{$_},
 				   'new_'.$_,'defaultmeta').'</p>');
+	        } else {
+                    $output.=&prettyinput($field_name,
+				   $Apache::lonpublisher::metadatafields{$_},
+				   'new_'.$field_name,'defaultmeta');
+                }
             }
         }
+        $output.=('<p>'.$lt{$_}.': '.
+                 &prettyinput($_,
+		 $Apache::lonpublisher::metadatafields{$_},
+		 'new_'.$_,'defaultmeta',undef,undef,undef,undef,$metacourse).'</p>');
+
         if ($env{'form.store'}) {
             my $mfh;
             my $formname='store';