[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm
foxr
lon-capa-cvs@mail.lon-capa.org
Fri, 07 Oct 2005 10:21:10 -0000
foxr Fri Oct 7 06:21:10 2005 EDT
Modified files:
/loncom/interface lonprintout.pm
Log:
Remove over-agressive restoration of pagebreak locations in the initialization
of the helper to resolve defect 4360
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.393 loncom/interface/lonprintout.pm:1.394
--- loncom/interface/lonprintout.pm:1.393 Mon Sep 19 06:58:33 2005
+++ loncom/interface/lonprintout.pm Fri Oct 7 06:21:08 2005
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.393 2005/09/19 10:58:33 foxr Exp $
+# $Id: lonprintout.pm,v 1.394 2005/10/07 10:21:08 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1852,21 +1852,27 @@
$helper->declareVar("showallfoils");
# The page breaks can get loaded initially from the course environment:
+ # But we only do this in the initial state so that they are allowed to change.
+ #
- if((!defined($env{"form.CURRENT_STATE"})) ||
- ($env{'form.CURRENT_STATE'} == "START")) {
- $helper->{VARS}->{FINISHPAGE} = ""; # In case they did a back e.g.
- }
-
-
+ $helper->{VARS}->{FINISHPAGE} = '';
&Apache::loncommon::restore_course_settings('print',
{'pagebreaks' => 'scalar',
'lastprinttype' => 'scalar'});
-
- if("$helper->{VARS}->{PRINT_TYPE}" eq "$env{'form.lastprinttype'}") {
- $helper->{VARS}->{FINISHPAGE} = $env{'form.pagebreaks'};
+
+ if($helper->{VARS}->{PRINT_TYPE} eq $env{'form.lastprinttype'}) {
+ if (!defined ($env{"form.CURRENT_STATE"})) {
+
+ $helper->{VARS}->{FINISHPAGE} = $env{'form.pagebreaks'};
+ } else {
+ my $state = $env{"form.CURRENT_STATE"};
+ if ($state eq "START") {
+ $helper->{VARS}->{FINISHPAGE} = $env{'form.pagebreaks'};
+ }
+ }
+
}
@@ -1976,7 +1982,7 @@
$helper->declareVar('SEQUENCE');
# Useful for debugging: Dump the help vars
-# $r->print(Dumper($helper->{VARS}));
+# $r->print(Dumper($helper->{VARS}));
# $r->print($map);
# If we're in a sequence...