all=2 will display other repeatable values
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 20 May 2010 21:06:45 +0000 (23:06 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 20 May 2010 21:06:45 +0000 (23:06 +0200)
This allows you to see facet of values not passing filter, but from
same items, allowing co-relation analysys

lib/MojoFacets/Data.pm

index 1780fee..68a6b0c 100644 (file)
@@ -273,11 +273,11 @@ sub filter {
 
 
 sub _data_items {
-       my ( $self, $all ) = shift;
+       my ( $self, $all ) = @_;
        my $path = $self->session('path') || $self->redirect_to( '/data/index' );
        my $data = $self->_loaded( 'data' );
 
-       return @{ $data->{items} } if $all;
+       return @{ $data->{items} } if $all == 1;
 
        my $filters = $self->_current_filters;
        my $filter_value;
@@ -407,7 +407,7 @@ sub facet {
        my $facet;
        my $name = $self->param('name') || die "no name";
 
-       my $all = $self->_perm_scalar('all', 0);
+       my $all = $self->_perm_scalar('all', 1);
 
        foreach my $i ( $self->_data_items($all) ) {
                if ( ! exists $i->{$name} ) {