--- loncom/interface/lonmeta.pm 2005/12/05 20:30:16 1.134 +++ 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.134 2005/12/05 20:30:16 banghart Exp $ +# $Id: lonmeta.pm,v 1.140 2005/12/19 16:00:05 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -289,10 +289,30 @@ sub fieldnames { } 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('
'.$lt{$field_name}.': '. &prettyinput($field_name, $Apache::lonpublisher::metadatafields{$field_name}, - 'new_'.$field_name,'defaultmeta',undef,undef,undef,undef,$metacourse).'
'.$lt{$field_name}.': '. &prettyinput($field_name, $Apache::lonpublisher::metadatafields{$field_name}, 'new_'.$field_name,'defaultmeta').'