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 |
|
|
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}; |