--- loncom/interface/lonmeta.pm 2007/01/12 22:13:51 1.196
+++ loncom/interface/lonmeta.pm 2007/01/16 07:26:45 1.199
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.196 2007/01/12 22:13:51 albertel Exp $
+# $Id: lonmeta.pm,v 1.199 2007/01/16 07:26:45 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -598,9 +598,15 @@ sub prettyinput {
if ($meta_options{$item}) {
push(@cur_values_inst,$item);
} else {
- $cur_values_stu .= $item.',';
+ if ($item ne 'Not Specified') {
+ $cur_values_stu .= $item.',';
+ }
}
}
+ my @key_order = sort(keys(%meta_options));
+ unshift (@key_order,'Not Specified');
+ $meta_options{'Not Specified'} = 'Not Specified';
+ $meta_options{'select_form_order'} = \@key_order;
} else {
$cur_values_stu = $value;
}
@@ -608,11 +614,11 @@ sub prettyinput {
return (&select_course());
# return ('');
}
- my $course = $env{'request.course.id'};
if (($type eq 'keywords') || ($type eq 'subject')
|| ($type eq 'author')||($type eq 'notes')
|| ($type eq 'abstract')|| ($type eq 'title')|| ($type eq 'standards')
- || (exists($env{'course.'.$env{'request.course.id'}.'.metadata.'.$type.'.added'}))) {
+ || (exists($env{$course_key.'.metadata.'.$type.'.added'}))) {
+
if ($values) {
if ($only_one) {
$output .= (&Apache::loncommon::select_form($cur_values_inst[0],'new_'.$type,%meta_options));
@@ -750,7 +756,6 @@ sub handler {
%Apache::lonpublisher::metadatakeys=();
my $result=&Apache::lonnet::getfile($fn);
&Apache::lonpublisher::metaeval($result);
- &Apache::lonnet::logthis("restricted is: ".$Apache::lonpublisher::metadatafields{'courserestricted'});
if ((!$Apache::lonpublisher::metadatafields{'courserestricted'}) ||
($env{'form.changecourse'} eq 'true')) {
&pre_select_course($r,$uri);
@@ -1253,8 +1258,8 @@ ENDEDIT
$Apache::lonpublisher::metadatafields{'owner'} =
$env{'user.name'}.':'.$env{'user.domain'};
}
-
if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none') {
+
if ($file_type eq 'portfolio') {
$r->print(&mt('Associated with course [_1]',
''.