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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 01 May 2006 16:17:56 -0000


albertel		Mon May  1 12:17:56 2006 EDT

  Modified files:              
    /loncom/interface	lonmsgdisplay.pm 
  Log:
  - xhtml
  - style police
  - death to $_
  
  
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.20 loncom/interface/lonmsgdisplay.pm:1.21
--- loncom/interface/lonmsgdisplay.pm:1.20	Mon May  1 01:57:26 2006
+++ loncom/interface/lonmsgdisplay.pm	Mon May  1 12:17:56 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.20 2006/05/01 05:57:26 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.21 2006/05/01 16:17:56 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -262,7 +262,7 @@
     my $r=shift;
     my $classlist = &Apache::loncoursedata::get_classlist();
     my ($classgroups,$studentgroups) = 
-            &Apache::loncoursedata::get_group_memberships($classlist);
+	&Apache::loncoursedata::get_group_memberships($classlist);
     my %lt=&Apache::lonlocal::texthash('cfa' => 'Check All',
             'cfs' => 'Check Section/Group',
             'cfn' => 'Uncheck All');
@@ -318,19 +318,17 @@
     if (keys(%coursepersonnel) > 0) {
         $r->print('<h3>Non-students</h3>');
         $r->print(&Apache::loncommon::start_data_table());
-        $r->print(&Apache::loncommon::start_data_table_row());
-        $r->print('<th>Name</th><th>Username:Domain</th><th>Role</th>');
-        $r->print(&Apache::loncommon::end_data_table_row());
-        foreach my $role (sort keys %coursepersonnel) {
-            foreach (split(/\,/,$coursepersonnel{$role})) {
-                my ($puname,$pudom)=split(/\:/,$_);
+        $r->print('<tr><th>Name</th><th>Username:Domain</th><th>Role</th></tr>');
+        foreach my $role (sort(keys(%coursepersonnel))) {
+            foreach my $user (split(/\,/,$coursepersonnel{$role})) {
+                my ($puname,$pudom)=split(/\:/,$user);
                 $r->print(&Apache::loncommon::start_data_table_row());
                 $r->print('<td><label>'.
                           '<input type="checkbox" name="send_to_&&&&&&_'.
                           $puname.':'.$pudom.'" /> '.
                           &Apache::loncommon::plainname($puname,$pudom).
                           '</label></td>'.
-                          '<td>('.$_.'),</td><td><i>'.$role.'</i></td>');
+                          '<td>('.$user.'),</td><td><i>'.$role.'</i></td>');
                 $r->print(&Apache::loncommon::end_data_table_row());
             }
         }
@@ -339,9 +337,7 @@
     if (keys(%{$classlist}) > 0) {
         $r->print('<h3>Students</h3>');
         $r->print(&Apache::loncommon::start_data_table());
-        $r->print(&Apache::loncommon::start_data_table_row());
-        $r->print('<th>Name</th><th>Username:Domain</th><th>Section</th><th>Groups</th>');
-        $r->print(&Apache::loncommon::end_data_table_row());
+        $r->print('<tr><th>Name</th><th>Username:Domain</th><th>Section</th><th>Groups</th></tr>');
         my $sort = sub {
 	    my $aname=lc($classlist->{$a}[&Apache::loncoursedata::CL_FULLNAME()]);
 	    if (!$aname) { $aname=$a; }
@@ -360,8 +356,9 @@
             next if ($status ne 'Active');
 	    next if ($env{'request.course.sec'} &&
 		     $section ne $env{'request.course.sec'});
-            my @studentsgroups = &Apache::loncoursedata::get_students_groups(
-                                               $student,$status,$classgroups);
+            my @studentsgroups = 
+		&Apache::loncoursedata::get_students_groups($student,$status,
+							    $classgroups);
             my $grouplist = join(', ',@studentsgroups);
             my $key = 'send_to_&&&'.$section.'&&&_'.$student;
             if (! defined($fullname) || $fullname eq '') {$fullname = $sname;}
@@ -377,7 +374,7 @@
                                 $groupcount.'" />');
                 if (defined($env{'form.group'})) {
                     if ($env{'form.group'} eq $group) {
-                        $checked = 'checked=checked';
+                        $checked = 'checked="checked"';
                     }
                 }
             }
@@ -1357,7 +1354,7 @@
 	
 	my ($setuname,$setudom,$title) = 
 	    &parse_block_record($$records{$record});
-	$title = &HTML::Entities::encode($title,'"<>');
+	$title = &HTML::Entities::encode($title,'"<>&');
         my $settername = &Apache::loncommon::plainname($setuname,$setudom);
         $r->print(&Apache::loncommon::start_data_table_row());
         $r->print(<<"END");