--- loncom/interface/lonprintout.pm 2005/10/07 10:21:08 1.394 +++ loncom/interface/lonprintout.pm 2005/10/30 02:24:34 1.395 @@ -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.395 2005/10/30 02:24:34 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -903,6 +903,29 @@ sub unsupported { # +# List of recently generated print files +# + +sub recently_generated { + my $r=shift; + my $prtspool=$r->dir_config('lonPrtDir'); + $r->print('

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

'); + 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); + $r->print ("". + &mt('Generated').' '.&Apache::lonlocal::locallocaltime($cctime). + ' ('.$csize.' bytes)
'); + } + } + closedir(DIR); +} + +# # Retrieve the hash of page breaks. # # Inputs: @@ -2462,7 +2485,6 @@ RNDSEED $helper->{'VARS'}->{'style_file'}=$env{'form.style_file_value'}; } - } @@ -2489,7 +2511,9 @@ RNDSEED } $r->print($helper->display()); - + if ($helper->{STATE} eq 'START') { + &recently_generated($r); + } &Apache::lonhelper::unregisterHelperTags(); return OK;