[LON-CAPA-cvs] cvs: loncom(version_2_9_X) /interface lonprintout.pm

raeburn raeburn@source.lon-capa.org
Sat, 13 Nov 2010 01:57:14 -0000


raeburn		Sat Nov 13 01:57:14 2010 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/interface	lonprintout.pm 
  Log:
  - Backport 1.584.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.568.2.9 loncom/interface/lonprintout.pm:1.568.2.10
--- loncom/interface/lonprintout.pm:1.568.2.9	Wed Aug  4 22:23:26 2010
+++ loncom/interface/lonprintout.pm	Sat Nov 13 01:57:14 2010
@@ -2,7 +2,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.568.2.9 2010/08/04 22:23:26 raeburn Exp $
+# $Id: lonprintout.pm,v 1.568.2.10 2010/11/13 01:57:14 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1672,8 +1672,9 @@
 # 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);
@@ -1706,10 +1707,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>'
@@ -1717,11 +1718,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>'
@@ -1729,9 +1729,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;
 }
 
 #
@@ -3975,10 +3975,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;