--- loncom/interface/lonmeta.pm 2005/12/19 20:07:13 1.141
+++ loncom/interface/lonmeta.pm 2005/12/19 21:17:25 1.144
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.141 2005/12/19 20:07:13 albertel Exp $
+# $Id: lonmeta.pm,v 1.144 2005/12/19 21:17:25 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -292,7 +292,7 @@ sub fieldnames {
sub portfolio_display_uri {
my ($uri)=@_;
- $uri =~ s|.*/portfolio(/.*)$|$1|;
+ $uri =~ s|.*/(portfolio/.*)$|$1|;
my ($res_uri,$meta_uri) = ($uri,$uri);
if ($uri =~ /\.meta$/) {
@@ -1142,7 +1142,7 @@ ENDEDIT
} else {
$r->print("This resource is not associated with a course.
");
}
- foreach my $field_name(@fields) {
+ foreach my $field_name (@fields) {
if (defined($env{'form.new_'.$field_name})) {
$Apache::lonpublisher::metadatafields{$field_name}=
@@ -1152,12 +1152,12 @@ ENDEDIT
# handle restrictions here
if (($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'} =~ m/active/) ||
($field_name eq 'courserestricted')){
- $output.=('
'.$lt{$field_name}.': '. + $output.=("\n".'
'.$lt{$field_name}.': '. &prettyinput($field_name, $Apache::lonpublisher::metadatafields{$field_name}, 'new_'.$field_name,'defaultmeta', undef,undef,undef,undef, - $Apache::lonpublisher::metadatafields{'courserestricted'}).'
'); + $Apache::lonpublisher::metadatafields{'courserestricted'}).''."\n"); } } else { @@ -1168,73 +1168,74 @@ ENDEDIT } } - - $r->print($output.''. + &mt('Could not write metadata').', '. + &mt('FAIL').'
'); + } else { + $r->print(''.&mt('Wrote Metadata'). + ' '.&Apache::lonlocal::locallocaltime(time). + '
'); + } + } else { + if (! ($mfh=Apache::File->new('>'.$fn))) { + $r->print(''. + &mt('Could not write metadata').', '. + &mt('FAIL').'
'); + } else { + print $mfh $file_content; + $r->print(''.&mt('Wrote Metadata'). + ' '.&Apache::lonlocal::locallocaltime(time). + '
'); + } + } + } + + $r->print($output.''. - &mt('Could not write metadata').', '. - &mt('FAIL').'
'); - } else { - $r->print(''.&mt('Wrote Metadata'). - ' '.&Apache::lonlocal::locallocaltime(time). - '
'); - } - } else { - if (! ($mfh=Apache::File->new('>'.$fn))) { - $r->print(''. - &mt('Could not write metadata').', '. - &mt('FAIL').'
'); - } else { - print $mfh $file_content; - $r->print(''.&mt('Wrote Metadata'). - ' '.&Apache::lonlocal::locallocaltime(time). - '
'); - } - } - } + return; }