--- loncom/interface/lonprintout.pm 2002/11/18 20:30:49 1.91 +++ loncom/interface/lonprintout.pm 2002/11/19 15:45:25 1.92 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.91 2002/11/18 20:30:49 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.92 2002/11/19 15:45:25 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -107,7 +107,7 @@ ENDMENUOUT6 } my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'}); $subdirtoprint =~ s/\/[^\/]+$//; - if (&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') { + if ((&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') and ($ENV{'form.postdata'}=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/)) { $r->print(< Problems from current subdirectory $subdir_to_print
ENDMENUOUT4 @@ -449,19 +449,23 @@ ENDPART if ($choice eq 'Standard LaTeX output for current document') { #-- single document - problem, page, html, xml $selectionmade = 1; - my %moreenv; - $moreenv{'form.grade_target'}='tex'; - if (&Apache::lonnet::allowed('bre',$ENV{'form.url'})) { + if ($ENV{'form.url'}=~/\.(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',$ENV{'form.url'})) { $ENV{'form.url'}=~s/http:\/\/[^\/]+//; - } - $moreenv{'request.filename'}=$ENV{'form.url'}; - $moreenv{'form.textwidth'}=$LaTeXwidth; - &Apache::lonnet::appenv(%moreenv); - my $texversion=&Apache::lonnet::ssi($ENV{'form.url'}); - &Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter'); - $result .= $texversion; - if ($ENV{'form.url'}=~m/\.page\s*$/) { + } + $moreenv{'request.filename'}=$ENV{'form.url'}; + $moreenv{'form.textwidth'}=$LaTeXwidth; + &Apache::lonnet::appenv(%moreenv); + my $texversion=&Apache::lonnet::ssi($ENV{'form.url'}); + &Apache::lonnet::delenv('form.grade_target','form.textwidth','form.counter'); + $result .= $texversion; + if ($ENV{'form.url'}=~m/\.page\s*$/) { ($result,$number_of_columns) = &page_cleanup($result); + } + } else{ + $result='\documentclass[letterpaper]{article}\usepackage{calc}\begin{document}You are trying to print eather sequence or something simular. Currently this option is not supported. Sorry for the inconvenience. Bye.\end{document}' } } elsif ($choice eq 'Standard LaTeX output for the primary sequence' or $choice eq 'Standard LaTeX output for whole primary sequence') {