--- loncom/publisher/loncleanup.pm 2008/12/24 07:58:34 1.10
+++ loncom/publisher/loncleanup.pm 2009/09/09 17:58:37 1.11
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to cleanup XML files
#
-# $Id: loncleanup.pm,v 1.10 2008/12/24 07:58:34 raeburn Exp $
+# $Id: loncleanup.pm,v 1.11 2009/09/09 17:58:37 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,6 +36,7 @@ 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/';
@@ -248,20 +249,34 @@ sub htmlclean {
sub phaseone {
my ($r,$fn,$uname,$udom)=@_;
- $r->print(&mt('Select actions to attempt:').
- '
'.
- &mt('Linefeeds, formfeeds, and carriage returns').
- '
'.
- &mt('Empty tags').
- '
'.
- &mt('Lower casing').
- '
'.
- &mt('Symbol font').
- ''.
- '
' + .'' + .'
' + ); } sub phasetwo { + # Check original file my ($r,$fn,$uname,$udom)=@_; open(IN,'/home/'.$uname.'/public_html/'.$fn); my $text=''; @@ -274,9 +289,20 @@ sub phasetwo { ('grade_target'=>'web', 'return_only_error_and_warning_counts' => 1)); my ($errorcount,$warningcount)=split(':',$result); - $r->print(&mt('Original file').': '. - $errorcount.' '.&mt('error(s)').', '. - $warningcount.' '.&mt('warning(s)')); + + # Display results for original file + $r->print( + &Apache::lonhtmlcommon::start_pick_box() + .&Apache::lonhtmlcommon::row_title(&mt('Original file')) + .&Apache::lonhtmlcommon::confirm_success( + &mt('[quant,_1,error]',$errorcount), $errorcount) + .'' + .'' + .'' + .' ' + .'
' + ); } sub phasethree { @@ -314,10 +361,18 @@ sub phasethree { my $newfn=$main.'_Auto_Cleaned_Up.'.$ext; my $new='/home/'.$uname.'/public_html'.$newfn; if ($env{'form.accept'}) { - $r->print(&mt('Accepting changes')); + $r->print( + '' + .&mt('Accepting changes') + .'
' + ); move($new,$old); } else { - $r->print(&mt('Rejeting changes')); + $r->print( + '' + .&mt('Rejecting changes') + .'
' + ); unlink($new); } } @@ -367,7 +422,15 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; - $r->print(&Apache::loncommon::start_page('Cleanup XML Document')); + # Breadcrumbs + my $brcrum = [{'href' => &Apache::loncommon::authorspace(), + 'text' => 'Construction Space'}, + {'href' => '', + 'text' => 'Cleanup XML Document'}]; + + $r->print(&Apache::loncommon::start_page('Cleanup XML Document', + undef, + {'bread_crumbs' => $brcrum,})); $r->print('The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.