[LON-CAPA-cvs] cvs: loncom /interface lonmeta.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 04 Aug 2006 22:14:39 -0000
albertel Fri Aug 4 18:14:39 2006 EDT
Modified files:
/loncom/interface lonmeta.pm
Log:
- making the display of uploaded files only display relevant fields
- adding mime info and autor info in by default
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.162 loncom/interface/lonmeta.pm:1.163
--- loncom/interface/lonmeta.pm:1.162 Fri Aug 4 15:42:55 2006
+++ loncom/interface/lonmeta.pm Fri Aug 4 18:14:38 2006
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.162 2006/08/04 19:42:55 albertel Exp $
+# $Id: lonmeta.pm,v 1.163 2006/08/04 22:14:38 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -841,30 +841,38 @@
if (! defined($title)) {
$title = 'Untitled Resource';
}
- foreach ('title',
- 'author',
- 'subject',
- 'keywords',
- 'notes',
- 'abstract',
- 'lowestgradelevel',
- 'highestgradelevel',
- 'standards',
- 'mime',
- 'language',
- 'creationdate',
- 'lastrevisiondate',
- 'owner',
- 'copyright',
- 'customdistributionfile',
- 'sourceavail',
- 'sourcerights',
- 'obsolete',
- 'obsoletereplacement') {
- $table.='<tr><td bgcolor="#AAAAAA">'.$lt{$_}.
+ my @fields;
+ if ($uploaded) {
+ @fields = ('title','author','subject','keywords','notes','abstract',
+ 'lowestgradelevel','highestgradelevel','standards','mime',
+ 'owner');
+ } else {
+ @fields = ('title',
+ 'author',
+ 'subject',
+ 'keywords',
+ 'notes',
+ 'abstract',
+ 'lowestgradelevel',
+ 'highestgradelevel',
+ 'standards',
+ 'mime',
+ 'language',
+ 'creationdate',
+ 'lastrevisiondate',
+ 'owner',
+ 'copyright',
+ 'customdistributionfile',
+ 'sourceavail',
+ 'sourcerights',
+ 'obsolete',
+ 'obsoletereplacement');
+ }
+ foreach my $field (@fields) {
+ $table.='<tr><td bgcolor="#AAAAAA">'.$lt{$field}.
'</td><td bgcolor="#CCCCCC">'.
- &prettyprint($_,$content{$_}).'</td></tr>';
- delete $content{$_};
+ &prettyprint($field,$content{$field}).'</td></tr>';
+ delete($content{$field});
}
#
$r->print(<<ENDHEAD);
@@ -1163,7 +1171,8 @@
my $output;
my @fields;
if ($file_type eq 'portfolio') {
- @fields = ('author','title','subject','keywords','abstract','notes','lowestgradelevel',
+ @fields = ('author','title','subject','keywords','abstract',
+ 'notes','lowestgradelevel',
'highestgradelevel','standards');
} else {
@fields = ('author','title','subject','keywords','abstract','notes',
@@ -1182,9 +1191,18 @@
}
if (! $Apache::lonpublisher::metadatafields{'copyright'}) {
$Apache::lonpublisher::metadatafields{'copyright'}=
- 'default';
+ 'default';
}
if ($file_type eq 'portfolio') {
+ if (! $Apache::lonpublisher::metadatafields{'mime'}) {
+ ($Apache::lonpublisher::metadatafields{'mime'}) =
+ ( $target=~/\.(\w+)$/ );
+ }
+ if (! $Apache::lonpublisher::metadatafields{'owner'}) {
+ $Apache::lonpublisher::metadatafields{'owner'} =
+ $env{'user.name'}.':'.$env{'user.domain'};
+ }
+
if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none') {
$r->print(&mt('Associated with course [_1]','<strong>'.$env{$Apache::lonpublisher::metadatafields{'courserestricted'}.".description"}.
'</strong>').'<br />');