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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 26 Jan 2006 19:54:19 -0000


albertel		Thu Jan 26 14:54:19 2006 EDT

  Modified files:              (Branch: version_2_1_X)
    /loncom/interface	lonprintout.pm 
  Log:
  - backport 1.413, 1.414, 1.415
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.408.2.1 loncom/interface/lonprintout.pm:1.408.2.2
--- loncom/interface/lonprintout.pm:1.408.2.1	Fri Dec 23 03:34:43 2005
+++ loncom/interface/lonprintout.pm	Thu Jan 26 14:54:15 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.408.2.1 2005/12/23 08:34:43 albertel Exp $
+# $Id: lonprintout.pm,v 1.408.2.2 2006/01/26 19:54:15 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -894,11 +894,14 @@
 
 
 sub unsupported {
-    my ($currentURL,$mode)=@_;
+    my ($currentURL,$mode,$symb)=@_;
     if ($mode ne '') {$mode='\\'.$mode}
     my $result.= &print_latex_header($mode);
-    if ($currentURL=~/\/ext\//) {
-	$result.=' \strut \\\\ THIS IS EXTERNAL RESOURCE WITH URL \strut \\\\ '.$currentURL.' ';
+    if ($currentURL=~m|^(/adm/wrapper/)?ext/|) {
+	$currentURL=~s|^(/adm/wrapper/)?ext/|http://|;
+	my $title=&Apache::lonnet::gettitle($symb);
+	$title = &Apache::lonxml::latex_special_symbols($title);
+	$result.=' \strut \\\\ '.$title.' \strut \\\\ '.$currentURL.' ';
     } else {
 	$result.=$currentURL;
     }
@@ -1077,7 +1080,8 @@
 	    $cleanURL=$currentURL;
 	}
 	$selectionmade = 1;
-	if ($cleanURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
+	if ($cleanURL!~m|^/adm/|
+	    && $cleanURL=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
 	    my $rndseed=time;
 	    my $texversion='';
 	    if ($helper->{'VARS'}->{'ANSWER_TYPE'} ne 'only') {
@@ -1146,7 +1150,8 @@
 	    if ($currentURL=~m/\.page\s*$/) {
 		($result,$number_of_columns) = &page_cleanup($result);
 	    }
-        } elsif ($currentURL=~/\.sequence$/ && $helper->{'VARS'}->{'construction'} eq '1') {
+        } elsif ($cleanURL!~m|^/adm/|
+		 && $currentURL=~/\.sequence$/ && $helper->{'VARS'}->{'construction'} eq '1') {
             #printing content of sequence from the construction space	
 	    my $flag_latex_header_remove = 'NO'; 
 	    my $rndseed=time;
@@ -1215,7 +1220,8 @@
 		my $texversion=&Apache::lonnet::ssi($currentURL,%form);
 		$result .= $texversion;
 	} else {
-	    $result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'});
+	    $result.=&unsupported($currentURL,$helper->{'VARS'}->{'LATEX_TYPE'},
+				  $helper->{'VARS'}->{'symb'});
 	}
     } elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems')       or
              ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'map_problems_pages') or
@@ -1264,7 +1270,8 @@
 	    if ($selectionmade==7) {$helper->{VARS}->{'assignment'}=$assignment;}
 	    if ($i==0) {$prevassignment=$assignment;}
 	    my $texversion='';
-	    if ($urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
+	    if ($urlp!~m|^/adm/|
+		&& $urlp=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
 		$resources_printed .= $urlp.':';
 		my $pre_counter=$env{'form.counter'};
 		$texversion.=&Apache::lonnet::ssi($urlp,%form);
@@ -1331,7 +1338,8 @@
 		$result .= $texversion;
 		$flag_latex_header_remove = 'YES'; 
 	    } else {
-		$texversion=&unsupported($urlp,$helper->{'VARS'}->{'LATEX_TYPE'});
+		$texversion=&unsupported($urlp,$helper->{'VARS'}->{'LATEX_TYPE'},
+					 $master_seq[$i]);
 		if ($flag_latex_header_remove ne 'NO') {
 		    $texversion = &latex_header_footer_remove($texversion);
 		} else {
@@ -1736,7 +1744,8 @@
 	       ($curresline!~ m/\.(problem|exam|quiz|assess|survey|form|library)$/)) ) {
 	    my ($map,$id,$res_url) = &Apache::lonnet::decode_symb($curresline);
 	    if (&Apache::lonnet::allowed('bre',$res_url)) {
-		if ($res_url=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
+		if ($res_url!~m|^ext/|
+		    && $res_url=~/\.(problem|exam|quiz|assess|survey|form|library|page|xml|html|htm|xhtml|xhtm)$/) {
 		    $printed .= $curresline.':';
 		    my $pre_counter=$env{'form.counter'};
 		    my $rendered = &Apache::loncommon::get_student_view($curresline,$username,$userdomain,$env{'request.course.id'},'tex',$moreenv);
@@ -1784,7 +1793,7 @@
 		    }
 		    $current_output .= $rendered.'\vskip 0.5mm\noindent\makebox[\textwidth/'.$number_of_columns.'][b]{\hrulefill}\strut \vskip 0 mm \strut ';
 		} else {
-		    my $rendered = &unsupported($res_url,$helper->{'VARS'}->{'LATEX_TYPE'});
+		    my $rendered = &unsupported($res_url,$helper->{'VARS'}->{'LATEX_TYPE'},$curresline);
 		    if ($remove_latex_header ne 'NO') {
 			$rendered = &latex_header_footer_remove($rendered);
 		    } else {
@@ -2508,7 +2517,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="$stylevalue"  />&nbsp; <a href="javascript:openbrowser('helpform','style_file','sty')">Select style file</a> </td><tr><td></message>
+             <message><input type="text" size="40" name="style_file_value" value="$stylevalue"  />&nbsp; <a href="javascript:openbrowser('helpform','style_file_value','sty')">Select style file</a> </td><tr><td></message>
 	     <choices allowempty="1" multichoice="true" variable="showallfoils">
                 <choice computer="1">Show all foils?</choice>
              </choices>