--- loncom/interface/lonmeta.pm 2005/10/17 21:36:44 1.113 +++ loncom/interface/lonmeta.pm 2005/10/25 18:46:03 1.117 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.113 2005/10/17 21:36:44 banghart Exp $ +# $Id: lonmeta.pm,v 1.117 2005/10/25 18:46:03 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -237,11 +237,8 @@ sub diffgraph { # The field names sub fieldnames { my $file_type=shift; - my %fields; - if ($file_type eq 'portfolio') { - %fields = - (%fields, - 'title' => 'Title', + my %fields = + ('title' => 'Title', 'author' =>'Author(s)', 'authorspace' => 'Author Space', 'modifyinguser' => 'Last Modifying User', @@ -251,21 +248,6 @@ sub fieldnames { 'abstract' => 'Abstract', 'lowestgradelevel' => 'Lowest Grade Level', 'highestgradelevel' => 'Highest Grade Level'); - } - if ($file_type eq 'restrictedportfolio') { - %fields = - (%fields, - 'metadata.title' => 'Title', - 'metadata.author' =>'Author(s)', - 'metadata.authorspace' => 'Author Space', - 'metadata.modifyinguser' => 'Last Modifying User', - 'metadata.subject' => 'Subject', - 'metadata.keywords' => 'Keyword(s)', - 'metadata.notes' => 'Notes', - 'metadata.abstract' => 'Abstract', - 'metadata.lowestgradelevel' => 'Lowest Grade Level', - 'metadata.highestgradelevel' => 'Highest Grade Level'); - } if (! defined($file_type) || $file_type ne 'portfolio') { %fields = (%fields, @@ -494,10 +476,39 @@ sub relatedfield { sub prettyinput { my ($type,$value,$fieldname,$formname, - $relatedsearchflag,$relatedsep,$relatedvalue,$size)=@_; + $relatedsearchflag,$relatedsep,$relatedvalue,$size,$course_key)=@_; if (! defined($size)) { $size = 80; } + if (defined($course_key)) { + my $stu_add; + my $only_one; + if ($env{$course_key.'.metadata.'.$_.'.options'} =~ m/stuadd/) { + $stu_add = 'true'; + } + if ($env{$course_key.'.metadata.'.$_.'.options'} =~ m/onlyone/) { + $only_one = 'true'; + } + if ($type eq 'author') { + } + if ($type eq 'authorspace') { + } + if ($type eq 'modifyinguser') { + } + if ($type eq 'subject') { + } + if ($type eq 'keywords') { + } + if ($type eq 'notes') { + } + if ($type eq 'abstract') { + if (($type eq 'lowestgradelevel') || + ($type eq 'highestgradelevel')) { + return &Apache::loncommon::select_level_form($value,$fieldname). + &relatedfield(0,$relatedsearchflag,$relatedsep); + } + return(); + } # Language if ($type eq 'language') { return &selectbox($fieldname, @@ -1043,40 +1054,21 @@ ENDEDIT $Apache::lonpublisher::metadatafields{'copyright'}= 'default'; } - $output.=('
'.$lt{$_}.': '. - &prettyinput($_, - $Apache::lonpublisher::metadatafields{$_}, - 'new_'.$_,'defaultmeta').'
'); if ($env{'form.metacourse'}) { - $r->print('This is the instructor metadata area'.$lt{$_}.': '. + &prettyinput($_, + $Apache::lonpublisher::metadatafields{$_}, + 'new_'.$_,'defaultmeta').'
'); } } if ($env{'form.store'}) { @@ -1084,9 +1076,6 @@ ENDEDIT my $formname='store'; my $file_content; foreach my $meta_field (keys %env) { - if ($meta_field=~m/^form.instmeta_(.+)_(\d+)$/) { - $r->print('Found a field'. &mt('Could not write metadata').', '.