--- loncom/interface/lonmeta.pm 2005/11/11 21:25:50 1.125 +++ loncom/interface/lonmeta.pm 2005/11/15 19:20:12 1.127 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.125 2005/11/11 21:25:50 banghart Exp $ +# $Id: lonmeta.pm,v 1.127 2005/11/15 19:20:12 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -512,7 +512,6 @@ sub prettyinput { } if ($type eq 'keywords') { my %hash; - my $def; my @cur_values; foreach (split(/,/,$value)) { $_ =~ s/^\s+//; @@ -523,7 +522,7 @@ sub prettyinput { $hash{$_} = $_; } if ($only_one) { - return(&Apache::loncommon::select_form($def,'new_keywords',%hash)); + return(&Apache::loncommon::select_form($value,'new_keywords',%hash)); } else { return (&Apache::loncommon::multiple_select_form('new_keywords',\@cur_values,undef,\%hash)); } @@ -1102,22 +1101,38 @@ ENDEDIT $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.=('

'.$lt{$_}.': '. - &prettyinput($_, + &prettyinput($_, $Apache::lonpublisher::metadatafields{$_}, 'new_'.$_,'defaultmeta',undef,undef,undef,undef,$metacourse).'

'); - } + } elsif ($_ eq 'courserestricted') { + $output.=( + &prettyinput($field_name, + $Apache::lonpublisher::metadatafields{$_}, + 'new_'.$field_name,'defaultmeta',undef,undef,undef,undef,$metacourse)); + } } else { - $output.=('

'.$lt{$_}.': '. + if ($_ ne 'courserestricted') { + $output.=('

'.$lt{$_}.': '. &prettyinput($_, $Apache::lonpublisher::metadatafields{$_}, 'new_'.$_,'defaultmeta').'

'); + } else { + $output.=&prettyinput($field_name, + $Apache::lonpublisher::metadatafields{$_}, + 'new_'.$field_name,'defaultmeta'); + } } } + $output.=('

'.$lt{$_}.': '. + &prettyinput($_, + $Apache::lonpublisher::metadatafields{$_}, + 'new_'.$_,'defaultmeta',undef,undef,undef,undef,$metacourse).'

'); + if ($env{'form.store'}) { my $mfh; my $formname='store';