[LON-CAPA-cvs] cvs: loncom(version_2_10_X) /interface lonprintout.pm
raeburn
raeburn@source.lon-capa.org
Thu, 02 Sep 2010 00:17:36 -0000
raeburn Thu Sep 2 00:17:36 2010 EDT
Modified files: (Branch: version_2_10_X)
/loncom/interface lonprintout.pm
Log:
- Backport 1.584.
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.583.2.2 loncom/interface/lonprintout.pm:1.583.2.3
--- loncom/interface/lonprintout.pm:1.583.2.2 Thu Aug 26 09:30:10 2010
+++ loncom/interface/lonprintout.pm Thu Sep 2 00:17:36 2010
@@ -2,7 +2,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.583.2.2 2010/08/26 09:30:10 raeburn Exp $
+# $Id: lonprintout.pm,v 1.583.2.3 2010/09/02 00:17:36 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1685,8 +1685,8 @@
# List of recently generated print files
#
sub recently_generated {
- my $r=shift;
- my $prtspool=$r->dir_config('lonPrtDir');
+ my ($prtspool) = @_;
+ my $output;
my $zip_result;
my $pdf_result;
opendir(DIR,$prtspool);
@@ -1719,10 +1719,10 @@
if ($ext eq 'zip') { $zip_result .= $result; }
}
if ($zip_result || $pdf_result) {
- $r->print('<hr />');
+ $output ='<hr />';
}
if ($zip_result) {
- $r->print('<h3>'.&mt('Recently generated printout zip files')."</h3>\n"
+ $output .='<h3>'.&mt('Recently generated printout zip files')."</h3>\n"
.&Apache::loncommon::start_data_table()
.&Apache::loncommon::start_data_table_header_row()
.'<th>'.&mt('Download').'</th>'
@@ -1730,11 +1730,10 @@
.'<th>'.&mt('File Size (Bytes)').'</th>'
.&Apache::loncommon::end_data_table_header_row()
.$zip_result
- .&Apache::loncommon::end_data_table()
- );
+ .&Apache::loncommon::end_data_table();
}
if ($pdf_result) {
- $r->print('<h3>'.&mt('Recently generated printouts')."</h3>\n"
+ $output .='<h3>'.&mt('Recently generated printouts')."</h3>\n"
.&Apache::loncommon::start_data_table()
.&Apache::loncommon::start_data_table_header_row()
.'<th>'.&mt('Download').'</th>'
@@ -1742,9 +1741,9 @@
.'<th>'.&mt('File Size (Bytes)').'</th>'
.&Apache::loncommon::end_data_table_header_row()
.$pdf_result
- .&Apache::loncommon::end_data_table()
- );
+ .&Apache::loncommon::end_data_table();
}
+ return $output;
}
#
@@ -4129,10 +4128,12 @@
return $helper;
}
- $r->print($helper->display());
+ my $footer;
if ($helper->{STATE} eq 'START') {
- &recently_generated($r);
+ my $prtspool=$r->dir_config('lonPrtDir');
+ $footer = &recently_generated($prtspool);
}
+ $r->print($helper->display($footer));
&Apache::lonhelper::unregisterHelperTags();
return OK;