Change dispatching mechanism of NL content handler
This commit is contained in:
parent
450f56f639
commit
643a63c568
1 changed files with 20 additions and 4 deletions
|
|
@ -3,18 +3,34 @@ package WebGUI::Content::NewsletterManager;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
|
use WebGUI::Pluggable;
|
||||||
|
|
||||||
sub handler {
|
sub handler {
|
||||||
my $session = shift;
|
my $session = shift;
|
||||||
my $form = $session->form;
|
my $form = $session->form;
|
||||||
|
|
||||||
return unless $form->get('newsletter') eq 'manage';
|
my $module = $form->get('newsletter');
|
||||||
|
|
||||||
|
my $class =
|
||||||
|
$module eq 'manage' ? 'WebGUI::Newsletter::Admin'
|
||||||
|
: $module eq 'mailing' ? 'WebGUI::Mailing'
|
||||||
|
: return
|
||||||
|
;
|
||||||
|
|
||||||
|
# return unless $form->get('newsletter') eq 'manage';
|
||||||
|
|
||||||
my $func = 'www_' . ( $form->get('func') || 'view' );
|
my $func = 'www_' . ( $form->get('func') || 'view' );
|
||||||
|
my $id = $form->get('id');
|
||||||
|
|
||||||
my $nl = WebGUI::Newsletter::Admin->new( $session );
|
my $object = WebGUI::Pluggable::instanciate( $class, 'new', [ $session, $id ] );
|
||||||
return unless $nl->can( $func );
|
return $object->$func if $object->can( $func );
|
||||||
|
|
||||||
return $nl->$func;
|
return;
|
||||||
|
|
||||||
|
# my $nl = WebGUI::Newsletter::Admin->new( $session );
|
||||||
|
# return unless $nl->can( $func );
|
||||||
|
#
|
||||||
|
# return $nl->$func;
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue