/[webpac]/trunk2/lib/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 /trunk2/lib/WebPAC.pm

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

revision 389 by dpavlin, Tue Jul 20 17:15:48 2004 UTC revision 398 by dpavlin, Sat Jul 24 13:48:08 2004 UTC
# Line 656  It is used later to produce output. Line 656  It is used later to produce output.
656   my @ds = $webpac->data_structure($rec);   my @ds = $webpac->data_structure($rec);
657    
658  This method will also set C<$webpac->{'currnet_filename'}> if there is  This method will also set C<$webpac->{'currnet_filename'}> if there is
659  <filename> tag in C<import_xml>.  <filename> tag in C<import_xml> and C<$webpac->{'headline'}> if there is
660    <headline> tag.
661    
662  =cut  =cut
663    
# Line 669  sub data_structure { Line 670  sub data_structure {
670          $log->logconfess("need HASH as first argument!") if ($rec !~ /HASH/o);          $log->logconfess("need HASH as first argument!") if ($rec !~ /HASH/o);
671    
672          undef $self->{'currnet_filename'};          undef $self->{'currnet_filename'};
673            undef $self->{'headline'};
674    
675          my @sorted_tags;          my @sorted_tags;
676          if ($self->{tags_by_order}) {          if ($self->{tags_by_order}) {
# Line 706  sub data_structure { Line 708  sub data_structure {
708                                  @v = map { $self->apply_format($tag->{'format_name'},$tag->{'format_delimiter'},$_) } @v;                                  @v = map { $self->apply_format($tag->{'format_name'},$tag->{'format_delimiter'},$_) } @v;
709                          }                          }
710    
711                            if ($field eq 'filename') {
712                                    $self->{'current_filename'} = join('',@v);
713                                    $log->debug("filename: ",$self->{'current_filename'});
714                            } elsif ($field eq 'headline') {
715                                    $self->{'headline'} .= join('',@v);
716                                    $log->debug("headline: ",$self->{'headline'});
717                                    next; # don't return headline in data_structure!
718                            }
719    
720                          # does tag have type?                          # does tag have type?
721                          if ($tag->{'type'}) {                          if ($tag->{'type'}) {
722                                  push @{$row->{$tag->{'type'}}}, @v;                                  push @{$row->{$tag->{'type'}}}, @v;
# Line 714  sub data_structure { Line 725  sub data_structure {
725                                  push @{$row->{'swish'}}, @v;                                  push @{$row->{'swish'}}, @v;
726                          }                          }
727    
                         if ($field eq 'filename') {  
                                 $self->{'current_filename'} = join('',@v);  
                                 $log->debug("filename: ",$self->{'current_filename'});  
                         }  
728    
729                  }                  }
730    

Legend:
Removed from v.389  
changed lines
  Added in v.398

  ViewVC Help
Powered by ViewVC 1.1.26