From e7bfd6db48a46260aa0a37083ecd258432254f83 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Wed, 4 Aug 2010 12:52:41 -0500 Subject: [PATCH] allow asset helper-type responses This should probably be refactored into a WebGUI::ProgressBar::Admin subclass to get rid of all these if statements --- lib/WebGUI/ProgressBar.pm | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/lib/WebGUI/ProgressBar.pm b/lib/WebGUI/ProgressBar.pm index 91b1e01be..09f724aab 100644 --- a/lib/WebGUI/ProgressBar.pm +++ b/lib/WebGUI/ProgressBar.pm @@ -64,7 +64,7 @@ sub new { #------------------------------------------------------------------- -=head2 finish ( $url ) +=head2 finish ( $url|$helper ) Redirects the user out of the status page. @@ -72,11 +72,25 @@ Redirects the user out of the status page. The URL to send the user to. +=head3 $helper + +A hashref response for an Asset Helper to be processed by the Admin Console + =cut sub finish { - my $self = shift; - my $url = shift; + my $self = shift; + my $arg = shift; + + # We may have been passed a URL to go to, or an Asset Helper response hash + my ( $url, $helper ); + if ( !ref $arg ) { + $url = $arg; + } + elsif ( ref $arg eq "HASH" ) { + $helper = $arg; + } + local $| = 1; if ( $url ) { my $text = sprintf(< -parent.admin.closeModalDialog(); - -EOJS + my $text = ''; + $self->session->output->print( $text, 1); # skipMacros return 'chunked'; }