/[webpac]/branches/hidra/WebPac.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 /branches/hidra/WebPac.pm

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

revision 710 by dpavlin, Sun Sep 11 18:45:50 2005 UTC revision 731 by dpavlin, Thu Apr 13 19:47:32 2006 UTC
# Line 282  sub show_results_list { Line 282  sub show_results_list {
282                  $url_params->{"f$i"} = $q->url_param("f$i");                  $url_params->{"f$i"} = $q->url_param("f$i");
283                  $url_params_persist->{"f$i"} = $q->url_param("f$i") if ($persist);                  $url_params_persist->{"f$i"} = $q->url_param("f$i") if ($persist);
284    
285                    my @v;
286    
287                  foreach my $v ($q->url_param("v$i")) {                  foreach my $v ($q->url_param("v$i")) {
288                          # escape quotes so that phrase search work                          # escape quotes so that phrase search work
289                          $v =~ s/"/%22/g;                          $v =~ s/"/%22/g;
290                          $url_params->{"v$i"} = $v;                          push @v, $v;
                         $url_params_persist->{"v$i"} = $v if ($persist);  
291                  }                  }
292                    $url_params->{"v$i"} = \@v;
293                    $url_params_persist->{"v$i"} = \@v if ($persist);
294    
295                  if ($q->param("e$i")) {                  if ($q->param("e$i")) {
296                          $url_params->{"e$i"} = $q->url_param("e$i");                          $url_params->{"e$i"} = $q->url_param("e$i");
# Line 424  sub show_results_list { Line 427  sub show_results_list {
427          # URL parametars for search results          # URL parametars for search results
428          sub cook_url_params {          sub cook_url_params {
429                  my $hash = shift || return;                  my $hash = shift || return;
430                  return join("&", map { $_."=".$hash->{$_} } keys %{$hash});                  return join("&", map {
431                            my $var = $_;
432                            if (ref($hash->{$var}) eq 'ARRAY') {
433                                    join('&',
434                                            map { $var.'='.$_ } @{$hash->{$var}}
435                                    );
436                            } else {
437                                    $var."=".$hash->{$var};
438                            }
439                    } keys %{$hash});
440          }          }
441    
442          $tmpl->param('url_params',"?".cook_url_params($url_params));          $tmpl->param('url_params',"?".cook_url_params($url_params));

Legend:
Removed from v.710  
changed lines
  Added in v.731

  ViewVC Help
Powered by ViewVC 1.1.26