--- loncom/interface/lonmeta.pm 2012/05/21 19:01:12 1.246 +++ loncom/interface/lonmeta.pm 2014/02/11 18:52:20 1.252 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.246 2012/05/21 19:01:12 bisitz Exp $ +# $Id: lonmeta.pm,v 1.252 2014/02/11 18:52:20 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -351,7 +351,7 @@ sub pre_select_course { if ($group) { $group_input = ''; } - $r->print('

'. + $r->print(' '. ''. $group_input. ''. @@ -389,9 +389,9 @@ sub select_course { &mt('You can choose to transfer data from the added fields to the "Notes" field if you are planning to change the course association.').'

'. &Apache::loncommon::start_data_table(). &Apache::loncommon::start_data_table_header_row(). - 'Copy to notes?'."\n". - 'Field name'."\n". - 'Values'."\n". + ''.&mt('Copy to notes?').''."\n". + ''.&mt('Field Name').''."\n". + ''.&mt('Values').''."\n". &Apache::loncommon::end_data_table_header_row(). $transfernotes. &Apache::loncommon::end_data_table().'
'; @@ -455,7 +455,7 @@ sub prettyprint { } # MIME if ($type eq 'mime') { - return ' '. + return ' '. &Apache::loncommon::filedescription($value); } # Person @@ -778,7 +778,7 @@ sub handler { if ($env{'request.state'} eq 'construct') { &Apache::lonhtmlcommon::add_breadcrumb({ - 'text' => 'Construction Space', + 'text' => 'Authoring Space', 'href' => &Apache::loncommon::authorspace($uri), }); } @@ -829,7 +829,7 @@ sub handler { $r->print(&pageheader()); &present_editable_metadata($r,$uri,'groups'); } elsif ($uri=~m|^/priv|) { - # Construction space + # Authoring space &Apache::lonhtmlcommon::add_breadcrumb({ 'text' => 'Edit Metadata', 'href' => '', @@ -872,9 +872,13 @@ sub report_bombs { # Set document type $uri =~ s:/adm/bombs/::; $uri = &Apache::lonnet::declutter($uri); - $r->print('

'.&Apache::lonnet::clutter($uri).'

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

'.&mt('Folder: [_1]', + ''.&Apache::lonnet::clutter($uri).'') + .'

' + ); my ($domain,$author)=($uri=~/^($match_domain)\/($match_username)\//); - if (!&Apache::loncacc::constructaccess('/priv/'.$domain.'/'.$author.'/')) { + if (!&Apache::lonnet::constructaccess('/priv/'.$domain.'/'.$author.'/')) { $r->print('

'.&mt('Not authorized').'

'); return; } @@ -965,7 +969,7 @@ sub present_uneditable_metadata { $currentversion : &mt('information not available')).')'; } else { - $versiondisplay='Version: '.$currentversion; + $versiondisplay=&mt('Version: [_1]',$currentversion); } } # crumbify displayed URL uri target prefix form @@ -983,7 +987,7 @@ sub present_uneditable_metadata { my $table=''; my $title = $content{'title'}; if (! defined($title)) { - $title = 'Untitled Resource'; + $title = &mt('Untitled Resource'); } my @fields; if ($uploaded) { @@ -1174,7 +1178,6 @@ sub print_dynamic_metadata { &mt('No Assessment Statistical Data is available for this resource'). ''); } - # # Evaluation Data $r->print('

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

'); @@ -1289,7 +1292,7 @@ sub print_dynamic_metadata { ##################################################### sub present_editable_metadata { my ($r,$uri,$file_type) = @_; - # Construction Space Call + # Authoring Space Call # Header my $disuri=$uri; my $fn=&Apache::lonnet::filelocation('',$uri); @@ -1306,7 +1309,12 @@ sub present_editable_metadata { my $bombs=&Apache::lonmsg::retrieve_author_res_msg($target); if ($bombs) { # Display Bombs, not Metadata - $r->print("

$disuri

"); + $r->print( + '

'.&mt('Error Messages').'

' + .'

'.&mt('Folder: [_1]', + ''.$disuri.'') + .'

' + ); my $showbuttons=1; my $message=''; my $rc=''; @@ -1365,7 +1373,9 @@ sub present_editable_metadata { } else { # Display Metadata, not Bombs - my $displayfile=&mt('Metadata for [_1]',$disuri); + my $displayfile = + &mt('Metadata for [_1]' + ,''.$disuri.''); if ($disuri=~/\/default$/) { my $dir=$disuri; $dir=~s/default$//; @@ -1376,7 +1386,11 @@ sub present_editable_metadata { %Apache::lonpublisher::metadatakeys=(); my $result=&Apache::lonnet::getfile($fn); if ($result == -1){ - $r->print(&mt('Creating new file [_1]'),$meta_uri); + my $message = &Apache::lonhtmlcommon::confirm_success( + &mt('Creating new file [_1]' + ,'')); + $message = &Apache::loncommon::confirmwrapper($message); + $r->print($message); } else { &Apache::lonpublisher::metaeval($result); } @@ -1397,7 +1411,7 @@ sub present_editable_metadata { } } $r->print(<$displayfile

+

$displayfile

ENDEDIT my %lt=&fieldnames($file_type); @@ -1423,7 +1437,7 @@ ENDEDIT @fields = (split(/,/,$env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.fieldlist'})); } else { # no saved field list, use default list - @fields = ('author','title','subject','keywords','abstract', + @fields = ('title','author','subject','keywords','abstract', 'notes','lowestgradelevel', 'highestgradelevel','standards'); if ($Apache::lonpublisher::metadatafields{'courserestricted'} =~ /^course\.($match_domain\_$match_courseid)$/) { @@ -1436,7 +1450,7 @@ ENDEDIT } } } else { - @fields = ('author','title','subject','keywords','abstract','notes', + @fields = ('title','author','subject','keywords','abstract','notes', 'copyright','customdistributionfile','language', 'standards', 'lowestgradelevel','highestgradelevel','sourceavail','sourcerights', @@ -1463,21 +1477,29 @@ ENDEDIT if ($Apache::lonpublisher::metadatafields{'courserestricted'} ne 'none') { if ($file_type eq 'portfolio') { - $r->print(&mt('Associated with course [_1]', - ''. - $env{$Apache::lonpublisher::metadatafields{'courserestricted'}. - ".description"}. - '').'
'); + $r->print( + &mt('Associated with course [_1]' + ,'' + .$env{$Apache::lonpublisher::metadatafields{'courserestricted'} + .".description"}.'') + .' ' + .&mt('Change') + .''.'
' + ); + } else { $r->print(&mt('Associated with course [_1]', ''. $env{$Apache::lonpublisher::metadatafields{'courserestricted'}. ".description"}.'').'
'); } - } else { - $r->print(''.&mt('This resource is not associated with a course.').'
'); - } - } + } else { + $r->print( + &mt('This resource is not associated with a course.') + .' '.&mt('Change').'
' + ); + } + } if (@added_order) { foreach my $field_name (@added_order) { push(@fields,$field_name);