| 1 | package OpenInteract2::Observer::Controller::GetFiltersFromRequest; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # $Id: GetFiltersFromRequest.pm,v 1.2 2005/02/14 18:23:24 lachoy Exp $ | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Log::Log4perl qw( get_logger ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use OpenInteract2::Constants qw( LOG_ACTION ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use OpenInteract2::Context qw( CTX ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | $OpenInteract2::Observer::Controller::GetFiltersFromRequest::VERSION = sprintf("%d.%02d", q$Revision: 1.2 $ =~ /(\d+)\.(\d+)/); | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 1 | my ( $log ); | |||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 0 | ▶ | sub update { | ||||||||||||||||||||||||||
|
Subroutine
update: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 15 | 0 | my ( $class, $controller, $type, $action ) = @_; | |||||||||||||||||||||||||||
| 16 | 0 | ▶ | return unless ( $type eq 'action assigned' and $action ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$type eq "action assigned" and $action
MC/DC0%0/2
$type eq "action assigned" and $action
$type eq "action assigned"
$action
Truth table0%0/3
A and B
A= $type eq "action assigned"B= $action
| |||||||||||||||||||||||||||||
| 17 | 0 | my $request = CTX->request; | |||||||||||||||||||||||||||
| 18 | 0 | my @filter_add = $request->param( 'OI_FILTER' ); | |||||||||||||||||||||||||||
| 19 | 0 | ▶ | return unless ( scalar @filter_add ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 20 | 0 | ▶ | $log ||= get_logger( LOG_ACTION ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$log ||= get_logger("OI2.ACTION")
MC/DC0%0/2
$log ||= get_logger("OI2.ACTION")
$log
get_logger("OI2.ACTION")
Truth table0%0/3
A ||= B
A= $logB= get_logger("OI2.ACTION")
| |||||||||||||||||||||||||||||
| 21 | 0 | foreach my $filter_name ( @filter_add ) { | |||||||||||||||||||||||||||
| 22 | 0 | ▶ | next unless ( $filter_name ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | 0 | CTX->map_observer( $filter_name, $action ); | |||||||||||||||||||||||||||
| 24 | 0 | $log->info( "Added from request parameter an action filter ", | |||||||||||||||||||||||||||
| 25 | "'$filter_name' to action '", $action->name, "'" ); | ||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 1 | 1; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | __END__ | ||||||||||||||||||||||||||||