--- trunk/lib/WebPAC/Output/JSON.pm 2007/10/30 17:40:13 912 +++ trunk/lib/WebPAC/Output/JSON.pm 2007/10/30 20:11:02 913 @@ -3,7 +3,7 @@ use warnings; use strict; -use base qw/WebPAC::Common Class::Accessor/; +use base qw/WebPAC::Common WebPAC::Output Class::Accessor/; __PACKAGE__->mk_accessors(qw(path)); #use Encode qw/from_to/; @@ -82,21 +82,7 @@ $log->debug("id: $id ds = ",dump($ds)); - my $item; - - foreach my $t ( keys %$ds ) { - my $name = lc($t); - $name =~ s/\W+/_/g; - - # FIXME get rid of non hash values in data_structure for consistency? - next unless ref($ds->{$t}) eq 'HASH'; - - if ( defined( $ds->{$t}->{display} ) ) { - $item->{$name} = $ds->{$t}->{display}; - } - } - - push @{ $self->{_data} }, $item; + push @{ $self->{_data} }, $self->ds_to_hash( $ds, 'display' ); return 1; }