--- loncom/interface/lonmeta.pm 2004/12/03 21:37:29 1.87 +++ loncom/interface/lonmeta.pm 2005/03/16 22:52:04 1.93 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.87 2004/12/03 21:37:29 albertel Exp $ +# $Id: lonmeta.pm,v 1.93 2005/03/16 22:52:04 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -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 @@ -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.'<head><title>'. '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 @@ -665,7 +677,7 @@ $disuri
$obsoletewarning $versiondisplay

- +
$table
ENDHEAD @@ -695,7 +707,7 @@ sub print_dynamic_metadata { exists($dynmeta{'goto'}) || exists($dynmeta{'course'})) { $r->print('

'.&mt('Access and Usage Statistics').'

'. - ''); + '
'); foreach ('count', 'sequsage','sequsage_list', 'comefrom','comefrom_list', @@ -720,7 +732,7 @@ sub print_dynamic_metadata { $r->print('

'. &mt('Overall Assessment Statistical Data'). '

'. - '
'); + '
'); $r->print(''. '
'.$lt{'stdno'}.''. &prettyprint('stdno',$dynmeta{'stdno'}). @@ -739,7 +751,7 @@ sub print_dynamic_metadata { $r->print('

'. &mt('Detailed Assessment Statistical Data'). '

'); - my $table = ''. + my $table = '
'. ''. ''. ''. @@ -799,7 +811,7 @@ sub print_dynamic_metadata { exists($dynmeta{'correct'}) || exists($dynmeta{'technical'})){ $r->print('

'.&mt('Evaluation Data').'

'. - '
CourseSection(s)
'); + '
'); foreach ('clear','depth','helpful','correct','technical') { $r->print(''. '
'.$lt{$_}.''. @@ -870,7 +882,7 @@ sub print_dynamic_metadata { ##################################################### ##################################################### sub present_editable_metadata { - my ($r,$uri) = @_; + my ($r,$uri, $file_type) = @_; # Construction Space Call # Header my $disuri=$uri; @@ -915,13 +927,20 @@ ENDEDIT $r->print(''); - my %lt=&fieldnames(); + my %lt=&fieldnames($file_type); my $output; - foreach ('author','title','subject','keywords','abstract','notes', + my @fields; + if ($file_type eq 'portfolio') { + @fields = ('author','title','subject','keywords','abstract','notes','lowestgradelevel', + 'highestgradelevel'); + } else { + @fields = ('author','title','subject','keywords','abstract','notes', 'copyright','customdistributionfile','language', 'standards', 'lowestgradelevel','highestgradelevel','sourceavail','sourcerights', - 'obsolete','obsoletereplacement') { + 'obsolete','obsoletereplacement'); + } + foreach (@fields) { if (defined($ENV{'form.new_'.$_})) { $Apache::lonpublisher::metadatafields{$_}= $ENV{'form.new_'.$_};