From c7bd22cf09e4014ea00a5e65d822910f6c5a56bb Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Fri, 30 Jul 2010 14:20:57 -0500 Subject: [PATCH] add method to process ?op=assetHelper --- lib/WebGUI/Content/Admin.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/WebGUI/Content/Admin.pm b/lib/WebGUI/Content/Admin.pm index df89727d1..ec91692a3 100644 --- a/lib/WebGUI/Content/Admin.pm +++ b/lib/WebGUI/Content/Admin.pm @@ -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; }