Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/Filter
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28018/Filter
Added Files:
AllCaps.pm
Log Message:
OIN-83: add sample filter so we have something that always works
--- NEW FILE: AllCaps.pm ---
package OpenInteract2::Filter::AllCaps;
# $Id: AllCaps.pm,v 1.1 2004/09/27 12:54:15 lachoy Exp $
use strict;
use Log::Log4perl qw( get_logger );
use OpenInteract2::Constants qw( :log );
$OpenInteract2::Filter::AllCaps::VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/);
sub update {
my ( $class, $action, $type, $content ) = @_;
return unless ( $type eq 'filter' );
my $log = get_logger( LOG_APP );
$log->is_info && $log->info( "Running ALLCAPS filter on content" );
$$content =~ tr/a-z/A-Z/;
}
__END__
=head1 NAME
OpenInteract2::Filter::AllCaps - Sample filter to translate content into all caps.
=head1 SYNOPSIS
# In $WEBSITE_DIR/conf/observer.ini
# register the observer
[observer]
allcaps = OpenInteract2::Filter::AllCaps
# map the observer to an action
[observer action]
allcaps = myaction
=head1 DESCRIPTION
Observer that transforms all content to upper case.
=head1 COPYRIGHT
Copyright (c) 2004 Chris Winters. All rights reserved.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
=head1 AUTHORS
Chris Winters E<lt>ch...@cw...E<gt>
|