--- loncom/interface/lonmeta.pm 2005/08/04 23:47:37 1.103 +++ 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.103 2005/08/04 23:47:37 banghart Exp $ +# $Id: lonmeta.pm,v 1.140 2005/12/19 16:00:05 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -243,16 +243,18 @@ sub fieldnames { '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'); + '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,41 +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)=@_; - $r->print(''.
&mt('Could not write metadata').', '.
@@ -1090,10 +1217,6 @@ ENDEDIT
}
}
}
- $r->print($output.'
');
- }
- $r->print('');
return;
}