--- loncom/publisher/lonpublisher.pm 2009/03/26 11:27:26 1.254 +++ loncom/publisher/lonpublisher.pm 2009/05/14 11:13:49 1.258 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.254 2009/03/26 11:27:26 bisitz Exp $ +# $Id: lonpublisher.pm,v 1.258 2009/05/14 11:13:49 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -384,11 +384,11 @@ sub selectbox { my $selout="\n".&Apache::lonhtmlcommon::row_title($title) .''.&Apache::lonhtmlcommon::row_closure(); return $selout; @@ -1166,15 +1166,16 @@ sub publish { } } if ($chparms) { - $scrout.='

'.&mt('Obsolete parameters or saved values').': '. - $chparms.'

'.&mt('Warning!'). - '

'. - &mt('If this resource is in active use, student performance data from the previous version may become inaccessible.').'


'; + $scrout.='

'.&mt('Obsolete parameters or saved values').': ' + .$chparms.'

' + .'

'.&mt('Warning!').'
' + .&mt('If this resource is in active use, student performance data from the previous version may become inaccessible.') + .'


'; } if ($metadatafields{'copyright'} eq 'priv') { - $scrout.='

'.&mt('Warning!'). - '

'. - &mt('Copyright/distribution option "Private" is no longer supported. Select another option from below. Consider "Custom Rights" for maximum control over the usage of your resource.').'


'; + $scrout.='

'.&mt('Warning!').'
' + .&mt('Copyright/distribution option "Private" is no longer supported. Select another option from below. Consider "Custom Rights" for maximum control over the usage of your resource.') + .'


'; } # ------------------------------------------------------- Now have all metadata @@ -1401,9 +1402,9 @@ END (&Apache::loncommon::source_copyrightids)); # $intr_scrout.=&text_with_browse_field('Source Custom Distribution File','sourcerights',$metadatafields{'sourcerights'},'rights'); my $uctitle=&mt('Obsolete'); - my $obsolete_checked=($metadatafields{'obsolete'})?' checked="1" ':''; + my $obsolete_checked=($metadatafields{'obsolete'})?' checked="checked"':''; $intr_scrout.="\n".&Apache::lonhtmlcommon::row_title($uctitle) - .'' + .'' .&Apache::lonhtmlcommon::row_closure(1); $intr_scrout.=&text_with_browse_field('Suggested Replacement for Obsolete File', 'obsoletereplacement', @@ -1708,8 +1709,12 @@ sub phasetwo { $path.="/$parts[$count]"; if ((-e $path)!=1) { print $logfile "\nCreating directory ".$path; - $r->print('

'.&mt('Created directory').' '.$parts[$count].'

'); mkdir($path,0777); + $r->print('

' + .&mt('Created directory [_1]' + ,''.$parts[$count].'') + .'

' + ); } } @@ -1752,9 +1757,12 @@ sub phasetwo { &Apache::lonnet::devalidate_cache_new('meta', &Apache::lonnet::declutter($thisdistarget)); +# ------------------------------------------------------------- Everything done + $logfile->close(); + $r->print('

'.&mt('Done').'

'); + # ------------------------------------------------ Provide link to new resource unless ($batch) { - my $thissrc=$source; $thissrc=~s{^/home/($match_username)/public_html}{/priv/$1}; @@ -1771,8 +1779,6 @@ sub phasetwo { '">'. &mt('Back to Source Directory').'

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

'.&mt('Done').'

'); return 1; } @@ -1870,12 +1876,20 @@ sub publishdirectory { my $resdir= $Apache::lonnet::perlvar{'lonDocRoot'}.'/res/'.$cudom.'/'.$cuname.'/'. $thisdisfn; - $r->print('

'.&mt('Directory').' '.$thisdisfn.'

'. - &mt('Target').': '.$resdir.'
'); + $r->print(&Apache::lonhtmlcommon::start_pick_box() + .&Apache::lonhtmlcommon::row_title(&mt('Directory')) + .''.$thisdisfn.'' + .&Apache::lonhtmlcommon::row_closure() + .&Apache::lonhtmlcommon::row_title(&mt('Target')) + .''.$resdir.'' + ); my $dirptr=16384; # Mask indicating a directory in stat.cmode. unless ($env{'form.phase'} eq 'two') { # ask user what they want + $r->print(&Apache::lonhtmlcommon::row_closure() + .&Apache::lonhtmlcommon::row_title(&mt('Options')) + ); $r->print('
'. &hiddenfield('phase','two'). &hiddenfield('filename',$env{'form.filename'}). @@ -1884,8 +1898,14 @@ sub publishdirectory { &checkbox('obsolete','make file(s) obsolete'). &checkbox('forceoverride','force directory level metadata over existing'). '
'); + $r->print(&Apache::lonhtmlcommon::row_closure(1) + .&Apache::lonhtmlcommon::end_pick_box() + ); $lock=0; } else { + $r->print(&Apache::lonhtmlcommon::row_closure(1) + .&Apache::lonhtmlcommon::end_pick_box() + ); unless ($lock) { $lock=&Apache::lonnet::set_lock(&mt('Publishing [_1]',$fn)); } # actually publish things opendir(DIR,$fn); @@ -1965,8 +1985,12 @@ sub defaultmetapublish { for ($count=5;$count<$#parts;$count++) { $path.="/$parts[$count]"; if ((-e $path)!=1) { - $r->print('

'.&mt('Created directory').' '.$parts[$count].'

'); mkdir($path,0777); + $r->print('

' + .&mt('Created directory [_1]' + ,''.$parts[$count].'') + .'

' + ); } } @@ -2206,7 +2230,7 @@ ENDCAPTION $r->print(&Apache::lonhtmlcommon::row_closure() .&Apache::lonhtmlcommon::row_title(&mt('Co-Author')) .'' - .&mt('[_1] at [_2]',$cuname,$cudom) + .&Apache::loncommon::plainname($cuname,$cudom) .' ('.$cuname.':'.$cudom.')' .'' ); }