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

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 17 Jan 2006 18:34:58 -0000


albertel		Tue Jan 17 13:34:58 2006 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
  - couple of tweaks for BUG#4580 when printing for others
  - change the 'THIS IS EXTERNAL RESOURCE' text to be the title instead
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.413 loncom/interface/lonprintout.pm:1.414
--- loncom/interface/lonprintout.pm:1.413	Tue Jan 17 13:02:34 2006
+++ loncom/interface/lonprintout.pm	Tue Jan 17 13:34:58 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.413 2006/01/17 18:02:34 albertel Exp $
+# $Id: lonprintout.pm,v 1.414 2006/01/17 18:34:58 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -895,11 +895,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;
     }
@@ -1218,7 +1221,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
@@ -1335,7 +1339,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 {
@@ -1740,7 +1745,7 @@
 	       ($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!~m|^/adm/|
+		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'};
@@ -1789,7 +1794,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 {