3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * This is the base Action class for all actions which we redefine. This is
14 * integrated with the StateMachine, Controller and State objects
17 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 require_once 'HTML/QuickForm/Action.php';
22 * Class CRM_Core_QuickForm_Action
24 class CRM_Core_QuickForm_Action
extends HTML_QuickForm_Action
{
27 * Reference to the state machine i belong to.
30 protected $_stateMachine;
35 * @param object $stateMachine
36 * Reference to state machine object.
38 * @return \CRM_Core_QuickForm_Action
40 public function __construct(&$stateMachine) {
41 $this->_stateMachine
= &$stateMachine;
45 * Returns the user to the top of the user context stack.
47 public function popUserContext() {
48 $session = CRM_Core_Session
::singleton();
49 $config = CRM_Core_Config
::singleton();
51 // check if destination is set, if so goto destination
52 $destination = $this->_stateMachine
->getDestination();
54 $destination = urldecode($destination);
57 $destination = $session->popUserContext();
59 if (empty($destination)) {
60 $destination = $config->userFrameworkBaseURL
;
64 //CRM-5839 -do not redirect control.
65 if (!$this->_stateMachine
->getSkipRedirection()) {
66 CRM_Utils_System
::redirect($destination);