[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm
sakharuk
lon-capa-cvs@mail.lon-capa.org
Fri, 02 May 2003 15:48:26 -0000
sakharuk Fri May 2 11:48:26 2003 EDT
Modified files:
/loncom/interface lonprintout.pm
Log:
Single resource from the construction space can be printed. Currently all printing is coming for 2 colomns portrait output (I need to adjust all other parameters to print in different way - Jeremy had not give me the additional interface for redifinition of one-column text parameters).
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.142 loncom/interface/lonprintout.pm:1.143
--- loncom/interface/lonprintout.pm:1.142 Fri May 2 10:17:57 2003
+++ loncom/interface/lonprintout.pm Fri May 2 11:48:26 2003
@@ -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 @@
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 @@
}
print $temp_file $result;
-
+#<meta http-equiv="Refresh" content="0; url=/cgi-bin/printout.pl?$filename&$laystyle&$numberofcolumns&$selectionmade">
$r->print(<<FINALEND);
<meta http-equiv="Refresh" content="0; url=/cgi-bin/printout.pl?$filename&$laystyle&$numberofcolumns&$selectionmade">
</body>