/[webpac2]/Webpacus/lib/Webpacus/Model/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 /Webpacus/lib/Webpacus/Model/WebPAC.pm

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

revision 99 by dpavlin, Tue Nov 22 14:45:12 2005 UTC revision 100 by dpavlin, Tue Nov 22 14:45:17 2005 UTC
# Line 85  sub new { Line 85  sub new {
85                  $c->config->{webpac}->{out_encoding}                  $c->config->{webpac}->{out_encoding}
86          );          );
87    
88          $log->debug("converting encoding from webpac_encoding '" ,          $log->debug("converting encoding from webpac_encoding '" .
89                  $c->config->{webpac}->{webpac_encoding},                  $c->config->{webpac}->{webpac_encoding} .
90                  "' to '",                  "' to '" .
91                  $c->config->{webpac}->{out_encoding},                  $c->config->{webpac}->{out_encoding} .
92                  "'"                  "'"
93          );          );
94    
# Line 113  sub search { Line 113  sub search {
113    
114          $log->debug("loading " . ($#results + 1) . " results");          $log->debug("loading " . ($#results + 1) . " results");
115    
116            my @html_results;
117    
118          for my $i ( 0 .. $#results ) {          for my $i ( 0 .. $#results ) {
119    
120                  my $mfn = $1 if ( $results[$i]->{'@uri'} =~ m#/(\d+)$#);                  my $mfn = $1 if ( $results[$i]->{'@uri'} =~ m#/(\d+)$#);
# Line 120  sub search { Line 122  sub search {
122                  # $log->debug("load_ds( $mfn )");                  # $log->debug("load_ds( $mfn )");
123    
124                  my $ds = $self->{db}->load_ds( $mfn ) || next;                  my $ds = $self->{db}->load_ds( $mfn ) || next;
125                  $results[$i]->{ html } = $self->{iconv}->convert(          
126                  $self->{out}->apply(                  my $html = $self->{out}->apply(
127                          template => $template_filename,                          template => $template_filename,
128                          data => $ds,                          data => $ds,
129                  ) );                  );
130    
131                    $html = $self->{iconv}->convert( $html ) || $log->error("can't convert: $html");
132    
133                    push @html_results, $html;
134    
135          }          }
136    
137          return \@results;          return \@html_results;
138  }  }
139    
140    

Legend:
Removed from v.99  
changed lines
  Added in v.100

  ViewVC Help
Powered by ViewVC 1.1.26