[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonfeedback.pm lonmsgdisplay.pm

www lon-capa-cvs@mail.lon-capa.org
Wed, 28 Feb 2007 16:30:40 -0000


www		Wed Feb 28 11:30:40 2007 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonfeedback.pm lonmsgdisplay.pm 
  Log:
  Bug #4996: student photos in feedback and discussions
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.507 loncom/interface/loncommon.pm:1.508
--- loncom/interface/loncommon.pm:1.507	Tue Feb 27 17:16:02 2007
+++ loncom/interface/loncommon.pm	Wed Feb 28 11:30:40 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.507 2007/02/27 22:16:02 raeburn Exp $
+# $Id: loncommon.pm,v 1.508 2007/02/28 16:30:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2267,6 +2267,19 @@
 	&help_open_topic('View_recent_activity');
 }
 
+# ===================================================== Display a student photo
+
+
+sub studentimagetag {
+    my ($domain,$user)=@_;
+    my $imgsrc=&Apache::lonnet::studentphoto($domain,$user,'jpg');
+    if (($imgsrc) && ($imgsrc ne '/adm/lonKaputt/lonlogo_broken.gif')) {
+	return '<img src="'.$imgsrc.'" align="right" />';
+    } else {
+	return '';
+    }
+}
+
 =pod
 
 =back
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.243 loncom/interface/lonfeedback.pm:1.244
--- loncom/interface/lonfeedback.pm:1.243	Tue Feb 27 15:35:22 2007
+++ loncom/interface/lonfeedback.pm	Wed Feb 28 11:30:40 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.243 2007/02/27 20:35:22 www Exp $
+# $Id: lonfeedback.pm,v 1.244 2007/02/28 16:30:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1012,7 +1012,7 @@
 			        $sender.=' <font color="red"><b>['.$$anonhash{$key}.']</b></font> '.
 				    $screenname;
 			    }
-
+                            $sender.=&Apache::loncommon::studentimagetag($contrib{$idx.':senderdomain'},$contrib{$idx.':sendername'});
 # Set up for sorting by domain, then username
                             unless (defined($$usernamesort{$contrib{$idx.':senderdomain'}})) {
                                 %{$$usernamesort{$contrib{$idx.':senderdomain'}}} = ();
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.66 loncom/interface/lonmsgdisplay.pm:1.67
--- loncom/interface/lonmsgdisplay.pm:1.66	Mon Jan 29 15:07:44 2007
+++ loncom/interface/lonmsgdisplay.pm	Wed Feb 28 11:30:40 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.66 2007/01/29 20:07:44 albertel Exp $
+# $Id: lonmsgdisplay.pm,v 1.67 2007/02/28 16:30:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -119,6 +119,7 @@
 use HTML::TokeParser();
 use Apache::Constants qw(:common);
 use Apache::loncommon();
+use Apache::lonhtmlcommon();
 use Apache::lontexconvert();
 use HTML::Entities();
 use Apache::lonlocal;
@@ -2039,6 +2040,7 @@
     if (defined($content{'baseurl'})) {
         $baseurl = &Apache::lonenc::check_encrypt($content{'baseurl'});
     }
+    $r->print(&Apache::loncommon::studentimagetag($content{'senderdomain'},$content{'sendername'}));
     $r->print('<br /><b>'.&mt('Subject').':</b> '.$content{'subject'}.
 	      ($folder ne 'sent'?'<br /><b>'.&mt('From').':</b> '.
 	      &Apache::loncommon::aboutmewrapper(