--- loncom/interface/lonprintout.pm 2008/12/15 23:12:26 1.545.2.1
+++ loncom/interface/lonprintout.pm 2009/01/23 16:00:46 1.548
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.545.2.1 2008/12/15 23:12:26 raeburn Exp $
+# $Id: lonprintout.pm,v 1.548 2009/01/23 16:00:46 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1505,7 +1505,7 @@ ENDPART
my ($result,$selectionmade) = ('','');
my $number_of_columns = 1; #used only for pages to determine the width of the cell
my @temporary_array=split /\|/,$format_from_helper;
- my ($laystyle,$numberofcolumns,$papersize)=@temporary_array;
+ my ($laystyle,$numberofcolumns,$papersize,$pdfFormFields)=@temporary_array;
if ($laystyle eq 'L') {
$laystyle='album';
} else {
@@ -1526,6 +1526,7 @@ ENDPART
my %form;
$form{'grade_target'} = 'tex';
$form{'textwidth'} = &get_textwidth($helper, $LaTeXwidth);
+ $form{'pdfFormFields'} = $pdfFormFields;
# If form.showallfoils is set, then request all foils be shown:
# privilege will be enforced both by not allowing the
@@ -2486,17 +2487,23 @@ sub get_randomly_ordered_warning {
my $postdata = $env{'form.postdata'} || $helper->{VARS}{'postdata'};
my $navmap = Apache::lonnavmaps::navmap->new();
- my $res = $navmap->getResourceByUrl($map);
- if ($res) {
- my $func =
- sub { return ($_[0]->is_map() && $_[0]->randomorder); };
- my @matches = $navmap->retrieveResources($res, $func,1,1,1);
- if (@matches) {
- $message = "Some of the items below are in folders set to be randomly ordered. However, when printing the contents of these folders, they will be printed in the original order for all students, not the randomized order.";
- }
- }
- if ($message) {
- return ''.$message.'';
+ if (defined($navmap)) {
+ my $res = $navmap->getResourceByUrl($map);
+ if ($res) {
+ my $func =
+ sub { return ($_[0]->is_map() && $_[0]->randomorder); };
+ my @matches = $navmap->retrieveResources($res, $func,1,1,1);
+ if (@matches) {
+ $message = "Some of the items below are in folders set to be randomly ordered. However, when printing the contents of these folders, they will be printed in the original order for all students, not the randomized order.";
+ }
+ }
+ if ($message) {
+ return ''.$message.'';
+ }
+ } else {
+ &Apache::lonnet::logthis('Retrieval of resources to check for folders set to be randomly ordered failed - could not create navmap object');
+ $message = "Retrieval of information about ordering of resources failed.";
+ return ''.$message.'';
}
return;
}
@@ -2695,9 +2702,9 @@ sub printHelper {
$helper->{VARS}->{'postdata'} &&
$helper->{VARS}->{'assignment'}) {
# Allow problems from sequence
- push @{$printChoices}, [&mt('Selected Problems in folder [_1]',$sequenceTitle), 'map_problems', 'CHOOSE_PROBLEMS'];
+ push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3]','','',''.$sequenceTitle.''), 'map_problems', 'CHOOSE_PROBLEMS'];
# Allow all resources from sequence
- push @{$printChoices}, [&mt('Selected Resources in folder [_1]',$sequenceTitle), 'map_problems_pages', 'CHOOSE_PROBLEMS_HTML'];
+ push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3]','','',''.$sequenceTitle.''), 'map_problems_pages', 'CHOOSE_PROBLEMS_HTML'];
my $helperFragment = <
@@ -2726,8 +2733,8 @@ HELPERFRAGMENT
&Apache::lonxml::xmlparse($r, 'helper', $helperFragment);
}
- # If the user has pfo (print for otheres) allow them to print all
- # problems and resources in the entier course, optionally for selected students
+ # If the user has pfo (print for others) allow them to print all
+ # problems and resources in the entire course, optionally for selected students
if ($perm{'pfo'} && !$is_published &&
($helper->{VARS}->{'postdata'}=~/\/res\// || $helper->{VARS}->{'postdata'}=~/\/(syllabus|smppg|aboutme|bulletinboard)$/)) {
@@ -2777,8 +2784,8 @@ HELPERFRAGMENT
ALL_PROBLEMS
if ($helper->{VARS}->{'assignment'}) {
- push @{$printChoices}, [&mt("Selected Problems from folder [_1] for selected people",$sequenceTitle), 'problems_for_students', 'CHOOSE_STUDENTS'];
- push @{$printChoices}, [&mt("Selected Problems from folder [_1] for CODEd assignments",$sequenceTitle), 'problems_for_anon', 'CHOOSE_ANON1'];
+ push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]selected people[_5]','','',''.$sequenceTitle.'','',''), 'problems_for_students', 'CHOOSE_STUDENTS'];
+ push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]CODEd assignments[_5]','','',''.$sequenceTitle.'','',''), 'problems_for_anon', 'CHOOSE_ANON1'];
}
my $randomly_ordered_warning =
@@ -2956,8 +2963,8 @@ CHOOSE_ANON1
if ($helper->{VARS}->{'assignment'}) {
- push @{$printChoices}, [&mt("Selected Resources from folder [_1] for selected people",$sequenceTitle), 'resources_for_students', 'CHOOSE_STUDENTS1'];
- push @{$printChoices}, [&mt("Selected Resources from folder [_1] for CODEd assignments",$sequenceTitle), 'resources_for_anon', 'CHOOSE_ANON2'];
+ push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]selected people[_5]','','',''.$sequenceTitle.'','',''), 'resources_for_students', 'CHOOSE_STUDENTS1'];
+ push @{$printChoices}, [&mt('Selected [_1]Resources[_2] from folder [_3] for [_4]CODEd assignments[_5]','','',''.$sequenceTitle.'','',''), 'resources_for_anon', 'CHOOSE_ANON2'];
}
@@ -3080,7 +3087,7 @@ CHOOSE_ANON2
) {
my $pretty_dir = &Apache::lonnet::hreflocation($subdir);
- push @{$printChoices}, [&mt("Selected Problems from current subdirectory [_1]",$pretty_dir), 'problems_from_directory', 'CHOOSE_FROM_SUBDIR'];
+ push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from current subdirectory [_3]','','',''.$pretty_dir.'','',''), 'problems_from_directory', 'CHOOSE_FROM_SUBDIR'];
my $xmlfrag = <
@@ -3447,12 +3454,16 @@ sub render {
my $PaperType=&mt('Paper type');
my $landscape=&mt('Landscape');
my $portrait=&mt('Portrait');
+ my $pdfFormLabel=&mt('PDF-Formfields');
+ my $with=&mt('with Formfields');
+ my $without=&mt('without Formfields');
$result.='