/[webpac2]/Webpacus/lib/Webpacus/Controller/Search.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /Webpacus/lib/Webpacus/Controller/Search.pm

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

revision 270 by dpavlin, Sat Dec 17 00:37:12 2005 UTC revision 283 by dpavlin, Sat Dec 17 23:41:10 2005 UTC
# Line 102  sub results : Local { Line 102  sub results : Local {
102    
103          my $params = $c->req->params;          my $params = $c->req->params;
104    
105          # oh, client didn't have ability to setup AJAX, fallback to          # do full-page refresh for clients without JavaScript
106          # page refresh          $c->stash->{results} = $c->subreq('/search/results/ajax', {}, $params);
107          if (! $params->{'_ajax'}) {          $c->stash->{template} = 'search.tt';
                 $params->{_ajax} = 1;  
                 $c->stash->{results} = $c->subreq('/search/results/ajax', {}, $params);  
         $c->stash->{template} = 'search.tt';  
         } else {  
                 $c->forward('/search/results/ajax');  
         }  
108  }  }
109    
110    
# Line 174  sub results_ajax : Path( 'results/ajax' Line 168  sub results_ajax : Path( 'results/ajax'
168                  }                  }
169          }          }
170    
171            if ($params->{_database}) {
172                    my $type = $c->config->{hyperstraier}->{type} || 'search';
173                    my $attr;
174                    if (ref($params->{_database}) eq 'ARRAY') {
175                            # FIXME do we need to add $ at end?
176                            $attr .= '(' . join("|",@{$params->{_database}}) . ')';
177                    } else {
178                            $attr .= $params->{_database};
179                    }
180                    push @attr, '@uri STRRX /' . $type . '/' . $attr . '/';
181            }
182    
183          my $q = join(" $operator ", @words);          my $q = join(" $operator ", @words);
184    
185          my $template = $params->{'_template'} || $c->config->{webpac}->{template};          my $template = $params->{'_template'} || $c->config->{webpac}->{template};

Legend:
Removed from v.270  
changed lines
  Added in v.283

  ViewVC Help
Powered by ViewVC 1.1.26