Forums / Developer / Second action after content/action

Second action after content/action

Author Message

Marcin Drozd

Friday 08 June 2007 2:19:14 pm

Hi
I have a new action (content action), when I have to check some special conditions, and next, go to /kernel/content/action.php and execute a suitable requirement. now, I have (it's just an example) - (but it is nonfunctional):

/extension/myext/actions/content_actionhandler.php:

function myext_ContentActionHandler( &$module, &$http, &$objectID ) 
{
	if( $http->hasPostVariable("MyNewAction") )
	{
		unset($_POST['MyNewAction']);
		
		//some code
		$result = DoSomething( ... );
		
		if ( $result == 0)
		{
			$http->setPostVariable( 'ActionCollectInformation', 'ActionCollectInformation' );
			$Result =& $module->run( "collectinformation", array() );
			return $Result;
		}
		elseif ( $result == 1)
		{
			DoSomethingElse( ... );
		}
		... etc ...
		else
		{
			return $module->handleError( EZ_ERROR_KERNEL_NOT_AVAILABLE, 'kernel' );
		}

	}
}

instead of:

if ( $result == 0)
{
	$http->setPostVariable( 'ActionCollectInformation', 'ActionCollectInformation' );
	$Result =& $module->run( "collectinformation", array() );
	return $Result;
}
elseif ( $result == 1)
{
	DoSomethingElse( ... );
}

I need (for example) to include action.php but there is no longer $Params variable (from index.php)
like this:

$strRedirectAction = $http->postVariable( 'RedirectSubAction' )
$http->setPostVariable( $strRedirectAction, $strRedirectAction );
goto(kernel/content/action.php); or goto(kernel/user/register.php); or goto(somewhere);

How can I do this?
Thank U

http://ez-publish.pl