[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 11 Nov 2003 19:32:23 -0000


sakharuk		Tue Nov 11 14:32:23 2003 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Bug 2314 is fixed. Style file does not need the redefinition after every login.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.264 loncom/interface/lonprintout.pm:1.265
--- loncom/interface/lonprintout.pm:1.264	Tue Nov 11 11:53:48 2003
+++ loncom/interface/lonprintout.pm	Tue Nov 11 14:32:22 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.264 2003/11/11 16:53:48 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.265 2003/11/11 19:32:22 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -725,7 +725,12 @@
 	    if ($helper->{'VARS'}->{'ANSWER_TYPE'} ne 'only') {
 		my %moreenv;
 		$moreenv{'request.filename'}=$currentURL;
-		if ($helper->{'VARS'}->{'style_file'}=~/\w/) {$moreenv{'construct.style'}=$helper->{'VARS'}->{'style_file'};}
+		if ($helper->{'VARS'}->{'style_file'}=~/\w/) {
+		    $moreenv{'construct.style'}=$helper->{'VARS'}->{'style_file'};
+		    my $dom = $ENV{'user.domain'};
+		    my $user = $ENV{'user.name'};
+		    my $put_result = &Apache::lonnet::put('environment',{'construct.style'=>$helper->{'VARS'}->{'style_file'}},$dom,$user);
+		}
 		my %form;
 		$form{'grade_target'}='tex';
 		$form{'textwidth'}=$LaTeXwidth;	
@@ -1554,7 +1559,8 @@
 	}
 
 	if ($helper->{'VARS'}->{'construction'}) { 
-	    my $xmlfrag .= <<'RNDSEED';
+	    my $stylevalue=$ENV{'construct.style'};
+	    my $xmlfrag .= <<"RNDSEED";
 	    <message><tr><td align='right'>Use random seed: </td><td></message>
 	    <string variable="curseed" size="15" maxlength="15">
 		<defaultvalue>
@@ -1562,7 +1568,7 @@
 	        </defaultvalue>
 	    </string>
 	     <message></td></tr><tr><td align="right">Use style file:</td><td></message>
-             <message><input type="text" size="40" name="style_file_value" value=""  /><a href="javascript:openbrowser('helpform','style_file','sty')">&nbsp; Select style file</a> </td><td></message>
+             <message><input type="text" size="40" name="style_file_value" value="$stylevalue"  />&nbsp; <a href="javascript:openbrowser('helpform','style_file','sty')">Select style file</a> </td><td></message>
              <message></td></tr></message>
 RNDSEED
             &Apache::lonxml::xmlparse($r, 'helper', $xmlfrag);