[LON-CAPA-cvs] cvs: loncom /homework outputtags.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 12 Nov 2004 21:15:06 -0000


albertel		Fri Nov 12 16:15:06 2004 EDT

  Modified files:              
    /loncom/homework	outputtags.pm 
  Log:
  - stick in the username if we cant get the photo in TeX mode
  - obey the align attribute
  
  
Index: loncom/homework/outputtags.pm
diff -u loncom/homework/outputtags.pm:1.35 loncom/homework/outputtags.pm:1.36
--- loncom/homework/outputtags.pm:1.35	Tue Oct 26 11:03:08 2004
+++ loncom/homework/outputtags.pm	Fri Nov 12 16:15:05 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # tags that create controlled output
 #
-# $Id: outputtags.pm,v 1.35 2004/10/26 15:03:08 albertel Exp $
+# $Id: outputtags.pm,v 1.36 2004/11/12 21:15:05 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -194,6 +194,8 @@
 	if ($width) { $args.=" width=\"$width\" "; }
 	my $height=&Apache::lonxml::get_param('heigth',$parstack,$safeeval);
 	if ($height) { $args.=" height=\"$height\" "; }
+	my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval);
+	if ($align) { $args.=" align=\"$align\" "; }
 	$result.=" <img $args src=\"$tokenurl\" alt=\"$user\@$domain\" />";
     }
     if ($target eq 'tex' && $ENV{'request.role'} =~ /^cc/) {
@@ -211,6 +213,8 @@
 	    my $width_param=&Apache::londefdef::image_size($Apache::lonnet::perlvar{'lonPrtDir'}."/$file",'0.3',$parstack,$safeeval);
 	    $result.=' \graphicspath{{'.$Apache::lonnet::perlvar{'lonPrtDir'}.
 		'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} ';
+	} else {
+	    $result="$user\@$domain";
 	}
     }
     return $result;