Merge pull request #15759 from tunbola/active-option-values-for-custom-group
[civicrm-core.git] / CRM / Contribute / StateMachine / ContributionPage.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * State machine for managing different states of the Import process.
20 */
21 class CRM_Contribute_StateMachine_ContributionPage extends CRM_Core_StateMachine {
22
23 /**
24 * Class constructor.
25 *
26 * @param CRM_Contribute_Controller_ContributionPage $controller
27 * @param const|int $action
28 *
29 * @return CRM_Contribute_StateMachine_ContributionPage
30 */
31 public function __construct($controller, $action = CRM_Core_Action::NONE) {
32 parent::__construct($controller, $action);
33
34 $session = CRM_Core_Session::singleton();
35 $session->set('singleForm', FALSE);
36
37 $config = CRM_Core_Config::singleton();
38
39 $this->_pages = [
40 'CRM_Contribute_Form_ContributionPage_Settings' => NULL,
41 'CRM_Contribute_Form_ContributionPage_Amount' => NULL,
42 'CRM_Member_Form_MembershipBlock' => NULL,
43 'CRM_Contribute_Form_ContributionPage_ThankYou' => NULL,
44 'CRM_Friend_Form_Contribute' => NULL,
45 'CRM_PCP_Form_Contribute' => NULL,
46 'CRM_Contribute_Form_ContributionPage_Custom' => NULL,
47 'CRM_Contribute_Form_ContributionPage_Premium' => NULL,
48 'CRM_Contribute_Form_ContributionPage_Widget' => NULL,
49 ];
50
51 if (!in_array("CiviMember", $config->enableComponents)) {
52 unset($this->_pages['CRM_Member_Form_MembershipBlock']);
53 }
54
55 $this->addSequentialPages($this->_pages, $action);
56 }
57
58 }