本文整理汇总了PHP中CRM_Core_StateMachine类的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_StateMachine类的具体用法?PHP CRM_Core_StateMachine怎么用?PHP CRM_Core_StateMachine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CRM_Core_StateMachine类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: CRM_Contribute_StateMachine_ContributionPage
/**
* class constructor
*
* @param object CRM_Contribute_Controller_ContributionPage
* @param int $action
*
* @return object CRM_Contribute_StateMachine_ContributionPage
*/
function CRM_Contribute_StateMachine_ContributionPage($controller, $action = CRM_CORE_ACTION_NONE)
{
parent::CRM_Core_StateMachine($controller, $action);
$session =& CRM_Core_Session::singleton();
$session->set('singleForm', false);
$this->_pages = array('CRM_Contribute_Form_ContributionPage_Settings', 'CRM_Contribute_Form_ContributionPage_Amount', 'CRM_Contribute_Form_ContributionPage_ThankYou', 'CRM_Contribute_Form_ContributionPage_Custom', 'CRM_Contribute_Form_ContributionPage_Premium');
$this->addSequentialPages($this->_pages, $action);
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:16,代码来源:ContributionPage.php
示例2: CRM_Contribute_StateMachine_Search
/**
* class constructor
*/
function CRM_Contribute_StateMachine_Search($controller, $action = CRM_CORE_ACTION_NONE)
{
parent::CRM_Core_StateMachine($controller, $action);
$this->_pages = array();
$this->_pages[] = 'CRM_Contribute_Form_Search';
list($task, $result) = $this->taskName($controller, 'Search');
$this->_task = $task;
if (is_array($task)) {
foreach ($task as $t) {
$this->_pages[] = $t;
}
} else {
$this->_pages[] = $task;
}
$this->addSequentialPages($this->_pages, $action);
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:19,代码来源:Search.php
示例3: CRM_Contact_StateMachine_Search
/**
* class constructor
*/
function CRM_Contact_StateMachine_Search($controller, $action = CRM_CORE_ACTION_NONE)
{
parent::CRM_Core_StateMachine($controller, $action);
$this->_pages = array();
if ($action == CRM_CORE_ACTION_ADVANCED) {
$this->_pages[] = 'CRM_Contact_Form_Search_Advanced';
list($task, $result) = $this->taskName($controller, 'Advanced');
} else {
$this->_pages[] = 'CRM_Contact_Form_Search';
list($task, $result) = $this->taskName($controller, 'Search');
}
$this->_task = $task;
if (is_array($task)) {
foreach ($task as $t) {
$this->_pages[] = $t;
}
} else {
$this->_pages[] = $task;
}
if ($result) {
$this->_pages[] = 'CRM_Contact_Form_Task_Result';
}
$this->addSequentialPages($this->_pages, $action);
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:27,代码来源:Search.php
示例4: CRM_Group_StateMachine
/**
* class constructor
*/
function CRM_Group_StateMachine($controller, $action = CRM_CORE_ACTION_NONE)
{
parent::CRM_Core_StateMachine($controller, $action);
$this->_pages = array('CRM_Group_Form_Edit', 'CRM_Contact_Form_Search', 'CRM_Contact_Form_Task_AddToGroup', 'CRM_Contact_Form_Task_Result');
$this->addSequentialPages($this->_pages, $action);
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:9,代码来源:StateMachine.php
示例5: CRM_Contribute_StateMachine_Contribution
/**
* class constructor
*
* @param object CRM_Import_Controller
* @param int $action
*
* @return object CRM_Import_StateMachine
*/
function CRM_Contribute_StateMachine_Contribution($controller, $action = CRM_CORE_ACTION_NONE)
{
parent::CRM_Core_StateMachine($controller, $action);
$this->_pages = array('CRM_Contribute_Form_Contribution_Main', 'CRM_Contribute_Form_Contribution_Confirm', 'CRM_Contribute_Form_Contribution_ThankYou');
$this->addSequentialPages($this->_pages, $action);
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:14,代码来源:Contribution.php
示例6: CRM_Mailing_StateMachine_Send
/**
* class constructor
*
* @param object CRM_Mailing_Controller
* @param int $action
*
* @return object CRM_Mailing_StateMachine
*/
function CRM_Mailing_StateMachine_Send($controller, $action = CRM_CORE_ACTION_NONE)
{
parent::CRM_Core_StateMachine($controller, $action);
$this->_pages = array('CRM_Mailing_Form_Name', 'CRM_Mailing_Form_Group', 'CRM_Mailing_Form_Upload', 'CRM_Mailing_Form_Test', 'CRM_Mailing_Form_Schedule');
$this->addSequentialPages($this->_pages, $action);
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:14,代码来源:Send.php
示例7: addPages
/**
* Add pages to the controller. Note that the controller does not really care
* the order in which the pages are added
*
* @param CRM_Core_StateMachine $stateMachine
* @param \const|int $action the mode in which the state machine is operating
* typically this will be add/view/edit
*/
public function addPages(&$stateMachine, $action = CRM_Core_Action::NONE)
{
$pages = $stateMachine->getPages();
foreach ($pages as $name => $value) {
$className = CRM_Utils_Array::value('className', $value, $name);
$title = CRM_Utils_Array::value('title', $value);
$options = CRM_Utils_Array::value('options', $value);
$stateName = CRM_Utils_String::getClassName($className);
if (!empty($value['className'])) {
$formName = $name;
} else {
$formName = CRM_Utils_String::getClassName($name);
}
$ext = CRM_Extension_System::singleton()->getMapper();
if ($ext->isExtensionClass($className)) {
require_once $ext->classToPath($className);
} else {
require_once str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
}
${$stateName} = new $className($stateMachine->find($className), $action, 'post', $formName);
if ($title) {
${$stateName}->setTitle($title);
}
if ($options) {
${$stateName}->setOptions($options);
}
if (property_exists(${$stateName}, 'urlPath') && isset($_GET[CRM_Core_Config::singleton()->userFrameworkURLVar])) {
${$stateName}->urlPath = explode('/', $_GET[CRM_Core_Config::singleton()->userFrameworkURLVar]);
}
$this->addPage(${$stateName});
$this->addAction($stateName, new HTML_QuickForm_Action_Direct());
//CRM-6342 -we need kill the reference here,
//as we have deprecated reference object creation.
unset(${$stateName});
}
}
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:44,代码来源:Controller.php
示例8: CRM_History_Import_StateMachine
/**
* class constructor
*
* @param object CRM_History_Import_Controller
* @param int $action
*
* @return object CRM_History_Import_StateMachine
*/
function CRM_History_Import_StateMachine($controller, $action = CRM_CORE_ACTION_NONE)
{
parent::CRM_Core_StateMachine($controller, $action);
$this->_pages = array('CRM_History_Import_Form_UploadFile', 'CRM_History_Import_Form_MapField', 'CRM_History_Import_Form_Preview', 'CRM_History_Import_Form_Summary');
$this->addSequentialPages($this->_pages, $action);
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:14,代码来源:StateMachine.php
示例9: __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);
}
开发者ID:hyebahi,项目名称:civicrm-core,代码行数:13,代码来源:StateMachine.php
示例10: __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);
}
开发者ID:FundingWorks,项目名称:civicrm-core,代码行数:32,代码来源:Checkout.php
示例11: __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);
}
开发者ID:BorislavZlatanov,项目名称:civicrm-core,代码行数:36,代码来源:Search.php
示例12: 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);
}
开发者ID:ksecor,项目名称:civicrm,代码行数:16,代码来源:Item.php
示例13: __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);
}
开发者ID:kcristiano,项目名称:civicrm-core,代码行数:17,代码来源:PCP.php
示例14: 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);
}
开发者ID:hguru,项目名称:224Civi,代码行数:20,代码来源:ContributionPage.php
示例15: 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);
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:22,代码来源:Send.php
示例16: __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);
}
开发者ID:aydun,项目名称:uk.co.vedaconsulting.quickdonate,代码行数:24,代码来源:QuickDonate.php
示例17: 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);
}
开发者ID:peteainsworth,项目名称:civicrm-4.2.9-drupal,代码行数:24,代码来源:Send.php
示例18: 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);
}
开发者ID:bhirsch,项目名称:voipdev,代码行数:19,代码来源:Search.php
示例19: 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);
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:47,代码来源:Registration.php
示例20: array
/**
* class constructor
*
* @param object CRM_Import_Controller
* @param int $action
*
* @return object CRM_Import_StateMachine
*/
function __construct(&$controller, $action = CRM_Core_Action::NONE)
{
parent::__construct($controller, $action);
$this->_pages = array('CRM_Import_Form_DataSource' => null, 'CRM_Import_Form_MapField' => null, 'CRM_Import_Form_Preview' => null, 'CRM_Import_Form_Summary' => null);
$this->addSequentialPages($this->_pages, $action);
}
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:14,代码来源:StateMachine.php
注:本文中的CRM_Core_StateMachine类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论