/[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 10 by dpavlin, Thu Jan 16 17:35:54 2003 UTC revision 11 by dpavlin, Wed Jan 22 20:24:32 2003 UTC
# Line 9  use SWISH; Line 9  use SWISH;
9  use Unicode::MapUTF8 qw(to_utf8 from_utf8 utf8_supported_charset);  use Unicode::MapUTF8 qw(to_utf8 from_utf8 utf8_supported_charset);
10  use DBI;  use DBI;
11    
12    use lib '..';
13    use index_DBI;
14    
15  # configuration options  # configuration options
16  # FIX: they really should go in configuration file!  # FIX: they really should go in configuration file!
17  my $TEMPLATE_PATH = '/data/webpac/template_html';  my $TEMPLATE_PATH = '/data/webpac/template_html';
# Line 165  sub show_index { Line 168  sub show_index {
168    
169          my $q = $self->query();          my $q = $self->query();
170    
171            my $field = $q->param("f$i");
172            my $limit = $q->param("v$i");
173    
174    
175          my $html;          my $html;
176    
177          $html .= "show index of ".$q->param("f$i")." for ".$q->param("v$i");          my $index = new index_DBI();
178    
179            if (! $index->check($field)) {
180                    my $tmpl = $self->load_tmpl('no_index.html');
181                    $tmpl->param('field',$field);
182                    $html = $tmpl->output;
183                    return $html;
184            }
185    
186            my @index_arr = $index->fetch($field,'item',$limit);
187    
188            $html .= "show index of <i>$field</i>";
189            $html .= " for <i>$limit</i>" if ($limit);
190    
191            while (my $row = shift @index_arr) {
192                    $html .= "<br>".$row->{item}."\n";
193            }
194    
195          return $html;          return $html;
196  }  }

Legend:
Removed from v.10  
changed lines
  Added in v.11

  ViewVC Help
Powered by ViewVC 1.1.26