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

sakharuk lon-capa-cvs@mail.lon-capa.org
Tue, 19 Aug 2003 15:57:14 -0000


sakharuk		Tue Aug 19 11:57:14 2003 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  Bug 2055 (Ability to print the url on construction page.) is resolved. I added additional selection item to printing menu only for the printing from the construction space.
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.218 loncom/interface/lonprintout.pm:1.219
--- loncom/interface/lonprintout.pm:1.218	Mon Aug 18 15:57:36 2003
+++ loncom/interface/lonprintout.pm	Tue Aug 19 11:57:14 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.218 2003/08/18 19:57:36 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.219 2003/08/19 15:57:14 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -687,6 +687,10 @@
 	    if ($helper->{'VARS'}->{'TABLE_INDEX'} eq 'yes') {
 		$texversion=&IndexCreation($texversion,$currentURL);
 	    }
+	    if ($helper->{'VARS'}->{'CONSTR_RESOURSE_URL'} eq 'yes') {
+		$texversion=~s/(\\addcontentsline\{toc\}\{subsection\}\{[^\}]*\})/$1 URL: \\verb|$currentURL| \\strut\\\\\\strut /;
+
+	    }
 	    $result .= $texversion;
 	    if ($currentURL=~m/\.page\s*$/) {
 		($result,$number_of_columns) = &page_cleanup($result);
@@ -886,6 +890,10 @@
 		if ($helper->{'VARS'}->{'TABLE_INDEX'} eq 'yes') {
 		    $texversion=&IndexCreation($texversion,$urlp);
 		}
+		if ($helper->{'VARS'}->{'CONSTR_RESOURSE_URL'} eq 'yes') {
+		    $texversion=~s/(\\addcontentsline\{toc\}\{subsection\}\{[^\}]*\})/$1 URL: \\verb|$urlp| \\strut\\\\\\strut /;
+		    
+		}
 		$result .= $texversion;
 	    }
 	    $flag_latex_header_remove = 'YES';  
@@ -1253,6 +1261,19 @@
                                    ['Print without Index', 'no'],
                                    ['Print with Index', 'yes'] ];
         Apache::lonhelper::dropdown->new();
+
+	if ($helper->{VARS}->{'construction'}) {
+	    $paramHash = Apache::lonhelper::getParamHash();
+	    $paramHash->{MESSAGE_TEXT} = "</td></tr><tr><td>&nbsp;</td><td>";
+	    Apache::lonhelper::message->new();
+	    $paramHash = Apache::lonhelper::getParamHash();
+	    $paramHash->{'variable'} = 'CONSTR_RESOURSE_URL';   
+	    $helper->declareVar('CONSTR_RESOURSE_URL');         
+	    $paramHash->{CHOICES} = [
+				     ['Print without URL', 'no'],
+				     ['Print with UTL', 'yes'] ];
+	    Apache::lonhelper::dropdown->new();
+	}
 
         $paramHash = Apache::lonhelper::getParamHash();
         $paramHash->{MESSAGE_TEXT} = "</td></tr><table>";