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

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

revision 709 by dpavlin, Sun Sep 11 18:00:46 2005 UTC revision 733 by dpavlin, Wed May 24 13:32:07 2006 UTC
# Line 63  sub suff2file($$$$) { Line 63  sub suff2file($$$$) {
63    
64          return $tpl if (! $base_path);          return $tpl if (! $base_path);
65    
66            #warn "base_path: $base_path, p: $p, path: $path, tpl: $tpl\n";
67    
68            $p =~ s#/[^/]*$##;
69    
70          # strip everything to and including base path, leaving only          # strip everything to and including base path, leaving only
71          # additional (virtual) path          # additional (virtual) path
72          if ($base_path eq "/") {          if ($base_path eq "/") {
# Line 282  sub show_results_list { Line 286  sub show_results_list {
286                  $url_params->{"f$i"} = $q->url_param("f$i");                  $url_params->{"f$i"} = $q->url_param("f$i");
287                  $url_params_persist->{"f$i"} = $q->url_param("f$i") if ($persist);                  $url_params_persist->{"f$i"} = $q->url_param("f$i") if ($persist);
288    
289                    my @v;
290    
291                  foreach my $v ($q->url_param("v$i")) {                  foreach my $v ($q->url_param("v$i")) {
292                          # escape quotes so that phrase search work                          # escape quotes so that phrase search work
293                          $v =~ s/"/%22/g;                          $v =~ s/"/%22/g;
294                          $url_params->{"v$i"} = $v;                          push @v, $v;
                         $url_params_persist->{"v$i"} = $v if ($persist);  
295                  }                  }
296                    $url_params->{"v$i"} = \@v;
297                    $url_params_persist->{"v$i"} = \@v if ($persist);
298    
299                  if ($q->param("e$i")) {                  if ($q->param("e$i")) {
300                          $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 431  sub show_results_list {
431          # URL parametars for search results          # URL parametars for search results
432          sub cook_url_params {          sub cook_url_params {
433                  my $hash = shift || return;                  my $hash = shift || return;
434                  return join("&", map { $_."=".$hash->{$_} } keys %{$hash});                  return join("&", map {
435                            my $var = $_;
436                            if (ref($hash->{$var}) eq 'ARRAY') {
437                                    join('&',
438                                            map { $var.'='.$_ } @{$hash->{$var}}
439                                    );
440                            } else {
441                                    $var."=".$hash->{$var};
442                            }
443                    } keys %{$hash});
444          }          }
445    
446          $tmpl->param('url_params',"?".cook_url_params($url_params));          $tmpl->param('url_params',"?".cook_url_params($url_params));

Legend:
Removed from v.709  
changed lines
  Added in v.733

  ViewVC Help
Powered by ViewVC 1.1.26