--- loncom/interface/lonmeta.pm 2005/11/02 01:02:31 1.122 +++ loncom/interface/lonmeta.pm 2005/11/07 23:03:17 1.123 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.122 2005/11/02 01:02:31 banghart Exp $ +# $Id: lonmeta.pm,v 1.123 2005/11/07 23:03:17 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -507,6 +507,11 @@ sub prettyinput { if ($type eq 'keywords') { my %hash; my $def; + my @cur_values; + foreach (split(/,/,$value)) { + $_ =~ s/^\s+//; + push(@cur_values,$_); + } foreach (split(/,/,$values)) { $_ =~ s/^\s+//; $hash{$_} = $_; @@ -514,7 +519,7 @@ sub prettyinput { if ($only_one) { return(&Apache::loncommon::select_form($def,'new_keywords',%hash)); } else { - return(&Apache::loncommon::multiple_select_form('new_keywords',$value,undef,%hash)); + return(&Apache::loncommon::multiple_select_form('new_keywords',\@cur_values,undef,%hash)); } } if ($type eq 'notes') { @@ -1085,7 +1090,7 @@ ENDEDIT foreach (@fields) { if (defined($env{'form.new_'.$_})) { $Apache::lonpublisher::metadatafields{$_}= - $env{'form.new_'.$_}; + join(',',&Apache::loncommon::get_env_multiple('form.new_'.$_)); } if ($metacourse ne 'none') { # handle restrictions here @@ -1109,7 +1114,7 @@ ENDEDIT my $file_content; foreach my $meta_field (keys %env) { if (&Apache::loncommon::get_env_multiple('form.new_keywords')) { - $Apache::lonpublisher::metadatafields{'keywords'} = + $Apache::lonpublisher::metadatafields{'keywords'} = join (',', &Apache::loncommon::get_env_multiple('form.new_keywords')); } }