--- loncom/publisher/loncleanup.pm 2011/11/14 00:20:31 1.16
+++ loncom/publisher/loncleanup.pm 2012/12/14 00:27:08 1.19
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to cleanup XML files
#
-# $Id: loncleanup.pm,v 1.16 2011/11/14 00:20:31 raeburn Exp $
+# $Id: loncleanup.pm,v 1.19 2012/12/14 00:27:08 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -34,13 +34,13 @@ use strict;
use Apache::File;
use File::Copy;
use Apache::Constants qw(:common :http :methods);
-use Apache::loncacc;
use Apache::loncommon();
use Apache::lonhtmlcommon();
use Apache::lonlocal;
use Apache::lonnet;
use lib '/home/httpd/lib/perl/';
use LONCAPA;
+use HTML::Entities();
sub latextrans {
@@ -252,17 +252,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()
);
@@ -286,6 +291,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.') + .'
' + .'' + ); + return; + } + my $uri="/priv/$udom/$uname".$fn; my $result=&Apache::lonnet::ssi_body($uri, ('grade_target'=>'web', @@ -340,8 +359,11 @@ sub phasetwo { .'' - .&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 @@ -410,7 +436,7 @@ sub handler { my $uname; my $udom; - ($uname,$udom)=&Apache::loncacc::constructaccess($fn); + ($uname,$udom)=&Apache::lonnet::constructaccess($fn); unless (($uname) && ($udom)) { $r->log_reason($uname.' at '.$udom. ' trying to cleanup file '.$env{'form.filename'}. @@ -437,7 +463,7 @@ sub handler { '' - .&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() );