--- loncom/publisher/lonpublisher.pm 2008/06/27 18:52:35 1.238 +++ loncom/publisher/lonpublisher.pm 2008/06/30 18:10:24 1.239 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.238 2008/06/27 18:52:35 bisitz Exp $ +# $Id: lonpublisher.pm,v 1.239 2008/06/30 18:10:24 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -274,7 +274,7 @@ sub metaread { } &metaeval($metastring,$prefix); return '
'.&mt('Processed file').': '. - &Apache::loncfile::display($fn).''; + &Apache::loncfile::display($fn).'
'; } ######################################### @@ -797,7 +797,7 @@ sub fix_ids_and_indices { } if ((($token->[1] eq 'part') || ($token->[1] eq 'problem')) && (!$responsecounter)) { - my $outstring=''.&mt('Found [_1] without responses',$token->[1]).''; + my $outstring=''.&mt('Found [_1] without responses. This resource cannot be published.',$token->[1]).''; return ($outstring,1); } } else { @@ -968,7 +968,7 @@ sub publish { print $logfile "Copied original file to ".$copyfile."\n"; } else { print $logfile "Unable to write backup ".$copyfile.':'.$!."\n"; - return ("Failed to write backup copy, $!,FAIL",1); + return ("".&mt("Failed to write backup copy, [_1], FAIL",$1)."",1); } # ------------------------------------------------------------- IDs and indices @@ -1044,7 +1044,7 @@ sub publish { unless ($batch) { $scrout.='

'.&mt('Metadata Information').' ' . - Apache::loncommon::help_open_topic("Metadata_Description") + &Apache::loncommon::help_open_topic("Metadata_Description") . '

'; } @@ -1195,15 +1195,17 @@ sub publish { # $env{'from.'..} so that it can be used by the phase two handler in # batch mode - my $intr_scrout.=&Apache::lonhtmlcommon::start_pick_box() + my $intr_scrout.='
' .'
'; unless ($env{'form.makeobsolete'}) { - $intr_scrout.=&Apache::lonhtmlcommon::row_title() - .'' - .&Apache::lonhtmlcommon::row_closure() + .'" />

'; } + $intr_scrout.=&Apache::lonhtmlcommon::start_pick_box(); $intr_scrout.= &hiddenfield('phase','two'). &hiddenfield('filename',$env{'form.filename'}). @@ -1390,12 +1392,11 @@ END } if (!$batch) { $scrout.=$intr_scrout - .&Apache::lonhtmlcommon::row_title() - .''.&Apache::lonhtmlcommon::row_closure() - .'
' - .&Apache::lonhtmlcommon::end_pick_box(); + .'" />

' + .''; } return($scrout,0); } @@ -1597,7 +1598,7 @@ sub phasetwo { unless ($srcd=~/^\/home\/httpd\/html\/res/) { print $logfile "\nPANIC: Target dir is ".$srcd; $r->print( - "Invalid target directory, FAIL"); + "".&mt('Invalid target directory, FAIL').""); return 0; } opendir(DIR,$srcd); @@ -2122,28 +2123,57 @@ sub handler { my $thistype=$1; my $thisembstyle=&Apache::loncommon::fileembstyle($thistype); if ($thistype eq 'page') { $thisembstyle = 'rat'; } - $r->print('

'.&mt('Publishing').' '. - &Apache::loncommon::filedescription($thistype).' '); + $r->print('

'.&mt('Publishing [_1]',''.$thisdisfn.'').'

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

'.&mt('Resource Details').'

'); + + $r->print(&Apache::lonhtmlcommon::start_pick_box()); + + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Type')) + .&Apache::loncommon::filedescription($thistype) + .&Apache::lonhtmlcommon::row_closure() + ); + + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Link to Resource')) + .'' + ); $r->print(< $thisdisfn ENDCAPTION - $r->print('

'.&mt('Target').': '. - $thisdistarget.'
'); - + $r->print('
' + .&Apache::lonhtmlcommon::row_closure() + ); + + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Target')) + .''.$thisdistarget.'' + .&Apache::lonhtmlcommon::row_closure() + ); + +# SB - ToDo: if (($cuname ne $env{'user.name'})||($cudom ne $env{'user.domain'})) { - $r->print('

'.&mt('Co-Author').': '. - $cuname.&mt(' at ').$cudom.'

'); +# $r->print(&Apache::lonhtmlcommon::row_title(''.&mt('Co-Author').'') + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Co-Author')) + .'' + .&mt('[_1] at [_2]',$cuname,$cudom) + .'' + .&Apache::lonhtmlcommon::row_closure() + ); } if (&Apache::loncommon::fileembstyle($thistype) eq 'ssi') { + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Diffs'))); $r->print(< ENDDIFF - $r->print(&mt('Diffs with Current Version').'
'); + $r->print(&mt('Diffs with Current Version').'' + .&Apache::lonhtmlcommon::row_closure() + ); + } + + $r->print(&Apache::lonhtmlcommon::end_pick_box()); # ------------------ Publishing from $thisfn to $thistarget with $thisembstyle. @@ -2158,7 +2188,7 @@ ENDDIFF &publish($thisfn,$thistarget,$thisembstyle); $r->print('
'.$outstring); } else { - $r->print('

'. + $r->print('

'. &mt('The document contains errors and cannot be published.'). '

'); }