GBrowse
view release on metacpan or search on metacpan
conf/plugins/FilterTest.pm view on Meta::CPAN
warn $@ if $@;
return $filter,"$key (filter incorrect)" if $@; # error occurred
my $new_key = $FILTERS[ $config->{filter} ][1] =~ m/\$value/
? "$key ($FILTERS[$config->{filter}][0] $value)"
: "$key ($FILTERS[$config->{filter}][0])" ;
return $filter,$new_key;
}
sub config_defaults
{
my $self = shift;
return {
filter_on => 'no',
filter => 0,
filter_value => 150
};
}
sub reconfigure
{
my $self = shift;
my $current_config = $self->configuration;
my $objtype = $self->objtype();
foreach my $p ( param() )
{
my ($c) = ( $p =~ /$objtype\.(\S+)/ ) or next;
$current_config->{$c} = param($p);
}
}
sub configure_form
{
my $self = shift;
my $current_config = $self->configuration;
my $objtype = $self->objtype();
my @choices = TR(
{ -class => 'searchtitle' },
th(
{ -align => 'RIGHT', -width => '25%' },
'Filter on',
td(
radio_group(
-name => "$objtype.filter_on",
-values => [qw(yes no)],
-default => $current_config->{'filter_on'},
-override => 1
)
)
)
);
push @choices,
TR(
{ -class => 'searchtitle' },
th(
{ -align => 'RIGHT', -width => '25%' },
'Filter',
td(
popup_menu(
-name => "$objtype.filter",
-values => [ 0 .. $#FILTERS ],
-labels => \%LABELS,
-default => $current_config->{'filter'}
),
textfield(
-name => "$objtype.filter_value",
-default => $current_config->{filter_value}
)
)
)
);
my $html = table(@choices);
$html;
}
sub objtype
{
( split ( /::/, ref(shift) ) )[-1];
}
1;
( run in 1.158 second using v1.01-cache-2.11-cpan-364913b4093 )