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

albertel lon-capa-cvs-allow@mail.lon-capa.org
Thu, 01 Nov 2007 19:56:41 -0000


albertel		Thu Nov  1 15:56:41 2007 EDT

  Modified files:              
    /loncom/interface	lonselstudent.pm 
  Log:
  - mt student selector
  
  
Index: loncom/interface/lonselstudent.pm
diff -u loncom/interface/lonselstudent.pm:1.9 loncom/interface/lonselstudent.pm:1.10
--- loncom/interface/lonselstudent.pm:1.9	Mon Jul 17 12:26:08 2006
+++ loncom/interface/lonselstudent.pm	Thu Nov  1 15:56:39 2007
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # lonselstudent.pm : Reusable subs for student selection.
 #
-# $Id: lonselstudent.pm,v 1.9 2006/07/17 16:26:08 raeburn Exp $
+# $Id: lonselstudent.pm,v 1.10 2007/11/01 19:56:39 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -28,8 +28,9 @@
 
 package Apache::lonselstudent;
 use     Apache::lonnet;
-use     Apache::loncoursedata;
-use     HTML::Entities;
+use     Apache::lonlocal;
+use     Apache::loncoursedata();
+use     HTML::Entities();
 
 #
 #  Utility function used when rendering <student> tags.
@@ -271,12 +272,12 @@
 	if (elem != null) {
 	    for (k = 0; k < elem.length; k++) {
 		if (elem.options[k].selected) {
-		    what = elem.options[k].text;
-		    if (what == 'All Students') {
+		    what = elem.options[k].value;
+		    if (what == 'allstudents') {
 			setAllStudents(value, which);
-		    } else if (what == 'All Course Personnel') {
+		    } else if (what == 'allpersonnel') {
 			setAllCoursePersonnel(value, which);
-		    } else if (what == 'No Section') {
+		    } else if (what == 'nosection') {
 			setSection('',value, which);
 		    } else {
 			setSection(what, value, which);
@@ -323,18 +324,18 @@
 	}
 	$result .= '<select multiple name="'.$formprefix
 	    .'.chosensections" size="'.$size.'">'."\n";
-	$result .= '<option name="allstudents">All Students</option>';
-	$result .= '<option name="allpersonnel">All Course Personnel</option>';
-	$result .= '<option name="nosection">No Section</option>';
+	$result .= '<option value="allstudents">'.&mt('All Students').'</option>';
+	$result .= '<option value="allpersonnel">'.&mt('All Course Personnel').'</option>';
+	$result .= '<option value="nosection">'.&mt('No Section').'</option>';
 	$result .= "\n";
 	foreach my $sec (sort {lc($a) cmp lc($b)} (keys(%sections))) {
 	    $result .= '<option name="'.$sec.'">'.$sec.'</option>'."\n";
 	}
 	$result .= '</td><td valign="top">';
-	$result .= '<input type="button" name="'.$formprefix.'.select" value="Select" onclick='
+	$result .= '<input type="button" name="'.$formprefix.'.select" value="'.'Select" onclick='
 	    ."'selectSections(\"$formprefix.chosensections\", \"$formprefix\")'".' /></td>';
 	$result .= '<td valign="top"><input type="button" name="'.$formprefix
-	    .'.unselect" value="Unselect"  onclick='.
+	    .'.unselect" value="'.&mt('Unselect').'"  onclick='.
 	    "'unselectSections(\"$formprefix.chosensections\", \"$formprefix\")' ".' /></td></tr></table>';
     }
 
@@ -345,11 +346,11 @@
 
     $result .= &Apache::loncommon::start_data_table();
     $result .= &Apache::loncommon::start_data_table_header_row();
-    $result .= '<th></th><th>Name</th>'."\n";
-    $result .= '    <th>Section</th>'."\n";
-    $result .= '    <th>Status</th>'."\n";
-    $result .= '    <th>Role</th>'."\n";
-    $result .= '    <th>Username : Domain</th>'."\n";
+    $result .= '<th></th><th>'.&mt('Name').'</th>'."\n";
+    $result .= '    <th>'.&mt('Section').'</th>'."\n";
+    $result .= '    <th>'.&mt('Status').'</th>'."\n";
+    $result .= '    <th>'.&mt('Role').'</th>'."\n";
+    $result .= '    <th>'.&mt('Username : Domain').'</th>'."\n";
     $result .= &Apache::loncommon::end_data_table_header_row();
 
     my $input_type;