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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Tue, 04 Nov 2008 03:25:53 -0000


raeburn		Tue Nov  4 03:25:53 2008 EDT

  Modified files:              
    /loncom/interface	lonselstudent.pm 
  Log:
  &render_student_list() takes additional argument - $context
   - used to suppress <hr /> at the end of the data table where context is email.
   - add missing </select> to end of chosensections select box. 
  
  
Index: loncom/interface/lonselstudent.pm
diff -u loncom/interface/lonselstudent.pm:1.12 loncom/interface/lonselstudent.pm:1.13
--- loncom/interface/lonselstudent.pm:1.12	Fri Jun  6 19:12:59 2008
+++ loncom/interface/lonselstudent.pm	Tue Nov  4 03:25:53 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # lonselstudent.pm : Reusable subs for student selection.
 #
-# $Id: lonselstudent.pm,v 1.12 2008/06/06 19:12:59 bisitz Exp $
+# $Id: lonselstudent.pm,v 1.13 2008/11/04 03:25:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -178,12 +178,14 @@
 #                     This should be true for the first call for a page
 #                     and false for all other calls... only matters if
 #                     multiselect is true.
+#     $context      - If email, do not include <br /><hr /> tags at the end
+#                     of the data table. 
 #  Returns:
 #     HTML  text to add to the rendering of the helper.
 #
 sub render_student_list {
     my ($students, $formname, $formprefix, $defaultusers,
-	$multiselect, $resultname, $javascript) = @_;
+	$multiselect, $resultname, $javascript, $context) = @_;
 
     my $result = "";
 
@@ -330,7 +332,7 @@
 	foreach my $sec (sort {lc($a) cmp lc($b)} (keys(%sections))) {
 	    $result .= '<option name="'.$sec.'">'.$sec.'</option>'."\n";
 	}
-	$result .= '</td><td valign="top">';
+	$result .= '</select></td><td valign="top">';
 	$result .= '<input type="button" name="'.$formprefix.'.select" value="'.&mt('Select').'" onclick='
 	    ."'selectSections(\"$formprefix.chosensections\", \"$formprefix\")'".' /></td>';
 	$result .= '<td valign="top"><input type="button" name="'.$formprefix
@@ -396,8 +398,10 @@
 	        . '</td>'.&Apache::loncommon::end_data_table_row().
 		"\n";
     }
-    $result .= &Apache::loncommon::end_data_table().
-	" <br /> <hr />\n";
+    $result .= &Apache::loncommon::end_data_table();
+    if ($context ne 'email') {
+	$result .= "<br /> <hr />\n";
+    }
 
     return $result;
 }