--- loncom/interface/lonmeta.pm 2005/10/31 01:49:21 1.120 +++ loncom/interface/lonmeta.pm 2005/11/19 00:16:01 1.130 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.120 2005/10/31 01:49:21 banghart Exp $ +# $Id: lonmeta.pm,v 1.130 2005/11/19 00:16:01 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -240,8 +240,6 @@ sub fieldnames { my %fields = ('title' => 'Title', 'author' =>'Author(s)', - 'authorspace' => 'Author Space', - 'modifyinguser' => 'Last Modifying User', 'subject' => 'Subject', 'keywords' => 'Keyword(s)', 'notes' => 'Notes', @@ -304,7 +302,7 @@ sub select_course { } $r->print('

Course Related Meta-Data


'); $r->print('
'); - $r->print('Select your test course
'); + $r->print('Select course restrictions
'); $r->print(''); + } + if (($type eq 'keywords') || ($type eq 'subject') + || ($type eq 'author')||($type eq 'notes') + || ($type eq 'abstract')|| ($type eq 'title')) { + if ($values) { + if ($only_one) { + $output .= (&Apache::loncommon::select_form($value,'new_'.$type,%meta_options)); + } else { + $output .= (&Apache::loncommon::multiple_select_form('new_'.$type,\@cur_values_inst,undef,\%meta_options)); + } + } + if ($stu_add) { + $output .= ''. + &relatedfield(1,$relatedsearchflag,$relatedsep,$fieldname, + $relatedvalue); + } + return ($output); } - if ($type eq 'abstract') { - } - if (($type eq 'lowestgradelevel') || ($type eq 'highestgradelevel')) { return &Apache::loncommon::select_level_form($value,$fieldname). @@ -1078,35 +1094,55 @@ ENDEDIT $Apache::lonpublisher::metadatafields{'copyright'}= 'default'; } - &Apache::lonnet::logthis($metacourse.' is the restriction'); + if ($metacourse ne 'none') { + $r->print('Document metadata restricted by : '.$env{$metacourse.".description"}."
"); + } + foreach (@fields) { if (defined($env{'form.new_'.$_})) { $Apache::lonpublisher::metadatafields{$_}= - $env{'form.new_'.$_}; + 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/) { + 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'; 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) {