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

raeburn lon-capa-cvs@mail.lon-capa.org
Mon, 17 Jul 2006 16:26:11 -0000


This is a MIME encoded message

--raeburn1153153571
Content-Type: text/plain

raeburn		Mon Jul 17 12:26:11 2006 EDT

  Modified files:              
    /loncom/interface	lonselstudent.pm lonhelper.pm lonmsgdisplay.pm 
  Log:
  Form element name changed from selectedusers.forminput to selectedusers_forminput so attributes can be obtained via javascript calls for this element.
  
  
--raeburn1153153571
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20060717122611.txt"

Index: loncom/interface/lonselstudent.pm
diff -u loncom/interface/lonselstudent.pm:1.8 loncom/interface/lonselstudent.pm:1.9
--- loncom/interface/lonselstudent.pm:1.8	Thu Jun 29 21:43:06 2006
+++ loncom/interface/lonselstudent.pm	Mon Jul 17 12:26:08 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # lonselstudent.pm : Reusable subs for student selection.
 #
-# $Id: lonselstudent.pm,v 1.8 2006/06/30 01:43:06 albertel Exp $
+# $Id: lonselstudent.pm,v 1.9 2006/07/17 16:26:08 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -363,7 +363,7 @@
     for my $student (@$students) {
 	$result .= &Apache::loncommon::start_data_table_row().
 	    '<td><input type="'.$input_type.'"  name="'.
-	    $resultname.".forminput".'"';
+	    $resultname."_forminput".'"';
 	my $user    = $student->[0];
 
 	# Figure out which students are checked by default...
Index: loncom/interface/lonhelper.pm
diff -u loncom/interface/lonhelper.pm:1.156 loncom/interface/lonhelper.pm:1.157
--- loncom/interface/lonhelper.pm:1.156	Mon Jul  3 07:12:24 2006
+++ loncom/interface/lonhelper.pm	Mon Jul 17 12:26:09 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # .helper XML handler to implement the LON-CAPA helper
 #
-# $Id: lonhelper.pm,v 1.156 2006/07/03 11:12:24 foxr Exp $
+# $Id: lonhelper.pm,v 1.157 2006/07/17 16:26:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -486,7 +486,7 @@
         $self->{VARS}->{$var} = '';
     }
 
