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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Mon, 07 Jan 2008 03:00:00 -0000


raeburn		Sun Jan  6 22:00:00 2008 EDT

  Modified files:              
    /loncom/interface	lonuserutils.pm loncoursedata.pm 
  Log:
  - &section_group_filter(): move initialization of @options inside loop, in case additional filters are added.
  - call to lonnet::retrievestudentphoto() for full size image occurs immediately before call for thumbnail, during initial parse of %userlist.
  - Add additional index to array, for each userlist item, (for thumbnail of student photo).
  
  
Index: loncom/interface/lonuserutils.pm
diff -u loncom/interface/lonuserutils.pm:1.46 loncom/interface/lonuserutils.pm:1.47
--- loncom/interface/lonuserutils.pm:1.46	Sun Jan  6 00:32:43 2008
+++ loncom/interface/lonuserutils.pm	Sun Jan  6 22:00:00 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Utility functions for managing LON-CAPA user accounts
 #
-# $Id: lonuserutils.pm,v 1.46 2008/01/06 05:32:43 raeburn Exp $
+# $Id: lonuserutils.pm,v 1.47 2008/01/07 03:00:00 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1467,9 +1467,9 @@
                                               all  => 'all',
                                               none => 'none',
                                             );
-    my ($output,@options);
+    my $output;
     foreach my $item (@filters) {
-        my $markup; 
+        my ($markup,@options); 
         if ($env{'form.'.$name{$item}} eq '') {
             $env{'form.'.$name{$item}} = 'all';
         }
@@ -1791,6 +1791,7 @@
     $index->{'role'} = &Apache::loncoursedata::CL_ROLE();
     $index->{'extent'} = &Apache::loncoursedata::CL_EXTENT();
     $index->{'photo'} = &Apache::loncoursedata::CL_PHOTO();
+    $index->{'thumbnail'} = &Apache::loncoursedata::CL_THUMBNAIL();
     foreach my $key (keys(%{$index})) {
         $keylist->[$index->{$key}] = $key;
     }
@@ -2243,7 +2244,6 @@
     }
 
 # Done with header lines in all formats
-
     my %index;
     my $i;
     foreach my $idx (@$keylist) {
@@ -2345,6 +2345,8 @@
                 if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) {
                     if (($displayphotos eq 'on') && ($role eq 'st')) {
                         $userlist->{$user}->[$index{'photo'}] =
+                            &Apache::lonnet::retrievestudentphoto($udom,$uname,'jpg');
+                        $userlist->{$user}->[$index{'thumbnail'}] =
                             &Apache::lonnet::retrievestudentphoto($udom,$uname,
                                                                 'gif','thumbnail');
                     }
@@ -2481,7 +2483,7 @@
                     }
                     if ($env{'course.'.$env{'request.course.id'}.'.internal.showphoto'}) {
                         if ($displayphotos eq 'on' && $role eq 'st' && $in{'photo'} ne '') {
-                            $r->print('    <td align="right"><a href="javascript:photowindow('."'".&Apache::lonnet::studentphoto($in{'domain'},$in{'username'},'jpg')."'".')"><img src="'.$in{'photo'}.'" border="1"></a></td>');
+                            $r->print('    <td align="right"><a href="javascript:photowindow('."'".$in{'photo'}."'".')"><img src="'.$in{'thumbnail'}.'" border="1"></a></td>');
                         } else {
                             $r->print('    <td>&nbsp;</td>  ');
                         }
Index: loncom/interface/loncoursedata.pm
diff -u loncom/interface/loncoursedata.pm:1.185 loncom/interface/loncoursedata.pm:1.186
--- loncom/interface/loncoursedata.pm:1.185	Sat Jan  5 13:36:26 2008
+++ loncom/interface/loncoursedata.pm	Sun Jan  6 22:00:00 2008
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 #
-# $Id: loncoursedata.pm,v 1.185 2008/01/05 18:36:26 raeburn Exp $
+# $Id: loncoursedata.pm,v 1.186 2008/01/07 03:00:00 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3104,6 +3104,7 @@
 sub CL_ROLE     { return 12; }
 sub CL_EXTENT   { return 13; }
 sub CL_PHOTO   { return 14; }
+sub CL_THUMBNAIL { return 15; }
 
 sub get_classlist {
     my ($cdom,$cnum) = @_;