Diff for /loncom/interface/lonhelper.pm between versions 1.170 and 1.171

version 1.170, 2009/02/13 20:20:30 version 1.171, 2009/03/17 11:13:59
Line 188  use Apache::lonlocal; Line 188  use Apache::lonlocal;
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::longroup;  use Apache::longroup;
 use Apache::lonselstudent;  use Apache::lonselstudent;
   
   
 use LONCAPA;  use LONCAPA;
   
 # Register all the tags with the helper, so the helper can   # Register all the tags with the helper, so the helper can 
Line 1508  sub postprocess { Line 1510  sub postprocess {
     my $self = shift;      my $self = shift;
     my $chosenValue = $env{'form.' . $self->{'variable'} . '_forminput'};      my $chosenValue = $env{'form.' . $self->{'variable'} . '_forminput'};
   
   
     if (!defined($chosenValue) && !$self->{'allowempty'}) {      if (!defined($chosenValue) && !$self->{'allowempty'}) {
         $self->{ERROR_MSG} =           $self->{ERROR_MSG} = 
     &mt("You must choose one or more choices to continue.");      &mt("You must choose one or more choices to continue.");
         return 0;          return 0;
     }      }
   
   
   
     if (ref($chosenValue)) {      if (ref($chosenValue)) {
         $helper->{VARS}->{$self->{'variable'}} = join('|||', @$chosenValue);          $helper->{VARS}->{$self->{'variable'}} = join('|||', @$chosenValue);
     }      }
Line 2446  sub postprocess { Line 2451  sub postprocess {
         $self->{ERROR_MSG} = 'You must choose at least one resource to continue.';          $self->{ERROR_MSG} = 'You must choose at least one resource to continue.';
         return 0;          return 0;
     }      }
       # For each of the attached options.  If it's env var is undefined, set it to
       # an empty string instead.. an undef'd env var means no choices selected.
       #
   
       my $option_vars = $self->{OPTION_VARS};
       if ($option_vars) {
    foreach my $var (@$option_vars) {
       my $env_name = "form.".$var."_forminput";
       if (!defined($env{$env_name})) {
    $env{$env_name} = '';
    $helper->{VARS}->{$var} = '';
       }
    }
       }
   
   
     if (defined($self->{NEXTSTATE})) {      if (defined($self->{NEXTSTATE})) {
         $helper->changeState($self->{NEXTSTATE});          $helper->changeState($self->{NEXTSTATE});

Removed from v.1.170  
changed lines
  Added in v.1.171


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>