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

sakharuk lon-capa-cvs@mail.lon-capa.org
Fri, 13 Feb 2004 21:13:21 -0000


sakharuk		Fri Feb 13 16:13:21 2004 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Changes to use Status Window from lonhtmlcommon.pm in printout.pl. 
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.275 loncom/interface/lonprintout.pm:1.276
--- loncom/interface/lonprintout.pm:1.275	Mon Feb  9 15:41:36 2004
+++ loncom/interface/lonprintout.pm	Fri Feb 13 16:13:21 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.275 2004/02/09 20:41:36 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.276 2004/02/13 21:13:21 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1186,6 +1186,15 @@
 	}
     }
 
+    my $URLback=''; #link to original document
+    if ($helper->{'VARS'}->{'construction'} ne '1') {
+	#prints published resource
+	$URLback=$helper->{'VARS'}->{'postdata'};
+    } else {
+	#prints resource from the construction space
+	$URLback='/'.$helper->{'VARS'}->{'filename'};
+	if ($URLback=~/([^?]+)/) {$URLback=$1;}
+    }
 
     my $identifier = time.'_'.int(rand(1000));
     &Apache::lonnet::appenv('cgi.'.$identifier.'.file'   => $filename,
@@ -1196,9 +1205,9 @@
 			    'cgi.'.$identifier.'tableofindex' => $helper->{'VARS'}->{'TABLE_INDEX'},
 			    'cgi.'.$identifier.'role' => $ENV{'request.role.adv'},
                             'cgi.'.$identifier.'numberoffiles' => $#print_array,
-                            'cgi.'.$identifier.'studentnames' => $student_names,);
+                            'cgi.'.$identifier.'studentnames' => $student_names,
+                            'cgi.'.$identifier.'backref' => $URLback,);
  
-
 $r->print(<<FINALEND);
 <meta http-equiv="Refresh" content="0; url=/cgi-bin/printout.pl?$identifier">
 </body>