--- loncom/interface/lonprintout.pm 2003/05/02 14:17:57 1.142 +++ loncom/interface/lonprintout.pm 2003/05/02 15:48:26 1.143 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.142 2003/05/02 14:17:57 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.143 2003/05/02 15:48:26 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1389,21 +1389,27 @@ ENDPART if ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'current_document') { - #-- single document - problem, page, html, xml, ... + #-- single document - problem, page, html, xml, ... + my $currentURL; + if (defined $helper->{'VARS'}->{'url'}) { + $currentURL=$helper->{'VARS'}->{'url'}; + } else { + $currentURL=$helper->{'VARS'}->{'postdata'}; + } $selectionmade = 1; - if ($helper->{'VARS'}->{'url'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { + if ($currentURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { my %moreenv; $moreenv{'form.grade_target'}='tex'; - if (&Apache::lonnet::allowed('bre',$helper->{'VARS'}->{'url'})) { - $helper->{'VARS'}->{'url'}=~s/http:\/\/[^\/]+//; - } - $moreenv{'request.filename'}=$helper->{'VARS'}->{'url'}; + if (&Apache::lonnet::allowed('bre',$currentURL)) { + $currentURL=~s/http:\/\/[^\/]+//; + } + $moreenv{'request.filename'}=$currentURL; $moreenv{'form.textwidth'}=$LaTeXwidth; &Apache::lonnet::appenv(%moreenv); - my $texversion=&Apache::lonnet::ssi($helper->{'VARS'}->{'url'}); + my $texversion=&Apache::lonnet::ssi($currentURL); &Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter'); $result .= $texversion; - if ($helper->{'VARS'}->{'url'}=~m/\.page\s*$/) { + if ($currentURL=~m/\.page\s*$/) { ($result,$number_of_columns) = &page_cleanup($result); } } else { @@ -1639,7 +1645,7 @@ ENDPART } print $temp_file $result; - +# $r->print(<