--- loncom/interface/lonprintout.pm 2009/10/26 09:55:32 1.560.2.7
+++ loncom/interface/lonprintout.pm 2009/11/16 11:13:24 1.564
@@ -2,7 +2,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.560.2.7 2009/10/26 09:55:32 foxr Exp $
+# $Id: lonprintout.pm,v 1.564 2009/11/16 11:13:24 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1263,9 +1263,9 @@ sub page_format_transformation {
if ($selectionmade eq '4') {
if ($choice eq 'all_problems') {
- $assignment='Problems from the Whole Course';
+ $assignment=&mt('Problems from the Whole Course');
} else {
- $assignment='Resources from the Whole Course';
+ $assignment=&mt('Resources from the Whole Course');
}
} else {
$assignment=&Apache::lonxml::latex_special_symbols($assignment,'header');
@@ -1539,9 +1539,9 @@ sub print_page_in_course {
# First is the overall 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);
+
foreach my $resource (@page_resources) {
my $resource_src = $resource->src(); # Essentially the URL of the resource.
$result .= $resource->title() . '\\\\';
@@ -2106,7 +2106,8 @@ ENDPART
$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'};
if ($currentURL=~/\/syllabus$/) {$currentURL=~s/\/res//;}
$resources_printed .= $currentURL.':';
- my $texversion=&ssi_with_retries($currentURL, $ssi_retry_count, %form);
+ my $texversion = &print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
+ $texversion .= &ssi_with_retries($currentURL, $ssi_retry_count, %form);
if ($helper->{'VARS'}->{'PRINT_ANNOTATIONS'} eq 'yes') {
my $annotation = &annotate($currentURL);
$texversion =~ s/(\\end{document})/$annotation$1/;
@@ -2199,7 +2200,7 @@ ENDPART
$result.="\\newpage\n";
}
}
- my ($sequence,$middle_thingy,$urlp)=&Apache::lonnet::decode_symb($master_seq[$i]);
+ my ($sequence,$middle_thingy,$urlp)=&Apache::lonnet::decode_symb($master_seq[$i]);
$urlp=&Apache::lonnet::clutter($urlp);
$form{'symb'}=$master_seq[$i];
@@ -2212,7 +2213,7 @@ ENDPART
&& $urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
$resources_printed .= $urlp.':';
&Apache::lonxml::remember_problem_counter();
-
+ $texversion.=&print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'}); # RF
$texversion.=&ssi_with_retries($urlp, $ssi_retry_count, %form);
if ($urlp=~/\.page$/) {
($texversion,my $number_of_columns_page) = &page_cleanup($texversion);
@@ -2286,7 +2287,8 @@ ENDPART
$form{'latex_type'}=$helper->{'VARS'}->{'LATEX_TYPE'};
if ($urlp=~/\/syllabus$/) {$urlp=~s/\/res//;}
$resources_printed .= $urlp.':';
- my $texversion=&ssi_with_retries($urlp, $ssi_retry_count, %form);
+ my $texversion = &print_latex_header($helper->{'VARS'}->{'LATEX_TYPE'});
+ $texversion .= &ssi_with_retries($urlp, $ssi_retry_count, %form);
if ($helper->{'VARS'}->{'PRINT_ANNOTATIONS'} eq 'yes') {
my $annotation = &annotate($urlp);
$texversion =~ s/(\\end{document)/$annotation$1/;
@@ -3193,22 +3195,23 @@ sub printHelper {
my $varspostdata = $helper->{VARS}->{'postdata'};
my $varsassignment = $helper->{VARS}->{'assignment'};
my $page_navmap = Apache::lonnavmaps::navmap->new();
- my @page_resources = $page_navmap->retrieveResources($url);
- if(defined($page_resources[0])) {
- $page_ispage = $page_resources[0]->is_page();
- $page_title = $page_resources[0]->title();
- my $resourcesymb = $page_resources[0]->symb();
- my ($pagemap, $pageid, $pageurl) = &Apache::lonnet::decode_symb($symb);
- if ($page_ispage) {
- push @{$printChoices},
- [&mt('Selected [_1]Problems[_2] from page [_3]', '', '', ''.$page_title.''),
- 'map_problems_in_page',
- 'CHOOSE_PROBLEMS_PAGE'];
- push @{$printChoices},
- [&mt('Selected [_1]Resources[_2] from page [_3]', '', '', ''.$page_title.''),
- 'map_resources_in_page',
- 'CHOOSE_RESOURCES_PAGE'];
- }
+ if (defined($page_navmap)) {
+ my @page_resources = $page_navmap->retrieveResources($url);
+ if(defined($page_resources[0])) {
+ $page_ispage = $page_resources[0]->is_page();
+ $page_title = $page_resources[0]->title();
+ my $resourcesymb = $page_resources[0]->symb();
+ my ($pagemap, $pageid, $pageurl) = &Apache::lonnet::decode_symb($symb);
+ if ($page_ispage) {
+ push @{$printChoices},
+ [&mt('Selected [_1]Problems[_2] from page [_3]', '', '', ''.$page_title.''),
+ 'map_problems_in_page',
+ 'CHOOSE_PROBLEMS_PAGE'];
+ push @{$printChoices},
+ [&mt('Selected [_1]Resources[_2] from page [_3]', '', '', ''.$page_title.''),
+ 'map_resources_in_page',
+ 'CHOOSE_RESOURCES_PAGE'];
+ }
my $helperFragment = &generate_resource_chooser('CHOOSE_PROBLEMS_PAGE',
'Select Problem(s) to print',
"multichoice='1' toponly='1' addstatus='1' closeallpages='1'",
@@ -3234,7 +3237,8 @@ sub printHelper {
&Apache::lonxml::xmlparse($r, 'helper', $helperFragment);
- }
+ }
+ }
}
if (($helper->{'VAR'}->{'construction'} ne '1' ) &&