don't add javascript i18n content handler if it already exists

This commit is contained in:
Graham Knop 2008-11-04 22:47:01 +00:00
parent b7937249d6
commit f43695ecf7

View file

@ -73,12 +73,15 @@ sub installAjaxI18N {
my $session = shift;
print "\tInstalling the AjaxI18N content handler... " unless $quiet;
my $oldHandlers = $session->config->get( "contentHandlers" );
my @newHandlers;
my $oldHandlers = $session->config->get( "contentHandlers" );
for my $handler ( @{ $oldHandlers } ) {
if ( $handler eq "WebGUI::Content::Operation" ) {
push @newHandlers, "WebGUI::Content::AjaxI18N";
}
elsif ( $handler eq "WebGUI::Content::AjaxI18N" ) {
next;
}
push @newHandlers, $handler;
}
$session->config->set( "contentHandlers", \@newHandlers );