add method to process ?op=assetHelper

This commit is contained in:
Doug Bell 2010-07-30 14:20:57 -05:00
parent 6939287a17
commit c7bd22cf09

View file

@ -16,6 +16,7 @@ package WebGUI::Content::Admin;
use strict;
use WebGUI::Admin;
use WebGUI::Pluggable;
=head1 NAME
@ -65,6 +66,19 @@ sub handler {
}
}
if ( $session->form->get("op") eq "assetHelper" ) {
# Load and run the requested asset helper www_ method
my $class = $session->form->get('className');
WebGUI::Pluggable::load( $class );
my $method = $session->form->get('method') || "view";
my $assetId = $session->form->get('assetId');
my $asset = WebGUI::Asset->newById( $session, $assetId );
if ( $class->can( "www_" . $method ) ) {
return $class->can( "www_" . $method )->( $class, $asset );
}
}
return;
}