--- loncom/interface/lonmeta.pm 2005/01/18 01:44:12 1.88
+++ 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.88 2005/01/18 01:44:12 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;
@@ -236,9 +236,9 @@ sub diffgraph {
# The field names
sub fieldnames {
- return &Apache::lonlocal::texthash
- (
- 'title' => 'Title',
+ my $file_type=shift;
+ my %fields =
+ ('title' => 'Title',
'author' =>'Author(s)',
'authorspace' => 'Author Space',
'modifyinguser' => 'Last Modifying User',
@@ -247,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',
@@ -280,6 +284,8 @@ sub fieldnames {
'disc' => 'Degree of discrimination',
'dependencies' => 'Resources used by this resource',
);
+ }
+ return &Apache::lonlocal::texthash(%fields);
}
# Pretty printing of metadata field
@@ -332,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
@@ -530,13 +536,19 @@ sub handler {
#
my ($resdomain,$resuser)=
(&Apache::lonnet::declutter($uri)=~/^(\w+)\/(\w+)\//);
- $r->print('
'.
+ my $html=&Apache::lonxml::xmlbegin();
+ $r->print($html.''.
'Catalog Information'.
'');
if ($uri=~m:/adm/bombs/(.*)$:) {
$r->print(&Apache::loncommon::bodytag('Error Messages'));
# Looking for all bombs?
&report_bombs($r,$uri);
+ } elsif ($uri=~/\/portfolio\//) {
+ $r->print(&Apache::loncommon::bodytag
+ ('Edit Portfolio File Information','','','',$resdomain));
+ &present_editable_metadata($r,$uri,'portfolio');
+
} elsif ($uri=~/^\/\~/) {
# Construction space
$r->print(&Apache::loncommon::bodytag
@@ -566,6 +578,15 @@ sub report_bombs {
$r->print('
'.&Apache::lonnet::clutter($uri).'
');
my ($domain,$author)=($uri=~/^(\w+)\/(\w+)\//);
if (&Apache::loncacc::constructaccess('/~'.$author.'/',$domain)) {
+ if ($env{'form.clearbombs'}) {
+ &Apache::lonmsg::clear_author_res_msg($uri);
+ }
+ my $clear=&mt('Clear all Messages in Subdirectory');
+ $r->print(<
+
+
+ENDCLEAR
my %brokenurls =
&Apache::lonmsg::all_url_author_res_msg($author,$domain);
foreach (sort(keys(%brokenurls))) {
@@ -620,7 +641,7 @@ sub present_uneditable_metadata {
# obsolete
my $obsolete=$content{'obsolete'};
my $obsoletewarning='';
- if (($obsolete) && ($ENV{'user.adv'})) {
+ if (($obsolete) && ($env{'user.adv'})) {
$obsoletewarning='
'.
&mt('This resource has been marked obsolete by the author(s)').
'
';
@@ -669,7 +690,7 @@ $versiondisplay
$table
ENDHEAD
- if ($ENV{'user.adv'}) {
+ if ($env{'user.adv'}) {
&print_dynamic_metadata($r,$uri,\%content);
}
return;
@@ -810,8 +831,8 @@ sub print_dynamic_metadata {
$r->print('
'.&mt('No Evaluation Data is available for this resource.').'