<%args> $mask => '' $method => 'boolean' $query => '' $rank => 'on' $callback => 'on' $stats => '' $results => '50' <& header, title => "Advanced Search", extraBody => 'onLoad="document.forms[0].elements[1].focus();document.forms[0].elements[1].select()"', related => ['/commonliilii/help/search.html', 'Search Help', '/commonlii/help/sino_common.html', 'Common Words', '/commonlii/help/boolean.html', 'Boolean Operators'], path => ['/', 'CommonLII'] &>


Find
Enter search query:

[Help] [Boolean operators]

Select the CommonLII Database(s) to search:

Note: You can search multiple databases at once by holding down the Ctrl key on your keyboard and then click the database name for each database you want to include in your search.

<& footer &> <%init> # Set the right method # my %sel_method = ( ); my %sel_results = ( ); $sel_method{$method} = ' SELECTED'; $sel_results{$results} = ' SELECTED'; # Here we search for databases to make selectable by the user. # First, check to see if they've set anything on the URL. # my $options = ''; $mask = uri_unescape($mask); $mask =~ s|/$||g; #warn $mask; if ( $mask eq '' ) { # No mask set -- include some defaults. ## $options .= ''; ## $options .= ''; ## $options .= ''; ## $options .= ''; ## $options .= ''; $options =<CommonLII: All Databases OPTIONS } else { $options .= ''; } # Now read list of databases. If a mask path has been set, then # only show and select the relevant one. Otherwise, include all. # Also, selected the VC based on the mask supplied. # my $found = 0; my $meta = '/commonlii'; my $dbfile_in = ''; if (($mask eq '') or ($mask =~ /^int\//)) { $dbfile_in = '/home/raid2/data/commonlii/www/dblist.html'; $meta = '/commonlii'; } elsif ($mask =~ /^au\//) { $dbfile_in = '/home/web/htdocs/dblist.html'; $meta = '/au'; } elsif ($mask =~ /^nz\//) { $dbfile_in = '/home/web/htdocs/dblist1.html'; $meta = '/nz'; } elsif ($mask =~ /^sp\//) { $dbfile_in = '/home/web/htdocs/dblist2.html'; $meta = '/sp'; } elsif ($mask =~ /^tp\//) { $dbfile_in = '/home/web/htdocs/dblist3.html'; $meta = '/tp'; } else { $dbfile_in = '/home/raid2/data/commonlii/www/dblist.html'; $meta = '/commonlii'; } #if ( open(HTML, " ) { if ( m|VALUE=\"([^\"]+)|i ) { # Save bits. Test to see if this is a set mask path my $mpath = $1; if ( $mpath eq $mask ) { s|\s*$|i ) { s|\s+$||g; $_ .= "\n"; } # Add to list if ( $mask eq '' ) { $options .= $_; } elsif ( $mask eq $mpath ) { $options .= $_; } } else { # Cannot parse -- add anyway (XXX: for now) $options .= $_; } } close(HTML); } else { warn "open: Unable to read dblist.html ($!)\n"; } # Add mask? if ( $mask ne '' && !$found ) { $options .= ''; } # Add spacer? if ( $mask ne '' ) { $options .= ''; }