--- loncom/interface/lonprintout.pm 2003/05/02 19:22:20 1.145 +++ loncom/interface/lonprintout.pm 2003/05/05 14:30:23 1.146 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.145 2003/05/02 19:22:20 bowersj2 Exp $ +# $Id: lonprintout.pm,v 1.146 2003/05/05 14:30:23 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1774,22 +1774,30 @@ sub printHelper { Apache::loncommon::get_unprocessed_cgi($ENV{QUERY_STRING}); my $helper = Apache::lonhelper::helper->new("Printing Wizard"); + $helper->declareVar('symb'); + $helper->declareVar('postdata'); # This will persistently load in the data we want from the # very first screen. - if (defined($ENV{'form.postdata'})) { - $helper->{VARS}->{'postdata'} = $ENV{'form.postdata'}; + if ($ENV{'form.postdata'}) { + $helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($ENV{'form.postdata'}); } - if (defined($ENV{'form.symb'})) { - $helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($helper->{VARS}->{'postdata'}); + if ($ENV{'form.symb'}) { + $helper->{VARS}->{'symb'} = $ENV{'form.symb'}; } - if (defined($ENV{'form.url'})) { - $helper->{VARS}->{'url'} = $helper->{VARS}->{'postdata'}; + if ($ENV{'form.url'}) { + $helper->{VARS}->{'symb'} = &Apache::lonnet::symbread($helper->{VARS}->{'postdata'}); } + my ($resourceTitle,$sequenceTitle,$mapTitle) = &details_for_menu; $helper->{VARS}->{'assignment'} = $sequenceTitle; + # Extract map + my $symb = $helper->{VARS}->{'symb'}; + my ($map, $id, $url) = split(/___/, $symb); + $helper->{VARS}->{'postdata'} = Apache::lonnet::clutter($url); + if (!$resourceTitle) { # if the resource doesn't have a title, use the filename my $url = $helper->{VARS}->{'postdata'}; $resourceTitle = substr($url, rindex($url, '/') + 1); @@ -1797,11 +1805,7 @@ sub printHelper { Apache::lonhelper::registerHelperTags(); - # Extract map - my $symb = $helper->{VARS}->{'symb'}; - my ($map, $id, $url) = split(/__/, $symb); - - my $subdir = &Apache::lonnet::filelocation("", $helper->{VARS}->{'postdata'}); + my $subdir = &Apache::lonnet::filelocation("", $url); # "Delete everything after the last slash." $subdir =~ s|/[^/]+$||;