[LON-CAPA-cvs] cvs: loncom /interface lonmeta.pm
banghart
lon-capa-cvs@mail.lon-capa.org
Wed, 02 Nov 2005 01:02:32 -0000
banghart Tue Nov 1 20:02:32 2005 EDT
Modified files:
/loncom/interface lonmeta.pm
Log:
Course restricted metadata multiple keyword works. Saves and echoes.
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.121 loncom/interface/lonmeta.pm:1.122
--- loncom/interface/lonmeta.pm:1.121 Mon Oct 31 16:11:45 2005
+++ loncom/interface/lonmeta.pm Tue Nov 1 20:02:31 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.121 2005/10/31 21:11:45 banghart Exp $
+# $Id: lonmeta.pm,v 1.122 2005/11/02 01:02:31 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -508,12 +508,13 @@
my %hash;
my $def;
foreach (split(/,/,$values)) {
+ $_ =~ s/^\s+//;
$hash{$_} = $_;
}
if ($only_one) {
return(&Apache::loncommon::select_form($def,'new_keywords',%hash));
} else {
- return(&Apache::loncommon::multiple_select_form('new_keywords',undef,undef,%hash));
+ return(&Apache::loncommon::multiple_select_form('new_keywords',$value,undef,%hash));
}
}
if ($type eq 'notes') {
@@ -1081,7 +1082,6 @@
$Apache::lonpublisher::metadatafields{'copyright'}=
'default';
}
- &Apache::lonnet::logthis($metacourse.' is the restriction');
foreach (@fields) {
if (defined($env{'form.new_'.$_})) {
$Apache::lonpublisher::metadatafields{$_}=
@@ -1108,9 +1108,9 @@
my $formname='store';
my $file_content;
foreach my $meta_field (keys %env) {
- if (&Apache::loncommon::get_env_multiple('form.keywords')) {
- $Apache::lonpublisher::metadatafields{'coursekeyword'} =
- join (', ', &Apache::loncommon::get_env_multiple('form.keywords'));
+ if (&Apache::loncommon::get_env_multiple('form.new_keywords')) {
+ $Apache::lonpublisher::metadatafields{'keywords'} =
+ join (',', &Apache::loncommon::get_env_multiple('form.new_keywords'));
}
}
foreach (sort keys %Apache::lonpublisher::metadatafields) {