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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 31 Oct 2005 21:06:35 -0000


albertel		Mon Oct 31 16:06:35 2005 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - don't put the header if there are no printouts
  - &mt() easier to translate
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.395 loncom/interface/lonprintout.pm:1.396
--- loncom/interface/lonprintout.pm:1.395	Sat Oct 29 22:24:34 2005
+++ loncom/interface/lonprintout.pm	Mon Oct 31 16:06:35 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.395 2005/10/30 02:24:34 www Exp $
+# $Id: lonprintout.pm,v 1.396 2005/10/31 21:06:35 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -909,7 +909,7 @@
 sub recently_generated {
     my $r=shift;
     my $prtspool=$r->dir_config('lonPrtDir');
-    $r->print('<h4>'.&mt('Recently generated printouts').'</h4>');
+    my $result;
     opendir(DIR,$prtspool);
     while (my $filename=readdir(DIR)) {
 	if ($filename=~/^$env{'user.name'}\_$env{'user.domain'}\_printout\_(\d+)\_.*.pdf$/) {
@@ -917,12 +917,17 @@
 		$cuid,$cgid,$crdev,$csize,
 		$catime,$cmtime,$cctime,
 		$cblksize,$cblocks)=stat($prtspool.'/'.$filename);
-            $r->print ("<a href='/prtspool/$filename'>".
-		&mt('Generated').' '.&Apache::lonlocal::locallocaltime($cctime).
-		       ' ('.$csize.' bytes)</a><br />');
+            $result.="<a href='/prtspool/$filename'>".
+		&mt('Generated [_1] ([_2] bytes)',
+		    &Apache::lonlocal::locallocaltime($cctime),$csize).
+		    '</a><br />';
 	}
     }
     closedir(DIR);
+    if ($result) {
+	$r->print('<h4>'.&mt('Recently generated printouts').'</h4>'."\n".
+		  $result);
+    }
 }
 
 #