--- loncom/interface/lonprintout.pm 2003/09/25 18:16:04 1.238 +++ loncom/interface/lonprintout.pm 2003/09/29 13:42:02 1.241 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.238 2003/09/25 18:16:04 bowersj2 Exp $ +# $Id: lonprintout.pm,v 1.241 2003/09/29 13:42:02 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -655,9 +655,7 @@ ENDPART $currentURL=$helper->{'VARS'}->{'postdata'}; } else { #prints resource from the construction space - $currentURL=$helper->{'VARS'}->{'filename'}; - $currentURL=~s/\/home\//\/~/; - $currentURL=~s/public_html\///; + $currentURL='/'.$helper->{'VARS'}->{'filename'}; if ($currentURL=~/([^?]+)/) {$currentURL=$1;} } $selectionmade = 1; @@ -1047,9 +1045,9 @@ sub printHelper { if ($r->header_only) { if ($ENV{'browser.mathml'}) { - $r->content_type('text/xml'); + &Apache::loncommon::content_type($r,'text/xml'); } else { - $r->content_type('text/html'); + &Apache::loncommon::content_type($r,'text/html'); } $r->send_http_header; return OK; @@ -1057,9 +1055,9 @@ sub printHelper { # Send header, nocache if ($ENV{'browser.mathml'}) { - $r->content_type('text/xml'); + &Apache::loncommon::content_type($r,'text/xml'); } else { - $r->content_type('text/html'); + &Apache::loncommon::content_type($r,'text/html'); } &Apache::loncommon::no_cache($r); $r->send_http_header; @@ -1148,9 +1146,6 @@ sub printHelper { # "Remove all duplicate slashes." $subdir =~ s|/+|/|g; - # If it's a ~ directory, convert back to /home/user/public_html - $subdir =~ s/^~(\w+)\//\/home\/$1\/public_html\//; - # What can be printed is a very dynamic decision based on # lots of factors. So we need to dynamically build this list. # To prevent security leaks, states are only added to the wizard @@ -1165,7 +1160,7 @@ sub printHelper { my $printChoices = []; my $paramHash; - if ($resourceTitle && $helper->{VARS}->{'postdata'}) { + if ($resourceTitle) { push @{$printChoices}, ["$resourceTitle (what you just saw on the screen)", 'current_document', 'PAGESIZE']; } @@ -1286,9 +1281,10 @@ CHOOSE_FROM_SUBDIR # Allow the user to select any sequence in the course, feed it to # another resource selector for that sequence - push @$printChoices, ["Resources from selected sequence in course", - 'map_problems_pages', 'CHOOSE_SEQUENCE']; - &Apache::lonxml::xmlparse($r, 'helper', <{VARS}->{'construction'}) { + push @$printChoices, ["Resources from selected sequence in course", + 'map_problems_pages', 'CHOOSE_SEQUENCE']; + &Apache::lonxml::xmlparse($r, 'helper', < Select the sequence to print resources from: @@ -1307,6 +1303,7 @@ CHOOSE_FROM_SUBDIR CHOOSE_FROM_ANY_SEQUENCE +} # Generate the first state, to select which resources get printed. Apache::lonhelper::state->new("START", "Select Printing Options:");