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

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 18 Jul 2002 17:34:29 -0000


sakharuk		Thu Jul 18 13:34:29 2002 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Can print single document from the construction space. Needs checking for
  problems with images.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.38 loncom/interface/lonprintout.pm:1.39
--- loncom/interface/lonprintout.pm:1.38	Tue Jul 16 16:30:53 2002
+++ loncom/interface/lonprintout.pm	Thu Jul 18 13:34:29 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.38 2002/07/16 20:30:53 www Exp $
+# $Id: lonprintout.pm,v 1.39 2002/07/18 17:34:29 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -71,19 +71,23 @@
 <input type="hidden" name="url" value="$ENV{'form.postdata'}">
 <input type="radio" name="choice" value="Standard LaTeX output for current document" checked>  Current document
 (you will print what you see on the screen)<br />
+ENDMENUOUT1
+    if (!$ENV{'request.role'}=~m/^au\./) {
+    $r->print(<<ENDMENUOUT2);
 <input type="radio" name="choice" value="Standard LaTeX output for the primary sequence">  All problems from the primary sequence<br />
 <input type="radio" name="choice" value="Standard LaTeX output for whole primary sequence">  The whole primary sequence (problems plus all html and xml files)<br />
 <input type="radio" name="choice" value="Standard LaTeX output for the top level sequence">  All problems from the top level sequence<br />
 <br />
-ENDMENUOUT1
-    my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
-    $subdirtoprint =~ s/\/[^\/]+$//;
-    if (&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') {
-	$r->print(<<ENDMENUOUT2);
-<input type="radio" name="choice" value="Subdirectory print">  All problems from current subdirectory (where this particular problem is)<br />
 ENDMENUOUT2
-}
-    $r->print(<<ENDMENUOUT3);
+      my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'});
+      $subdirtoprint =~ s/\/[^\/]+$//;
+      if (&Apache::lonnet::allowed('bre',$subdirtoprint) eq 'F') {
+	  $r->print(<<ENDMENUOUT4);
+  <input type="radio" name="choice" value="Subdirectory print">  All problems from current subdirectory (where this particular problem is)<br />
+ENDMENUOUT4
+      }
+    }
+    $r->print(<<ENDMENUOUT5);
 <br /><hr /><br />
 <h1>And what page format do you prefer?</h1>
 <table>
@@ -103,7 +107,7 @@
 </form>
 </body>
 </html>
-ENDMENUOUT3
+ENDMENUOUT5
 }
 
 
@@ -131,6 +135,7 @@
       #-- single document - problem, page, html, xml  
       my %moreenv;
       $moreenv{'form.grade_target'}='tex';
+      if ($ENV{'request.role'}=~m/^au\./) {$ENV{'form.url'}=~s/http:\/\/[^\/]+//;}
       $moreenv{'request.filename'}=$ENV{'form.url'};
       &Apache::lonnet::appenv(%moreenv);
       my $texversion=&Apache::lonnet::ssi($ENV{'form.url'});
@@ -312,9 +317,9 @@
     $result =~ s/&#032;/ /g;
     $result =~ s/&#033;/!/g;
     $result =~ s/&#034;/"/g;
-    $result =~ s/&quot;/"/g; #"
+    $result =~ s/&quot;/"/g; 
     $result =~ s/&#035;/\\#/g;
-    $result =~ s/&#036;/\\\$/g;
+#    $result =~ s/&#036;/\\\$/g;
     $result =~ s/&#037;/\\%/g; 
     $result =~ s/&#038;/\\&/g; 
     $result =~ s/&amp;/\\&/g;