本文整理汇总了PHP中CRM_Core_StateMachine::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_StateMachine::__construct方法的具体用法?PHP CRM_Core_StateMachine::__construct怎么用?PHP CRM_Core_StateMachine::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_StateMachine
的用法示例。
在下文中一共展示了CRM_Core_StateMachine::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Class constructor.
*
* @param object $controller
* @param \const|int $action
*/
public function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$classType = str_replace('_Controller', '', get_class($controller));
$this->_pages = array($classType . '_Form_DataSource' => NULL, $classType . '_Form_MapField' => NULL, $classType . '_Form_Preview' => NULL, $classType . '_Form_Summary' => NULL);
$this->addSequentialPages($this->_pages, $action);
}
示例2: __construct
/**
* Class constructor.
*
* @param object $controller
* @param \const|int $action
*/
public function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$this->_pages = array();
if ($action == CRM_Core_Action::ADVANCED) {
$this->_pages['CRM_Contact_Form_Search_Advanced'] = NULL;
list($task, $result) = $this->taskName($controller, 'Advanced');
} elseif ($action == CRM_Core_Action::PROFILE) {
$this->_pages['CRM_Contact_Form_Search_Builder'] = NULL;
list($task, $result) = $this->taskName($controller, 'Builder');
} elseif ($action == CRM_Core_Action::COPY) {
$this->_pages['CRM_Contact_Form_Search_Custom'] = NULL;
list($task, $result) = $this->taskName($controller, 'Custom');
} else {
$this->_pages['CRM_Contact_Form_Search_Basic'] = NULL;
list($task, $result) = $this->taskName($controller, 'Basic');
}
$this->_task = $task;
if (is_array($task)) {
foreach ($task as $t) {
$this->_pages[$t] = NULL;
}
} else {
$this->_pages[$task] = NULL;
}
if ($result) {
$this->_pages['CRM_Contact_Form_Task_Result'] = NULL;
}
$this->addSequentialPages($this->_pages, $action);
}
示例3: __construct
/**
* @param object $controller
* @param const|int $action
*/
public function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$cart = CRM_Event_Cart_BAO_Cart::find_or_create_for_current_session();
$cart->load_associations();
if ($cart->is_empty()) {
CRM_Core_Error::statusBounce(ts("You don't have any events in you cart. Please add some events."), CRM_Utils_System::url('civicrm/event'));
}
$pages = array();
$is_monetary = FALSE;
$is_conference = FALSE;
foreach ($cart->events_in_carts as $event_in_cart) {
if ($event_in_cart->event->is_monetary) {
$is_monetary = TRUE;
}
}
$pages["CRM_Event_Cart_Form_Checkout_ParticipantsAndPrices"] = NULL;
foreach ($cart->events_in_carts as $event_in_cart) {
if ($event_in_cart->is_parent_event()) {
foreach ($event_in_cart->participants as $participant) {
$pages["CRM_Event_Cart_Form_Checkout_ConferenceEvents_{$event_in_cart->event_id}_{$participant->id}"] = array('className' => 'CRM_Event_Cart_Form_Checkout_ConferenceEvents', 'title' => "Select {$event_in_cart->event->title} Events For {$participant->email}");
}
}
}
$pages["CRM_Event_Cart_Form_Checkout_Payment"] = NULL;
$pages["CRM_Event_Cart_Form_Checkout_ThankYou"] = NULL;
$this->addSequentialPages($pages, $action);
}
示例4: __construct
/**
* Class constructor.
*
* @param object $controller
* @param \const|int $action
*
* @internal param \CRM_Contact_Import_Controller $object
* @return \CRM_PCP_StateMachine_PCP CRM_Contact_Import_StateMachine
*/
public function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$session = CRM_Core_Session::singleton();
$session->set('singleForm', FALSE);
$this->_pages = array('CRM_PCP_Form_PCPAccount' => NULL, 'CRM_PCP_Form_Campaign' => NULL);
$this->addSequentialPages($this->_pages, $action);
}
示例5: array
/**
* class constructor
*
* @param object CRM_Auction_Controller
* @param int $action
*
* @return object CRM_Import_StateMachine
*/
function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$session =& CRM_Core_Session::singleton();
$session->set('singleForm', false);
$this->_pages = array('CRM_Auction_Form_ItemAccount' => null, 'CRM_Auction_Form_Item' => null);
$this->addSequentialPages($this->_pages, $action);
}
示例6: array
/**
* class constructor
*
* @param object CRM_Contribute_Controller_ContributionPage
* @param int $action
*
* @return object CRM_Contribute_StateMachine_ContributionPage
*/
function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$session = CRM_Core_Session::singleton();
$session->set('singleForm', FALSE);
$config = CRM_Core_Config::singleton();
$this->_pages = array('CRM_Contribute_Form_ContributionPage_Settings' => NULL, 'CRM_Contribute_Form_ContributionPage_Amount' => NULL, 'CRM_Member_Form_MembershipBlock' => NULL, 'CRM_Contribute_Form_ContributionPage_ThankYou' => NULL, 'CRM_Friend_Form_Contribute' => NULL, 'CRM_PCP_Form_Contribute' => NULL, 'CRM_Contribute_Form_ContributionPage_Custom' => NULL, 'CRM_Contribute_Form_ContributionPage_Premium' => NULL, 'CRM_Contribute_Form_ContributionPage_Widget' => NULL);
if (!in_array("CiviMember", $config->enableComponents)) {
unset($this->_pages['CRM_Member_Form_MembershipBlock']);
}
$this->addSequentialPages($this->_pages, $action);
}
示例7: array
/**
* class constructor
*
* @param object CRM_Mailing_Controller
* @param int $action
*
* @return object CRM_Mailing_StateMachine
*/
function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$this->_pages = array('CRM_Mailing_Form_Group' => null, 'CRM_Mailing_Form_Settings' => null, 'CRM_Mailing_Form_Upload' => null, 'CRM_Mailing_Form_Test' => null);
require_once 'CRM/Mailing/Info.php';
if (CRM_Mailing_Info::workflowEnabled()) {
if (CRM_Core_Permission::check('schedule mailings')) {
$this->_pages['CRM_Mailing_Form_Schedule'] = null;
}
} else {
$this->_pages['CRM_Mailing_Form_Schedule'] = null;
}
$this->addSequentialPages($this->_pages, $action);
}
示例8: __construct
/**
* Class constructor.
*
* @param object $controller
* @param \const|int $action
*
* @internal param \CRM_Contact_Import_Controller $object
* @return \CRM_PCP_StateMachine_PCP CRM_Contact_Import_StateMachine
*/
public function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$session = CRM_Core_Session::singleton();
$session->set('singleForm', FALSE);
$this->_pages = array('CRM_QuickDonate_Form_PCPAccount' => NULL, 'CRM_QuickDonate_Form_Campaign' => NULL);
//MV: skip pcpAccount for logged in user
$userID = $session->get('userID');
$controller->set('jumpForm', FALSE);
if ($userID) {
unset($this->_pages['CRM_QuickDonate_Form_PCPAccount']);
$controller->set('jumpForm', TRUE);
}
$this->addSequentialPages($this->_pages, $action);
}
示例9: array
/**
* class constructor
*
* @param object CRM_Mailing_Controller
* @param int $action
*
* @return object CRM_Mailing_StateMachine
*/
function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$this->_pages = array('CRM_Mailing_Form_Group' => NULL, 'CRM_Mailing_Form_Settings' => NULL, 'CRM_Mailing_Form_Upload' => NULL, 'CRM_Mailing_Form_Test' => NULL);
if (CRM_Mailing_Info::workflowEnabled()) {
if (CRM_Core_Permission::check('schedule mailings')) {
$this->_pages['CRM_Mailing_Form_Schedule'] = NULL;
}
if (CRM_Core_Permission::check('approve mailings')) {
$this->_pages['CRM_Mailing_Form_Approve'] = NULL;
}
} else {
$this->_pages['CRM_Mailing_Form_Schedule'] = NULL;
}
$this->addSequentialPages($this->_pages, $action);
}
示例10: array
/**
* class constructor
*/
function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$this->_pages = array();
$this->_pages['CRM_Member_Form_Search'] = null;
list($task, $result) = $this->taskName($controller, 'Search');
$this->_task = $task;
if (is_array($task)) {
foreach ($task as $t) {
$this->_pages[$t] = null;
}
} else {
$this->_pages[$task] = null;
}
$this->addSequentialPages($this->_pages, $action);
}
示例11: array
/**
* class constructor
*
* @param object CRM_Event_Controller
* @param int $action
*
* @return object CRM_Event_StateMachine
*/
function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$id = CRM_Utils_Request::retrieve('id', 'Positive', $controller, true);
$is_monetary = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $id, 'is_monetary');
$pages = array('CRM_Event_Form_Registration_Register' => null);
//handle additional participant scenario, where we need to insert participant pages on runtime
$additionalParticipant = null;
// check that the controller has some data, hence we dont send the form name
// which results in an invalid argument error
$values = $controller->exportValues();
//first check POST value then QF
if (isset($_POST['additional_participants']) && CRM_Utils_Rule::positiveInteger($_POST['additional_participants'])) {
// we need to use $_POST since the QF framework has not yet been called
// and the additional participants page is the next one, so need to set this up
// now
$additionalParticipant = $_POST['additional_participants'];
} else {
if (isset($values['additional_participants']) && CRM_Utils_Rule::positiveInteger($values['additional_participants'])) {
$additionalParticipant = $values['additional_participants'];
}
}
if ($additionalParticipant) {
$additionalParticipant = CRM_Utils_Type::escape($additionalParticipant, 'Integer');
$controller->set('addParticipant', $additionalParticipant);
}
//to add instances of Additional Participant page, only if user has entered any additional participants
if ($additionalParticipant) {
require_once "CRM/Event/Form/Registration/AdditionalParticipant.php";
$extraPages =& CRM_Event_Form_Registration_AdditionalParticipant::getPages($additionalParticipant);
$pages = array_merge($pages, $extraPages);
}
$additionalPages = array('CRM_Event_Form_Registration_Confirm' => null, 'CRM_Event_Form_Registration_ThankYou' => null);
$pages = array_merge($pages, $additionalPages);
if (!$is_monetary) {
unset($pages['CRM_Event_Form_Registration_Confirm']);
}
$this->addSequentialPages($pages, $action);
}
示例12: __construct
/**
* Class constructor.
*
* @param CRM_Core_Controller $controller
* @param \const|int $action
*
* @return CRM_Contribute_StateMachine_Contribution
*/
public function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$this->_pages = array('CRM_Contribute_Form_Contribution_Main' => NULL, 'CRM_Contribute_Form_Contribution_Confirm' => NULL, 'CRM_Contribute_Form_Contribution_ThankYou' => NULL);
$this->addSequentialPages($this->_pages, $action);
}
示例13: array
/**
* class constructor
*
* @param object CRM_Mailing_Controller
* @param int $action
*
* @return object CRM_Mailing_StateMachine
*/
function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$this->_pages = array('CRM_Mailing_Form_Group' => null, 'CRM_Mailing_Form_Settings' => null, 'CRM_Mailing_Form_Upload' => null, 'CRM_Mailing_Form_Test' => null, 'CRM_Mailing_Form_Schedule' => null);
$this->addSequentialPages($this->_pages, $action);
}
示例14: array
/**
* class constructor
*/
function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$this->_pages = array('CRM_Group_Form_Edit' => null, 'CRM_Contact_Form_Search_Basic' => null, 'CRM_Contact_Form_Task_AddToGroup' => null, 'CRM_Contact_Form_Task_Result' => null);
$this->addSequentialPages($this->_pages, $action);
}
示例15: __construct
/**
* Class constructor.
*
* @param object $controller
* @param \const|int $action
*/
public function __construct($controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$this->_pages = array('CRM_Tournament_Team_Form_Edit' => NULL, 'CRM_Tournament_Player_Form_Task_AddToTeam' => NULL);
$this->addSequentialPages($this->_pages, $action);
}