--- loncom/interface/lonprintout.pm 2009/07/14 09:30:20 1.557.2.1 +++ loncom/interface/lonprintout.pm 2009/07/03 16:13:13 1.558 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.557.2.1 2009/07/14 09:30:20 foxr Exp $ +# $Id: lonprintout.pm,v 1.558 2009/07/03 16:13:13 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -943,8 +943,6 @@ sub old_character_chart { $result =~ s/&(ldquo|#8220);/\`\`/g; $result =~ s/&(rdquo|#8221);/\'\'/g; -&Apache::lonnet::logthis("After pass through old character chart: '$result'"); - return $result; } @@ -1308,46 +1306,6 @@ sub unsupported { } -sub print_page_in_course { - my ($helper, $currentURL, $resources) = @_; - my @page_resources = @$resources; - my $mode = $helper->{'VARS'}->{'LATEX_TYPE'}; - my $symb = $helper->{'VARS'}->{'symb'}; - - if ($mode ne '') {$mode='\\'.$mode} - my $result.= &print_latex_header($mode); - if ($currentURL=~m|^(/adm/wrapper/)?ext/|) { - $currentURL=~s|^(/adm/wrapper/)?ext/|http://|; - my $title=&Apache::lonnet::gettitle($symb); - $title = &Apache::lonxml::latex_special_symbols($title); - $result.=' \strut \\\\ '.$title.' \strut \\\\ '.$currentURL.' '; - } else { - $result.=$currentURL; - } - - # First is theo verall page description. This is then followed by the - # components of the page. Each of which must be printed independently. - - my $the_page = shift(@page_resources); - $result .= "URL: $currentURL " .'\\\\'; - - foreach my $resource (@page_resources) { - my $resource_src = $resource->src(); - my $resource_symb = $resource->symb(); - $resource_symb = &Apache::lonnet::clutter($resource_symb); - my $resource_kind = $resource->kind(); - my $resource_title = $resource->title(); - - $result .= &Apache::lonxml::latex_special_symbols("Src: $resource_src symb: $resource_symb "); - $result .= &Apache::lonxml::latex_special_symbols("Kind: $resource_kind Title: $resource_title"); - $result .= '\\\\'; - } - - $result.= '\vskip 0.5mm\noindent\makebox[\textwidth/$number_of_columns][b]{\hrulefill} \end{document}'; - return $result; -} - - # # List of recently generated print files # @@ -1591,8 +1549,16 @@ sub output_data { ENDPART - - my $start_page = &Apache::loncommon::start_page('Preparing Printout',$js); + # Breadcrumbs + #FIXME: Choose better/different breadcrumbs?!? Links? + my $brcrum = [{'href' => '', + 'text' => 'Helper'}, #FIXME: Different origin possible than print out helper? + {'href' => '', + 'text' => 'Preparing Printout'}]; + + my $start_page = &Apache::loncommon::start_page('Preparing Printout', + $js, + {'bread_crumbs' => $brcrum,}); my $msg = &mt('Please stand by while processing your print request, this may take some time ...'); $r->print($start_page."\n

\n$msg\n

\n"); @@ -1767,9 +1733,6 @@ ENDPART } elsif ($cleanURL!~m|^/adm/| && $currentURL=~/\.(sequence|page)$/ && $helper->{'VARS'}->{'construction'} eq '1') { #printing content of sequence from the construction space - - &Apache::lonnet::logthis("Printing sequence/page but construction space??"); - $currentURL=~s|\/~([^\/]+)\/|\/home\/$1\/public_html\/|; # $result .= &print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'}); $result .= &print_construction_sequence($currentURL, $helper, %form, @@ -1805,18 +1768,7 @@ ENDPART } elsif ($cleanURL =~ /\.pdf$/i) { $result .= &include_pdf($cleanURL); $result .= '\end{document}'; - } elsif ($cleanURL =~ /\.page$/i) { # Print page in non construction space contexts. - &Apache::lonnet::logthis("Printing .page $cleanURL at " . __LINE__); - - # Determine the set of resources in the map of the page: - - my $navmap = Apache::lonnavmaps::navmap->new(); - my @page_resources = $navmap->retrieveResources($cleanURL); - $result .= &print_page_in_course($helper, $cleanURL, \@page_resources); - - } else { - &Apache::lonnet::logthis("Unsupported type handler"); $result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'}, $helper->{'VARS'}->{'symb'}); } @@ -1883,13 +1835,10 @@ ENDPART my $texversion=''; if ($urlp!~m|^/adm/| && $urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { - &Apache::lonnet::logthis("At line 1834 printing $urlp"); $resources_printed .= $urlp.':'; &Apache::lonxml::remember_problem_counter(); $texversion.=&ssi_with_retries($urlp, $ssi_retry_count, %form); if ($urlp=~/\.page$/) { - &Apache::lonnet::logthis("Handling a .page at ". __LINE__); - ($texversion,my $number_of_columns_page) = &page_cleanup($texversion); if ($number_of_columns_page > $number_of_columns) {$number_of_columns=$number_of_columns_page;} $texversion =~ s/\\end{document}\d*/\\end{document}/; @@ -2478,7 +2427,7 @@ sub print_resources { if ($res_url!~m|^ext/| && $res_url=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) { $printed .= $curresline.':'; - &Apache::lonnet::logthis("At line 2427 printing $curresline"); + &Apache::lonxml::remember_problem_counter(); my $rendered = &get_student_view_with_retries($curresline,$ssi_retry_count,$username,$userdomain,$env{'request.course.id'},'tex',$moreenv); @@ -3245,6 +3194,7 @@ CHOOSE_ANON2 )) && $helper->{VARS}->{'assignment'} eq "" ) { + my $pretty_dir = &Apache::lonnet::hreflocation($subdir); push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from current subdirectory [_3]','','',''.$pretty_dir.'','',''), 'problems_from_directory', 'CHOOSE_FROM_SUBDIR']; my $xmlfrag = <