--- loncom/interface/lonmeta.pm 2005/02/01 17:37:23 1.90 +++ loncom/interface/lonmeta.pm 2005/07/13 22:09:11 1.99 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.90 2005/02/01 17:37:23 banghart Exp $ +# $Id: lonmeta.pm,v 1.99 2005/07/13 22:09:11 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,7 +31,7 @@ package Apache::lonmeta; use strict; use LONCAPA::lonmetadata(); use Apache::Constants qw(:common); -use Apache::lonnet(); +use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::lonmsg; @@ -237,19 +237,8 @@ sub diffgraph { # The field names sub fieldnames { my $file_type=shift; - if ($file_type eq 'portfolio') { - return &Apache::lonlocal::texthash - ( - 'title' => 'Title', - 'author' =>'Author(s)', - 'authorspace' => 'Author Space', - 'modifyinguser' => 'Last Modifying User', - 'subject' => 'Subject', - 'keywords' => 'Keyword(s)'); - } else { - return &Apache::lonlocal::texthash - ( - 'title' => 'Title', + my %fields = + ('title' => 'Title', 'author' =>'Author(s)', 'authorspace' => 'Author Space', 'modifyinguser' => 'Last Modifying User', @@ -258,7 +247,11 @@ sub fieldnames { 'notes' => 'Notes', 'abstract' => 'Abstract', 'lowestgradelevel' => 'Lowest Grade Level', - 'highestgradelevel' => 'Highest Grade Level', + 'highestgradelevel' => 'Highest Grade Level'); + if (! defined($file_type) || $file_type ne 'portfolio') { + %fields = + (%fields, + 'domain' => 'Domain', 'standards' => 'Standards', 'mime' => 'MIME Type', 'language' => 'Language', @@ -291,7 +284,8 @@ sub fieldnames { 'disc' => 'Degree of discrimination', 'dependencies' => 'Resources used by this resource', ); - } + } + return &Apache::lonlocal::texthash(%fields); } # Pretty printing of metadata field @@ -344,7 +338,7 @@ sub prettyprint { return &Apache::loncommon::gradeleveldescription($value); } # Only for advance users below - if (! $ENV{'user.adv'}) { + if (! $env{'user.adv'}) { return '- '.&mt('not displayed').' -'; } # File @@ -542,7 +536,8 @@ sub handler { # my ($resdomain,$resuser)= (&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//); - $r->print('
'. &mt('This resource has been marked obsolete by the author(s)'). '
'; @@ -686,7 +690,7 @@ $versiondisplay $table ENDHEAD - if ($ENV{'user.adv'}) { + if ($env{'user.adv'}) { &print_dynamic_metadata($r,$uri,\%content); } return; @@ -827,8 +831,8 @@ sub print_dynamic_metadata { $r->print('