Merge pull request #15759 from tunbola/active-option-values-for-custom-group
[civicrm-core.git] / CRM / Contribute / StateMachine / ContributionPage.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 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
16 */
17
18/**
19 * State machine for managing different states of the Import process.
6a488035
TO
20 */
21class CRM_Contribute_StateMachine_ContributionPage extends CRM_Core_StateMachine {
22
23 /**
fe482240 24 * Class constructor.
6a488035 25 *
c490a46a
CW
26 * @param CRM_Contribute_Controller_ContributionPage $controller
27 * @param const|int $action
6a488035 28 *
c490a46a 29 * @return CRM_Contribute_StateMachine_ContributionPage
6a488035 30 */
00be9182 31 public function __construct($controller, $action = CRM_Core_Action::NONE) {
6a488035
TO
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
be2fb01f 39 $this->_pages = [
6a488035
TO
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,
be2fb01f 49 ];
6a488035
TO
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 }
96025800 57
6a488035 58}