當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Core_Form::mainProcess方法代碼示例

本文整理匯總了PHP中CRM_Core_Form::mainProcess方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_Form::mainProcess方法的具體用法?PHP CRM_Core_Form::mainProcess怎麽用?PHP CRM_Core_Form::mainProcess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Core_Form的用法示例。


在下文中一共展示了CRM_Core_Form::mainProcess方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: perform

 /**
  * Processes the request.
  *
  * @param CRM_Core_Form $page
  *   The current form-page.
  * @param string $actionName
  *   Current action name, as one Action object can serve multiple actions.
  *
  * @return void
  */
 public function perform(&$page, $actionName)
 {
     // save the form values and validation status to the session
     $page->isFormBuilt() or $page->buildForm();
     $pageName = $page->getAttribute('name');
     $data =& $page->controller->container();
     $data['values'][$pageName] = $page->exportValues();
     $data['valid'][$pageName] = $page->validate();
     // Modal form and page is invalid: don't go further
     if ($page->controller->isModal() && !$data['valid'][$pageName]) {
         return $page->handle('display');
     }
     // the page is valid, process it before we jump to the next state
     $page->mainProcess();
     return $page->handle('jump');
 }
開發者ID:FundingWorks,項目名稱:civicrm-core,代碼行數:26,代碼來源:Refresh.php

示例2: perform

 /**
  * Processes the request.
  * this is basically a self submit, so validate the page
  * and if success, call post process
  * when done processing pop to user context
  *
  * @param CRM_Core_Form $page
  *   The current form-page.
  * @param string $actionName
  *   Current action name, as one Action object can serve multiple actions.
  *
  * @return object|void
  */
 public function perform(&$page, $actionName)
 {
     $page->isFormBuilt() or $page->buildForm();
     $pageName = $page->getAttribute('name');
     $data =& $page->controller->container();
     $data['values'][$pageName] = $page->exportValues();
     $data['valid'][$pageName] = $page->validate();
     // Modal form and page is invalid: don't go further
     if ($page->controller->isModal() && !$data['valid'][$pageName]) {
         return $page->handle('display');
     }
     // the page is valid, process it before we jump to the next state
     $page->mainProcess();
     // ok so we are done now, pop stack and jump back to where we came from
     // we do not reset the context because u can achieve that affect using next
     // use Done when u want to pop back to the same context without a reset
     $this->popUserContext();
 }
開發者ID:hyebahi,項目名稱:civicrm-core,代碼行數:31,代碼來源:Done.php

示例3: perform

 /**
  * Processes the request.
  *
  * @param CRM_Core_Form $page
  *   CRM_Core_Form the current form-page.
  * @param string $actionName
  *   Current action name, as one Action object can serve multiple actions.
  *
  * @return void
  */
 public function perform(&$page, $actionName)
 {
     $page->isFormBuilt() or $page->buildForm();
     $pageName = $page->getAttribute('name');
     $data =& $page->controller->container();
     $data['values'][$pageName] = $page->exportValues();
     $data['valid'][$pageName] = $page->validate();
     // Modal form and page is invalid: don't go further
     if ($page->controller->isModal() && !$data['valid'][$pageName]) {
         return $page->handle('display');
     }
     // the page is valid, process it before we jump to the next state
     $page->mainProcess();
     // check if destination is set, if so goto destination
     $destination = $this->_stateMachine->getDestination();
     if ($destination) {
         $destination = urldecode($destination);
         CRM_Utils_System::redirect($destination);
     } else {
         return $page->handle('display');
     }
 }
開發者ID:kcristiano,項目名稱:civicrm-core,代碼行數:32,代碼來源:Submit.php

示例4: perform

 /**
  * Do a state transition jump.
  *
  * Currently only supported types are
  * Next and Back. The other actions (Cancel, Done, Submit etc) do
  * not need the state machine to figure out where to go
  *
  * @param CRM_Core_Form $page
  *   The current form-page.
  * @param string $actionName
  *   Current action name, as one Action object can serve multiple actions.
  * @param string $type
  *   The type of transition being requested (Next or Back).
  *
  * @return object
  */
 public function perform(&$page, $actionName, $type = 'Next')
 {
     // save the form values and validation status to the session
     $page->isFormBuilt() or $page->buildForm();
     $pageName = $page->getAttribute('name');
     $data =& $page->controller->container();
     $data['values'][$pageName] = $page->exportValues();
     $data['valid'][$pageName] = $page->validate();
     // if we are going to the next state
     // Modal form and page is invalid: don't go further
     if ($type == 'Next' && !$data['valid'][$pageName]) {
         return $page->handle('display');
     }
     $state =& $this->_states[$pageName];
     // dont know how or why we landed here so abort and display
     // current page
     if (empty($state)) {
         return $page->handle('display');
     }
     // the page is valid, process it if we are jumping to the next state
     if ($type == 'Next') {
         $page->mainProcess();
         // we get the state again, since postProcess might have changed it
         // this bug took me forever to find :) Lobo
         $state =& $this->_states[$pageName];
         $state->handleNextState($page);
     } else {
         $state->handleBackState($page);
     }
 }
開發者ID:hyebahi,項目名稱:civicrm-core,代碼行數:46,代碼來源:StateMachine.php


注:本文中的CRM_Core_Form::mainProcess方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。