--- loncom/interface/Attic/londropadd.pm 2005/11/21 19:44:14 1.133 +++ loncom/interface/Attic/londropadd.pm 2006/02/07 05:08:32 1.134 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.133 2005/11/21 19:44:14 albertel Exp $ +# $Id: londropadd.pm,v 1.134 2006/02/07 05:08:32 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1258,6 +1258,11 @@ sub show_class_list { if ($sortby !~ /^(username|domain|section|fullname|id|start|end|type)$/) { $sortby = 'username'; } + if (! exists($env{'form.displayphotos'})) { + $env{'form.displayphotos'} = 'off'; + } + my $displayphotos = $env{'form.displayphotos'}; + # Print out header unless ($mode eq 'autoenroll') { $r->print(<print(< + END if ($mode eq 'html' || $mode eq 'view' || $mode eq 'autoenroll') { if ($linkto eq 'aboutme') { @@ -1280,7 +1286,8 @@ END 'sec' => "section", 'start' => "start date", 'end' => "end date", - 'type' => "enroll type/action" + 'type' => "enroll type/action", + 'photo' => "photo", ); unless ($mode eq 'autoenroll') { $r->print(< END } + if ($env{'course.'.$env{'request.course.id'}.'.internal.showphotos'}) { + $r->print(' + + '); + } $r->print("

@@ -1318,8 +1338,23 @@ END - END + if ($env{'course.'.$env{'request.course.id'}.'.internal.showphotos'}) { + my %photo_options = &Apache::lonlocal::texthash ( + 'on' => 'Show', + 'off' => 'Hide', + ); + my $photochg = 'on'; + if ($displayphotos eq 'on') { + $photochg = 'off'; + } + $r->print(' '."\n"); + } + $r->print(" \n"); } elsif ($mode eq 'csv') { # # Open a file @@ -1457,8 +1492,19 @@ END - END + if ($env{'course.'.$env{'request.course.id'}. + '.internal.showphotos'}) { + if ($displayphotos eq 'on') { + my $imgurl = &Apache::lonnet::retrievestudentphoto($domain, + $username,'gif','thumbnail'); + + $r->print(' '); + } else { + $r->print(' '); + } + } + $r->print(' '); } elsif ($mode eq 'csv') { next if (! defined($CSVfile)); # no need to bother with $linkto
$lt{'end'}
'."\n".' '. + ''. + $photo_options{$photochg}.' '.$lt{'photo'}."\n". + '
$section $start $end