--- loncom/interface/lonmeta.pm 2005/10/14 16:34:17 1.112 +++ loncom/interface/lonmeta.pm 2005/12/19 16:00:05 1.140 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.112 2005/10/14 16:34:17 banghart Exp $ +# $Id: lonmeta.pm,v 1.140 2005/12/19 16:00:05 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -238,21 +238,23 @@ sub diffgraph { sub fieldnames { my $file_type=shift; my %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'); + ('title' => 'Title', + 'author' =>'Author(s)', + 'authorspace' => 'Author Space', + 'modifyinguser' => 'Last Modifying User', + 'subject' => 'Subject', + 'standards' => 'Standards', + 'keywords' => 'Keyword(s)', + 'notes' => 'Notes', + 'abstract' => 'Abstract', + 'lowestgradelevel' => 'Lowest Grade Level', + 'highestgradelevel' => 'Highest Grade Level', + 'courserestricted' => 'Course Restricting Metadata'); + if (! defined($file_type) || $file_type ne 'portfolio') { %fields = (%fields, 'domain' => 'Domain', - 'standards' => 'Standards', 'mime' => 'MIME Type', 'language' => 'Language', 'creationdate' => 'Creation Date', @@ -282,55 +284,66 @@ sub fieldnames { 'stdno' => 'Total number of students who have worked on this problem', 'difficulty' => 'Degree of difficulty', 'disc' => 'Degree of discrimination', - 'dependencies' => 'Resources used by this resource', + 'dependencies' => 'Resources used by this resource', ); } return &Apache::lonlocal::texthash(%fields); } - +sub pre_select_course { + my ($r,$uri) = @_; + my $output; + my $fn=&Apache::lonnet::filelocation('',$uri); + my $disuri=$uri; + %Apache::lonpublisher::metadatafields=(); + %Apache::lonpublisher::metadatakeys=(); + my $result=&Apache::lonnet::getfile($fn); + if ($result == -1){ + $r->print('Creating new '.$disuri); + } else { + &Apache::lonpublisher::metaeval($result); + } + $r->print('
'); + return; +} sub select_course { - my ($r)=@_; - my @courses; + my %courses; + my $output; + my $selected; foreach my $key (keys (%env)) { - - if ($key =~ m/^(course\..+)\.metadata\..+\.options/) { - my $course_key = $1; - $course_key .= '.description'; - $r->print($env{$course_key}.' of '.$course_key.'