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

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

revision 8 by dpavlin, Sat Jan 11 16:44:03 2003 UTC revision 9 by dpavlin, Sat Jan 11 19:55:30 2003 UTC
# Line 8  use HTML::FillInForm; Line 8  use HTML::FillInForm;
8  use SWISH;  use SWISH;
9  use Unicode::String qw(utf8 utf16);  use Unicode::String qw(utf8 utf16);
10  require Unicode::Map8;  require Unicode::Map8;
11    use DBI;
12    
13  # configuration options  # configuration options
14  # FIX: they really should go in configuration file!  # FIX: they really should go in configuration file!
# Line 25  sub setup { Line 26  sub setup {
26          $self->run_modes(          $self->run_modes(
27                  'search' => 'show_search_form',                  'search' => 'show_search_form',
28                  'results' => 'show_results_list',                  'results' => 'show_results_list',
29  #               'user' => 'show_user_detail'  #               'user' => 'show_user_detail',
30                    'index' => 'show_index',
31          );          );
32          $self->start_mode('search');          $self->start_mode('search');
33          $self->mode_param('rm');          $self->mode_param('rm');
# Line 56  sub show_results_list { Line 58  sub show_results_list {
58          my @swish_results;      # results from swish          my @swish_results;      # results from swish
59    
60          # load template for this page          # load template for this page
         my $tmpl = $self->load_tmpl('results.html');  
61    
62          my @s_arr;      # all queries are located here          my @s_arr;      # all queries are located here
63    
64          for(my $i = 1; $i <=10; $i++) {          for(my $i = 1; $i <=10; $i++) {
65    
66                  last if (! $q->param("f$i"));                  return show_index($self, $i) if ($q->param("f".$i."_index"));
67                    next if (! $q->param("f$i"));
68                  next if (! $q->param("v$i"));                  next if (! $q->param("v$i"));
69    
70                  # re-write query from +/- to and/and not                  # re-write query from +/- to and/and not
# Line 84  sub show_results_list { Line 86  sub show_results_list {
86                          }                          }
87                  }                  }
88    
89                  push @s_arr,$q->param("f$i")."=($s)";                  push @s_arr,$q->param("f$i")."_swish=($s)";
90          }          }
91    
92            my $tmpl = $self->load_tmpl('results.html');
93    
94          my $l2_map = Unicode::Map8->new($CHARSET) || die;          my $l2_map = Unicode::Map8->new($CHARSET) || die;
95          my $us = Unicode::String->new();          my $us = Unicode::String->new();
96    
# Line 161  sub show_results_list { Line 165  sub show_results_list {
165          return $html;          return $html;
166  }  }
167    
168    sub show_index {
169            my $self = shift;
170            my $i = shift;          # field number
171    
172            my $q = $self->query();
173    
174            my $html;
175    
176            $html .= "show index of ".$q->param("f$i")." for ".$q->param("v$i");
177    
178    
179            return $html;
180    }
181    
182  1;  1;

Legend:
Removed from v.8  
changed lines
  Added in v.9

  ViewVC Help
Powered by ViewVC 1.1.26