lib/ezutils/classes/ezmodule.php
function currentAction( $view = '' )
    {
        if ( $view == '' )
            $view = self::currentView();
        if ( isset( $this->ViewActions[$view] ) )
            return $this->ViewActions[$view];
        $http = eZHTTPTool::instance();
        if ( isset( $this->Functions[$view]['default_action'] ) )
        {
            $defaultAction = $this->Functions[$view]['default_action'];
            foreach ( $defaultAction as $defaultActionStructure )
            {
                $actionName = $defaultActionStructure['name'];
                $type = $defaultActionStructure['type'];
                if ( $type == 'post' )
                {
                    $parameters = array();
                    if ( isset( $defaultActionStructure['parameters'] ) )
                        $parameters = $defaultActionStructure['parameters'];
                    $hasParameters = true;
                    foreach ( $parameters as $parameterName )
                    {
                        if ( !$http->hasPostVariable( $parameterName ) )
                        {
                            $hasParameters = false;
                            break;
                        }
                    }
                    if ( $hasParameters )
                    {
                        $this->ViewActions[$view] = $actionName;
                        return $this->ViewActions[$view];
                    }
                }
                else
                {
                    eZDebug::writeWarning( 'Unknown default action type: ' . $type, __METHOD__ );
                }
            }
        }
        if ( isset( $this->Functions[$view]['single_post_actions'] ) )
        {
            $singlePostActions = $this->Functions[$view]['single_post_actions'];
            foreach( $singlePostActions as $postActionName => $realActionName )
            {
                if ( $http->hasPostVariable( $postActionName ) )
                {
                    $this->ViewActions[$view] = $realActionName;
                    return $this->ViewActions[$view];
                }
            }
        }
        if ( isset( $this->Functions[$view]['post_actions'] ) )
        {
            $postActions = $this->Functions[$view]['post_actions'];
            foreach( $postActions as $postActionName )
            {
                if ( $http->hasPostVariable( $postActionName ) )
                {
                    $this->ViewActions[$view] = $http->postVariable( $postActionName );
                    return $this->ViewActions[$view];
                }
            }
        }

        $this->ViewActions[$view] = false;
        return false;
    }
function currentAction( $view = '' )
    {
        if ( $view == '' )
            $view = self::currentView();
        if ( isset( $this->ViewActions[$view] ) )
            return $this->ViewActions[$view];
        $http = eZHTTPTool::instance();
        if ( isset( $this->Functions[$view]['default_action'] ) )
        {
            $defaultAction = $this->Functions[$view]['default_action'];
            foreach ( $defaultAction as $defaultActionStructure )
            {
                $actionName = $defaultActionStructure['name'];
                $type = $defaultActionStructure['type'];
                if ( $type == 'post' )
                {
                    $parameters = array();
                    if ( isset( $defaultActionStructure['parameters'] ) )
                        $parameters = $defaultActionStructure['parameters'];
                    $hasParameters = true;
                    foreach ( $parameters as $parameterName )
                    {
                        if ( !$http->hasPostVariable( $parameterName ) )
                        {
                            $hasParameters = false;
                            break;
                        }
                    }
                    if ( $hasParameters )
                    {
                        $this->ViewActions[$view] = $actionName;
                        return $this->ViewActions[$view];
                    }
                }
                else
                {
                    eZDebug::writeWarning( 'Unknown default action type: ' . $type, __METHOD__ );
                }
            }
        }
        if ( isset( $this->Functions[$view]['single_post_actions'] ) )
        {
            $singlePostActions = $this->Functions[$view]['single_post_actions'];
            foreach( $singlePostActions as $postActionName => $realActionName )
            {
                if ( $http->hasPostVariable( $postActionName ) )
                {
                    $this->ViewActions[$view] = $realActionName;
                    return $this->ViewActions[$view];
                }
            }
        }
        if ( isset( $this->Functions[$view]['post_actions'] ) )
        {
            $postActions = $this->Functions[$view]['post_actions'];
            foreach( $postActions as $postActionName )
            {
                if ( $http->hasPostVariable( $postActionName ) )
                {
                    $this->ViewActions[$view] = $http->postVariable( $postActionName );
                    return $this->ViewActions[$view];
                }
            }
        }

        $this->ViewActions[$view] = false;
        return false;
    }
function currentAction ( $ view = '' ) { if ( $ view == '' ) $ view = self :: currentView ( ) ; if ( isset ( $ this -> ViewActions [ $ view ] ) ) return $ this -> ViewActions [ $ view ] ; $ http = eZHTTPTool :: instance ( ) ; if ( isset ( $ this -> Functions [ $ view ] [ 'default_action' ] ) ) { $ defaultAction = $ this -> Functions [ $ view ] [ 'default_action' ] ; foreach ( $ defaultAction as $ defaultActionStructure ) { $ actionName = $ defaultActionStructure [ 'name' ] ; $ type = $ defaultActionStructure [ 'type' ] ; if ( $ type == 'post' ) { $ parameters = array ( ) ; if ( isset ( $ defaultActionStructure [ 'parameters' ] ) ) $ parameters = $ defaultActionStructure [ 'parameters' ] ; $ hasParameters = true ; foreach ( $ parameters as $ parameterName ) { if ( ! $ http -> hasPostVariable ( $ parameterName ) ) { $ hasParameters = false ; break ; } } if ( $ hasParameters ) { $ this -> ViewActions [ $ view ] = $ actionName ; return $ this -> ViewActions [ $ view ] ; } } else { eZDebug :: writeWarning ( 'Unknown default action type: ' . $ type , __METHOD__ ) ; } } } if ( isset ( $ this -> Functions [ $ view ] [ 'single_post_actions' ] ) ) { $ singlePostActions = $ this -> Functions [ $ view ] [ 'single_post_actions' ] ; foreach ( $ singlePostActions as $ postActionName => $ realActionName ) { if ( $ http -> hasPostVariable ( $ postActionName ) ) { $ this -> ViewActions [ $ view ] = $ realActionName ; return $ this -> ViewActions [ $ view ] ; } } } if ( isset ( $ this -> Functions [ $ view ] [ 'post_actions' ] ) ) { $ postActions = $ this -> Functions [ $ view ] [ 'post_actions' ] ; foreach ( $ postActions as $ postActionName ) { if ( $ http -> hasPostVariable ( $ postActionName ) ) { $ this -> ViewActions [ $ view ] = $ http -> postVariable ( $ postActionName ) ; return $ this -> ViewActions [ $ view ] ; } } } $ this -> ViewActions [ $ view ] = false ; return false ; }
Returns the current action name.

If the current action is not yet determined it will use the definitions in
module.php in order to find out the current action. It first looks trough
the \c single_post_actions array in the selected view mode, the key to
each element is the name of the post-variable to match, if it matches the
element value is set as the action.
\code
'single_post_actions' => array( 'PreviewButton' => 'Preview',
'PublishButton' => 'Publish' )
\endcode
If none of these matches it will use the elements from the \c post_actions
array to find a match. It uses the element value for each element to match
agains a post-variable, if it is found the contents of the post-variable
is set as the action.
\code
'post_actions' => array( 'BrowseActionName' )
\endcode

@return string The current action, or false if not set nor found

@see setCurrentAction(), isCurrentAction()
Returns the current action name .