-    my $envname = 'form.' . $var . '.forminput';
+    my $envname = 'form.' . $var . '_forminput';
     if (defined($env{$envname})) {
         if (ref($env{$envname})) {
             $self->{VARS}->{$var} = join('|||', @{$env{$envname}});
@@ -1280,7 +1280,7 @@
     function checkall(value, checkName) {
 	for (i=0; i<document.forms.helpform.elements.length; i++) {
             ele = document.forms.helpform.elements[i];
-            if (ele.name == checkName + '.forminput') {
+            if (ele.name == checkName + '_forminput') {
                 document.forms.helpform.elements[i].checked=value;
             }
         }
@@ -1353,7 +1353,7 @@
     foreach my $choice (@{$self->{CHOICES}}) {
         my $id = &new_id();
         $result .= "<tr>\n<td width='20'>&nbsp;</td>\n";
-        $result .= "<td valign='top'><input type='$type' name='$var.forminput'"
+        $result .= "<td valign='top'><input type='$type' name='${var}_forminput'"
             . " value='" . 
             HTML::Entities::encode($choice->[1],"<>&\"'") 
             . "'";
@@ -1372,7 +1372,7 @@
             $choiceLabel. "</label></td>";
 	if ($choice->[4]) {
 	    $result .='<td><input type="text" size="5" name="'
-		.$choice->[4].'.forminput" value="'
+		.$choice->[4].'_forminput" value="'
                 .$choice->[5].'" /></td>';
 	}
 	$result .= "</tr>\n";
@@ -1387,7 +1387,7 @@
 # given, switch to it
 sub postprocess {
     my $self = shift;
-    my $chosenValue = $env{'form.' . $self->{'variable'} . '.forminput'};
+    my $chosenValue = $env{'form.' . $self->{'variable'} . '_forminput'};
 
     if (!defined($chosenValue) && !$self->{'allowempty'}) {
         $self->{ERROR_MSG} = 
@@ -1411,7 +1411,7 @@
         }
 	if ($choice->[4]) {
 	    my $varname = $choice->[4];
-	    $helper->{'VARS'}->{$varname} = $env{'form.'."$varname.forminput"};
+	    $helper->{'VARS'}->{$varname} = $env{'form.'."${varname}_forminput"};
 	}
     }
     return 1;
@@ -1520,7 +1520,7 @@
 	$checkedChoices{$self->{CHOICES}->[0]->[1]} = 1;
     }
 
-    $result .= "<select name='${var}.forminput'>\n";
+    $result .= "<select name='${var}_forminput'>\n";
     foreach my $choice (@{$self->{CHOICES}}) {
         $result .= "<option value='" . 
             HTML::Entities::encode($choice->[1],"<>&\"'") 
@@ -1546,7 +1546,7 @@
 # given, switch to it
 sub postprocess {
     my $self = shift;
-    my $chosenValue = $env{'form.' . $self->{'variable'} . '.forminput'};
+    my $chosenValue = $env{'form.' . $self->{'variable'} . '_forminput'};
 
     if (!defined($chosenValue) && !$self->{'allowempty'}) {
         $self->{ERROR_MSG} = "You must choose one or more choices to" .
@@ -2099,7 +2099,7 @@
     function checkall(value, checkName) {
 	for (i=0; i<document.forms.helpform.elements.length; i++) {
             ele = document.forms.helpform.elements[i];
-            if (ele.name == checkName + '.forminput') {
+            if (ele.name == checkName + '_forminput') {
                 document.forms.helpform.elements[i].checked=value;
             }
         }
@@ -2198,12 +2198,12 @@
 		    }
 		    $col .= 
                         "<td align='center'><input type='checkbox' name ='$option_var".
-			".forminput' value='".
+			"_forminput' value='".
 			$resource_name . "' $checked /> </td>";
 		}
 	    }
 
-            $col .= "<td align='center'><input type='$inputType' name='${var}.forminput' ";
+            $col .= "<td align='center'><input type='$inputType' name='${var}_forminput' ";
 	    if (%defaultSymbs) {
 		my $symb=$resource->symb();
 		if (exists($defaultSymbs{$symb})) {
@@ -2232,7 +2232,7 @@
 	my $resource_name =   
 	    &HTML::Entities::encode(&$valueFunc($resource),"<>&\"'");
 	if ($addparts && (scalar(@{$resource->parts}) > 1)) {
-	    $col .= "<select onclick=\"javascript:updateRadio(this.form,'${var}.forminput','$resource_name');updateHidden(this.form,'$id','${var}');\" name='part_$id.forminput'>\n";
+	    $col .= "<select onclick=\"javascript:updateRadio(this.form,'${var}_forminput','$resource_name');updateHidden(this.form,'$id','${var}');\" name='part_${id}_forminput'>\n";
 	    $col .= "<option value=\"$part\">All Parts</option>\n";
 	    foreach my $part (@{$resource->parts}) {
 		$col .= "<option value=\"$part\">Part: $part</option>\n";
@@ -2254,14 +2254,14 @@
 	}
     }
     function updateHidden(form,id,name) {
-	var select=form['part_'+id+'.forminput'];
-	var hidden=form[name+'_part.forminput'];
+	var select=form['part_'+id+'_forminput'];
+	var hidden=form[name+'_part_forminput'];
 	var which=select.selectedIndex;
 	hidden.value=select.options[which].value;
     }
 // -->
 </script>
-<input type="hidden" name="${var}_part.forminput" />
+<input type="hidden" name="${var}_part_forminput" />
 
 RADIO
     $env{'form.condition'} = !$self->{'toponly'};
@@ -2475,7 +2475,7 @@
 sub postprocess {
     my $self = shift;
 
-    my $result = $env{'form.' . $self->{'variable'} . '.forminput'};
+    my $result = $env{'form.' . $self->{'variable'} . '_forminput'};
     if (!$result && !$self->{'emptyallowed'}) {
 	if ($self->{'coursepersonnel'}) {
 	    $self->{ERROR_MSG} = 
@@ -2660,7 +2660,7 @@
     function checkall(value, checkName) {
 	for (i=0; i<document.forms.helpform.elements.length; i++) {
             ele = document.forms.helpform.elements[i];
-            if (ele.name == checkName + '.forminput') {
+            if (ele.name == checkName + '_forminput') {
                 document.forms.helpform.elements[i].checked=value;
             }
         }
@@ -2777,7 +2777,7 @@
             my $id = &new_id();
             $result .= '<tr><td align="right"' . " bgcolor='$color'>" .
                 "<input $onclick type='$type' name='" . $var
-            . ".forminput' ".qq{id="$id"}." value='" . HTML::Entities::encode($fileName,"<>&\"'").
+            . "_forminput' ".qq{id="$id"}." value='" . HTML::Entities::encode($fileName,"<>&\"'").
                 "'";
             if (!$self->{'multichoice'} && $choices == 0) {
                 $result .= ' checked="checked"';
@@ -2838,7 +2838,7 @@
 
 sub postprocess {
     my $self = shift;
-    my $result = $env{'form.' . $self->{'variable'} . '.forminput'};
+    my $result = $env{'form.' . $self->{'variable'} . '_forminput'};
     if (!$result) {
         $self->{ERROR_MSG} = 'You must choose at least one file '.
             'to continue.';
@@ -3074,7 +3074,7 @@
         $result .= '<p><font color="#FF0000">' . $self->{ERROR_MSG} . '</font></p>';
     }
 
-    $result .= '<input type="string" name="' . $self->{'variable'} . '.forminput"';
+    $result .= '<input type="string" name="' . $self->{'variable'} . '_forminput"';
 
     if (defined($self->{'size'})) {
         $result .= ' size="' . $self->{'size'} . '"';
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.36 loncom/interface/lonmsgdisplay.pm:1.37
--- loncom/interface/lonmsgdisplay.pm:1.36	Thu Jun 29 22:05:22 2006
+++ loncom/interface/lonmsgdisplay.pm	Mon Jul 17 12:26:09 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.36 2006/06/30 02:05:22 albertel Exp $
+# $Id: lonmsgdisplay.pm,v 1.37 2006/07/17 16:26:09 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1645,7 +1645,7 @@
 	}
 
 	my @to =
-	    &Apache::loncommon::get_env_multiple('form.selectedusers.forminput');
+	    &Apache::loncommon::get_env_multiple('form.selectedusers_forminput');
 	my $mode = $env{'form.sendmode'};
 
 	my %toaddr;

--raeburn1153153571--