--- loncom/publisher/loncleanup.pm 2012/10/29 17:38:55 1.17 +++ loncom/publisher/loncleanup.pm 2012/12/05 18:19:45 1.18 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to cleanup XML files # -# $Id: loncleanup.pm,v 1.17 2012/10/29 17:38:55 raeburn Exp $ +# $Id: loncleanup.pm,v 1.18 2012/12/05 18:19:45 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -251,17 +251,22 @@ sub phaseone { $r->print( &Apache::lonhtmlcommon::start_pick_box() .&Apache::lonhtmlcommon::row_title(&mt('Select actions to attempt')) + .'
' + .'
' + .'
' + .'' .&Apache::lonhtmlcommon::row_closure(1) .&Apache::lonhtmlcommon::end_pick_box() ); @@ -285,6 +290,20 @@ sub phasetwo { } close(IN); } + # Check if any selection was made + if ($env{'form.linefeed'} ne 'on' && + $env{'form.empty'} ne 'on' && + $env{'form.lower'} ne 'on' && + $env{'form.symbol'} ne 'on') { + $r->print( + '

' + .&mt('Please select at least one option.') + .'

' + .'

'.&mt('Back').'

' + ); + return; + } + my $uri="/priv/$udom/$uname".$fn; my $result=&Apache::lonnet::ssi_body($uri, ('grade_target'=>'web', @@ -339,8 +358,11 @@ sub phasetwo { .'
  • ' .&mt('Open (and edit) cleaned up file in new window') .'
  • ' - .'
  • ' + .'
  • ' .&mt('Show diffs in new window') .'
  • ' .'' @@ -363,20 +385,24 @@ sub phasethree { my $newfn=$main.'_Auto_Cleaned_Up.'.$ext; my $new=$r->dir_config('lonDocRoot')."/priv/$udom/$uname".$newfn; if ($env{'form.accept'}) { - $r->print( + $r->print( '

    ' - .&mt('Accepting changes') + .&mt('Accepting changes...') .'

    ' ); move($new,$old); } else { - $r->print( + $r->print( '

    ' - .&mt('Rejecting changes') + .&mt('Rejecting changes...') .'

    ' - ); + ); unlink($new); } + $r->print( + '

    ' + .&Apache::lonhtmlcommon::confirm_success(&mt('Done'))); + '

    ' } # ---------------------------------------------------------------- Main Handler @@ -436,7 +462,7 @@ sub handler { '
    '. ''); unless ($fn=~/\.(problem|exam|quiz|assess|survey|form|library|xml|html|htm|xhtml|xhtm|sty)$/) { - $r->print(&mt('Cannot cleanup this filetype')); + $r->print('

    '.&mt('Cannot cleanup this filetype').'

    '); } else { if ($env{'form.phase'} eq 'three') { &phasethree($r,$fn,$uname,$udom); @@ -450,12 +476,11 @@ sub handler { $dir=~s{[^/]+$}{}; $r->print( '
    ' - .&Apache::lonhtmlcommon::start_funclist() - .&Apache::lonhtmlcommon::add_item_funclist( - ''.&mt('Back to Source File').'') - .&Apache::lonhtmlcommon::add_item_funclist( - ''.&mt('Back to Source Directory').'') - .&Apache::lonhtmlcommon::end_funclist() + .&Apache::lonhtmlcommon::actionbox( + [''. + &mt('Back to Source File').'', + ''. + &mt('Back to Source Directory').'']) .&Apache::loncommon::end_page() );