Merge pull request #15881 from civicrm/5.20
[civicrm-core.git] / CRM / Core / QuickForm / Action / Cancel.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 5 | |
bc77d7c0
TO
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 |
6a488035 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
6a488035
TO
11
12/**
13 * Redefine the cancel action
14 *
15 * @package CRM
ca5cec67 16 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
17 */
18class CRM_Core_QuickForm_Action_Cancel extends CRM_Core_QuickForm_Action {
19
20 /**
d09edf64 21 * Class constructor.
6a488035 22 *
6a0b768e
TO
23 * @param object $stateMachine
24 * Reference to state machine object.
6a488035 25 *
77b97be7 26 * @return \CRM_Core_QuickForm_Action_Cancel
6a488035 27 */
00be9182 28 public function __construct(&$stateMachine) {
6a488035
TO
29 parent::__construct($stateMachine);
30 }
31
32 /**
33 * Processes the request.
34 *
6a0b768e
TO
35 * @param CRM_Core_Form $page
36 * CRM_Core_Form the current form-page.
37 * @param string $actionName
38 * Current action name, as one Action object can serve multiple actions.
6a488035 39 */
00be9182 40 public function perform(&$page, $actionName) {
6a488035
TO
41 // conditional actions if cancelAction is defined
42 $this->_stateMachine->cancelAction();
43
44 $this->popUserContext();
45 }
96025800 46
6a488035 47}