--- loncom/interface/lonmeta.pm 2004/08/24 21:40:00 1.86 +++ loncom/interface/lonmeta.pm 2005/02/01 17:37:23 1.90 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.86 2004/08/24 21:40:00 albertel Exp $ +# $Id: lonmeta.pm,v 1.90 2005/02/01 17:37:23 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -236,6 +236,17 @@ 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', @@ -280,6 +291,7 @@ sub fieldnames { 'disc' => 'Degree of discrimination', 'dependencies' => 'Resources used by this resource', ); + } } # Pretty printing of metadata field @@ -537,6 +549,11 @@ sub handler { $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 +682,7 @@ $disuri
$obsoletewarning $versiondisplay

- +
$table
ENDHEAD @@ -695,7 +712,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 +737,7 @@ sub print_dynamic_metadata { $r->print('

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

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

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

'); - my $table = ''. + my $table = '
'. ''. ''. ''. @@ -799,7 +816,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 +887,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,12 +932,19 @@ ENDEDIT $r->print(''); - my %lt=&fieldnames(); - foreach ('author','title','subject','keywords','abstract','notes', + my %lt=&fieldnames($file_type); + my $output; + my @fields; + if ($file_type eq 'portfolio') { + @fields = ('author','title','subject','keywords'); + } 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_'.$_}; @@ -929,17 +953,17 @@ ENDEDIT $Apache::lonpublisher::metadatafields{'copyright'}= 'default'; } - $r->print('

'.$lt{$_}.': '. - &prettyinput - ($_,$Apache::lonpublisher::metadatafields{$_}, - 'new_'.$_,'defaultmeta').'

'); + $output.=('

'.$lt{$_}.': '. + &prettyinput($_, + $Apache::lonpublisher::metadatafields{$_}, + 'new_'.$_,'defaultmeta').'

'); } if ($ENV{'form.store'}) { my $mfh; if (! ($mfh=Apache::File->new('>'.$fn))) { - $r->print('

'. + $r->print('

'. &mt('Could not write metadata').', '. - &mt('FAIL').''); + &mt('FAIL').'

'); } else { foreach (sort keys %Apache::lonpublisher::metadatafields) { next if ($_ =~ /\./); @@ -962,10 +986,12 @@ ENDEDIT '<>&"'). ''; } - $r->print('

'.&mt('Wrote Metadata')); + $r->print('

'.&mt('Wrote Metadata'). + ' '.&Apache::lonlocal::locallocaltime(time). + '

'); } } - $r->print('
'); } $r->print('');