[Bio] / Sprout / SHWordSearch.pm Repository:
ViewVC logotype

Diff of /Sprout/SHWordSearch.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3, Fri Nov 10 22:02:02 2006 UTC revision 1.4, Wed Nov 15 12:14:40 2006 UTC
# Line 69  Line 69 
69    
70  =head3 Form  =head3 Form
71    
72  C<< my $html = $shelp->Include(); >>  C<< my $html = $shelp->Form(); >>
73    
74  Generate the HTML for a form to request a new search.  Generate the HTML for a form to request a new search.
75    
# Line 142  Line 142 
142      # Declare the return variable. If it remains undefined, the caller will      # Declare the return variable. If it remains undefined, the caller will
143      # know that an error occurred.      # know that an error occurred.
144      my $retVal;      my $retVal;
145      # Get the keyword list. We need to prove that there is at least one keyword      # Get the keyword list and validate it.
     # that does not begin with a "-".  
146      my $keywords = $cgi->param('keywords') || "";      my $keywords = $cgi->param('keywords') || "";
147      my @wordList = split /\s+/, $keywords;      if ($self->ValidateKeywords($keywords, 1)) {
     my @plusWords = grep { $_ =~ /^[^\-]/ } @wordList;  
     if (! @wordList) {  
         $self->SetMessage("No search words specified.");  
     } elsif (! @plusWords) {  
         $self->SetMessage("At least one keyword must be positive. All the keywords entered are preceded by minus signs.");  
     } else {  
148          # We have good keywords. Initialize the session file.          # We have good keywords. Initialize the session file.
149          $self->OpenSession();          $self->OpenSession();
150          # Initialize the result counter.          # Initialize the result counter.

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3