/[webpac2]/Webpacus2/lib/Webpacus/Action/Search.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 /Webpacus2/lib/Webpacus/Action/Search.pm

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

revision 953 by dpavlin, Wed Oct 31 19:05:54 2007 UTC revision 954 by dpavlin, Thu Nov 1 00:17:53 2007 UTC
# Line 72  sub take_action { Line 72  sub take_action {
72                  _('Found') . " $total_hits " .                  _('Found') . " $total_hits " .
73                  _('results for') . " '$query'";                  _('results for') . " '$query'";
74                    
75          $message .= " " . _('on field') . ' ' . $search->name if $search->name;          $message .= " " . _('on field') . ' ' . $search->name if $search;
76    
77          $self->result->content(          $self->result->content(
78                  results => Webpacus::Search::Results->new({                  results => Webpacus::Search::Results->new({
# Line 144  sub next { Line 144  sub next {
144    
145          warn "## next row = ", dump( $row ) if $debug;          warn "## next row = ", dump( $row ) if $debug;
146    
147          return $row;          return sub {
148                    my $name = shift || die "no name?";
149                    if ( defined $row->{$name} ) {
150                            # XXX disabled, Template::Declare always want scalars :-(
151                            if ( 0 && wantarray ) {
152                                    if ( ref($row->{$name}) eq 'ARRAY' ) {
153                                            return $row->{$name};
154                                    } else {
155                                            return [ $row->{$name} ];
156                                    }
157                            } else {
158                                    if ( ref($row->{$name}) eq 'ARRAY' ) {
159                                            return join(' ', @{ $row->{$name} });
160                                    } else {
161                                            return $row->{$name};
162                                    }
163                            }
164                    }
165                    return;
166            }
167  }  }
168    
169  1;  1;

Legend:
Removed from v.953  
changed lines
  Added in v.954

  ViewVC Help
Powered by ViewVC 1.1.26