--- loncom/interface/lonprintout.pm 2003/03/03 21:53:15 1.127 +++ loncom/interface/lonprintout.pm 2003/03/13 18:35:12 1.129 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.127 2003/03/03 21:53:15 albertel Exp $ +# $Id: lonprintout.pm,v 1.129 2003/03/13 18:35:12 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -605,7 +605,7 @@ ENDPART my %moreenv; $moreenv{'form.textwidth'}=$LaTeXwidth; &Apache::lonnet::appenv(%moreenv); - my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin2($r,'Print Status','Class Print Status',$#students+1); + my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Print Status','Class Print Status',$#students+1); foreach my $person (@students) { my $current_output = ''; my ($usersection,$username,$userdomain) = split /:/,$person; @@ -639,10 +639,10 @@ ENDPART $result .= $current_output; &Apache::lonnet::delenv('form.counter'); &Apache::lonxml::init_counter(); - &Apache::lonhtmlcommon::Increment_PrgWin2($r,\%prog_state, + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, 'last student '.$fullname); } - &Apache::lonhtmlcommon::Close_PrgWin2($r,\%prog_state); + &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); $result .= '\end{document}'; &Apache::lonnet::delenv('form.textwidth'); } elsif ($choice eq 'Subdirectory print') { @@ -1223,7 +1223,7 @@ sub handler { my $r = shift; # A hook for me to work without disturbing Alex. - if ($ENV{'form.jeremy'}) { + if (!$ENV{'form.jeremy'}) { printWizard($r); return OK; } @@ -1312,6 +1312,10 @@ sub printWizard { $r->rflush(); my ($resourceTitle,$sequenceTitle,$mapTitle) = &details_for_menu; + if (!$resourceTitle) { # if the resource doesn't have a title, use the filename + my $url = $ENV{'form.postdata'}; + $resourceTitle = substr($url, rindex($url, '/') + 1); + } my $wizard = Apache::lonwizard->new("Printing Wizard", $ENV{QUERY_STRING}); # PRINT_TYPE: What the user wants to print (current docs,