--- loncom/interface/lonprintout.pm 2005/10/07 10:21:08 1.394 +++ loncom/interface/lonprintout.pm 2005/10/31 21:06:35 1.396 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.394 2005/10/07 10:21:08 foxr Exp $ +# $Id: lonprintout.pm,v 1.396 2005/10/31 21:06:35 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -903,6 +903,34 @@ sub unsupported { # +# List of recently generated print files +# + +sub recently_generated { + my $r=shift; + my $prtspool=$r->dir_config('lonPrtDir'); + my $result; + opendir(DIR,$prtspool); + while (my $filename=readdir(DIR)) { + if ($filename=~/^$env{'user.name'}\_$env{'user.domain'}\_printout\_(\d+)\_.*.pdf$/) { + my ($cdev,$cino,$cmode,$cnlink, + $cuid,$cgid,$crdev,$csize, + $catime,$cmtime,$cctime, + $cblksize,$cblocks)=stat($prtspool.'/'.$filename); + $result.="". + &mt('Generated [_1] ([_2] bytes)', + &Apache::lonlocal::locallocaltime($cctime),$csize). + '
'; + } + } + closedir(DIR); + if ($result) { + $r->print('

'.&mt('Recently generated printouts').'

'."\n". + $result); + } +} + +# # Retrieve the hash of page breaks. # # Inputs: @@ -2462,7 +2490,6 @@ RNDSEED $helper->{'VARS'}->{'style_file'}=$env{'form.style_file_value'}; } - } @@ -2489,7 +2516,9 @@ RNDSEED } $r->print($helper->display()); - + if ($helper->{STATE} eq 'START') { + &recently_generated($r); + } &Apache::lonhelper::unregisterHelperTags(); return OK;