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

Diff of /Sprout/SearchHelper.pm

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

revision 1.46, Sat Mar 7 18:07:36 2009 UTC revision 1.48, Thu Apr 2 01:45:05 2009 UTC
# Line 489  Line 489 
489                                -value => $self->{class}) .                                -value => $self->{class}) .
490                   CGI::hidden(-name => 'SPROUT',                   CGI::hidden(-name => 'SPROUT',
491                                -value => 1) .                                -value => 1) .
492                   CGI::h3("$title" . Hint($self->{class}, "Click here for more information."));                   CGI::h3("$title" . Hint($self->{class}));
493      # Put in an anchor tag in case there's a table of contents.      # Put in an anchor tag in case there's a table of contents.
494      my $anchorName = $self->FormName();      my $anchorName = $self->FormName();
495      $retVal .= "<a name=\"$anchorName\"></a>\n";      $retVal .= "<a name=\"$anchorName\"></a>\n";
# Line 1379  Line 1379 
1379                                     CGI::popup_menu(-name => 'AliasType',                                     CGI::popup_menu(-name => 'AliasType',
1380                                                      -values => ['FIG', AliasAnalysis::AliasTypes() ],                                                      -values => ['FIG', AliasAnalysis::AliasTypes() ],
1381                                                      -default => $aliasType) .                                                      -default => $aliasType) .
1382                                     Hint("Identifier Type", "Specify how you want gene names to be displayed."))) .                                     Hint("Identifier Type", 27))) .
1383                   "\n" .                   "\n" .
1384                   CGI::Tr(CGI::td("Results/Page"),                   CGI::Tr(CGI::td("Results/Page"),
1385                            CGI::td(CGI::popup_menu(-name => 'PageSize',                            CGI::td(CGI::popup_menu(-name => 'PageSize',
# Line 2176  Line 2176 
2176      return $retVal;      return $retVal;
2177  }  }
2178    
2179    =head3 ParseIDList
2180    
2181        my @idList = $sh->ParseIDList($string);
2182    
2183    Compute the list of IDs found in the specified string. In the string, any
2184    comma, quote, or white space character is considered a delimiter.
2185    Everything else is considered an ID.
2186    
2187    =over 4
2188    
2189    =item string
2190    
2191    Input string containing the IDs.
2192    
2193    =item RETURN
2194    
2195    Returns a list of the IDs found.
2196    
2197    =back
2198    
2199    =cut
2200    
2201    sub ParseIDList {
2202        # Get the parameters.
2203        my ($self, $string) = @_;
2204        # Declare the return variable.
2205        my $retVal;
2206        # Get a safety copy of the string.
2207        my $line = $string;
2208        # Convert all delimiter sequences to spaces.
2209        $line =~ s/[\s"',]+/ /gs;
2210        # Split the result and remove empty entries.
2211        my @retVal = grep { $_ } split / /, $line;
2212        # Return the result.
2213        return @retVal;
2214    }
2215    
2216    
2217    
2218    
2219  =head3 GetPreferredAliasType  =head3 GetPreferredAliasType
2220    
2221      my $type = $shelp->GetPreferredAliasType();      my $type = $shelp->GetPreferredAliasType();
# Line 2198  Line 2238 
2238    
2239  =head3 Hint  =head3 Hint
2240    
2241      my $htmlText = SearchHelper::Hint($wikiPage, $hintText);      my $htmlText = SearchHelper::Hint($wikiPage, $hintID);
2242    
2243  Return the HTML for a small question mark that displays the specified hint text when it is clicked.  Return the HTML for a small question mark that displays the specified hint text when it is clicked.
2244  This HTML can be put in forms to provide a useful hinting mechanism.  This HTML can be put in forms to provide a useful hinting mechanism.
# Line 2209  Line 2249 
2249    
2250  Name of the wiki page to be popped up when the hint mark is clicked.  Name of the wiki page to be popped up when the hint mark is clicked.
2251    
2252  =item hintText  =item hintID
2253    
2254  Text to display for the hint. It is raw html, but may not contain any double quotes.  ID of the text to display for the hint. This is the ID number for a tip-of-the-day.
2255    
2256  =item RETURN  =item RETURN
2257    
# Line 2224  Line 2264 
2264    
2265  sub Hint {  sub Hint {
2266      # Get the parameters.      # Get the parameters.
2267      my ($wikiPage, $hintText) = @_;      my ($wikiPage, $hintID) = @_;
2268      # Ask Sprout to draw the hint button for us.      # Ask Sprout to draw the hint button for us.
2269      return Sprout::Hint($wikiPage, $hintText);      return Sprout::Hint($wikiPage, $hintID);
2270  }  }
2271    
2272    

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.48

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3