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


PHP CRM_Core_Controller類代碼示例

本文整理匯總了PHP中CRM_Core_Controller的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_Controller類的具體用法?PHP CRM_Core_Controller怎麽用?PHP CRM_Core_Controller使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: __construct

 /**
  * Constructor.
  *
  * @param null $path
  *   The class Path of the form being implemented
  * @param bool $title
  * @param string $mode
  * @param bool $imageUpload
  * @param bool $addSequence
  *   Should we add a unique sequence number to the end of the key.
  * @param bool $ignoreKey
  *   Should we not set a qfKey for this controller (for standalone forms).
  * @param bool $attachUpload
  *
  * @return \CRM_Core_Controller_Simple
  */
 public function __construct($path, $title, $mode = NULL, $imageUpload = FALSE, $addSequence = FALSE, $ignoreKey = FALSE, $attachUpload = FALSE)
 {
     // by definition a single page is modal :). We use the form name as the scope for this controller
     parent::__construct($title, TRUE, $mode, $path, $addSequence, $ignoreKey);
     $this->_stateMachine = new CRM_Core_StateMachine($this);
     $params = array($path => NULL);
     $savedAction = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, NULL);
     if (!empty($savedAction) && $savedAction != $mode) {
         $mode = $savedAction;
     }
     $this->_stateMachine->addSequentialPages($params, $mode);
     $this->addPages($this->_stateMachine, $mode);
     //changes for custom data type File
     $uploadNames = $this->get('uploadNames');
     $config = CRM_Core_Config::singleton();
     if (is_array($uploadNames) && !empty($uploadNames)) {
         $uploadArray = $uploadNames;
         $this->addActions($config->customFileUploadDir, $uploadArray);
         $this->set('uploadNames', NULL);
     } else {
         // always allow a single upload file with same name
         if ($attachUpload) {
             $this->addActions($config->uploadDir, CRM_Core_BAO_File::uploadNames());
         } elseif ($imageUpload) {
             $this->addActions($config->imageUploadDir, array('uploadFile'));
         } else {
             $this->addActions();
         }
     }
 }
開發者ID:FundingWorks,項目名稱:civicrm-core,代碼行數:46,代碼來源:Simple.php

示例2: CRM_Contribute_Controller_Contribution

 /**
  * class constructor
  */
 function CRM_Contribute_Controller_Contribution($title = null, $action = CRM_CORE_ACTION_NONE, $modal = true)
 {
     require_once 'CRM/Contribute/StateMachine/Contribution.php';
     parent::CRM_Core_Controller($title, $modal);
     $this->_stateMachine =& new CRM_Contribute_StateMachine_Contribution($this, $action);
     // create and instantiate the pages
     $this->addPages($this->_stateMachine, $action);
     // add all the actions
     $this->addActions();
 }
開發者ID:bhirsch,項目名稱:voipdrupal-4.7-1.0,代碼行數:13,代碼來源:Contribution.php

示例3: CRM_Contact_Controller_Search

 /**
  * class constructor
  */
 function CRM_Contact_Controller_Search($title = null, $action = CRM_CORE_ACTION_NONE, $modal = true)
 {
     require_once 'CRM/Contact/StateMachine/Search.php';
     parent::CRM_Core_Controller($title, $modal);
     $this->_stateMachine =& new CRM_Contact_StateMachine_Search($this, $action);
     // create and instantiate the pages
     $this->addPages($this->_stateMachine, $action);
     // add all the actions
     $config =& CRM_Core_Config::singleton();
     $this->addActions();
 }
開發者ID:bhirsch,項目名稱:voipdrupal-4.7-1.0,代碼行數:14,代碼來源:Search.php

示例4: CRM_Import_Controller

 /**
  * class constructor
  */
 function CRM_Import_Controller($title = null, $action = CRM_CORE_ACTION_NONE, $modal = true)
 {
     parent::CRM_Core_Controller($title, $modal);
     require_once 'CRM/Import/StateMachine.php';
     $this->_stateMachine =& new CRM_Import_StateMachine($this, $action);
     // create and instantiate the pages
     $this->addPages($this->_stateMachine, $action);
     // add all the actions
     $config =& CRM_Core_Config::singleton();
     $this->addActions($config->uploadDir, array('uploadFile'));
 }
開發者ID:bhirsch,項目名稱:voipdrupal-4.7-1.0,代碼行數:14,代碼來源:Controller.php

示例5: CRM_Mailing_Controller_Send

 /**
  * class constructor
  */
 function CRM_Mailing_Controller_Send($title = null, $action = CRM_CORE_ACTION_NONE, $modal = true)
 {
     require_once 'CRM/Mailing/StateMachine/Send.php';
     parent::CRM_Core_Controller($title, $modal);
     $this->_stateMachine =& new CRM_Mailing_StateMachine_Send($this, $action);
     // create and instantiate the pages
     $this->addPages($this->_stateMachine, $action);
     // add all the actions
     $config =& CRM_Core_Config::singleton();
     $this->addActions($config->uploadDir, array('textFile', 'htmlFile'));
 }
開發者ID:bhirsch,項目名稱:voipdrupal-4.7-1.0,代碼行數:14,代碼來源:Send.php

示例6: array

 /**
  * constructor
  *
  * @param string  path        the class Path of the form being implemented
  * @param string  title       the descriptive name for the page
  * @param int     mode        the mode that the form will operate on
  * @param boolean addSequence should we add a unique sequence number to the end of the key
  * @param boolean ignoreKey    should we not set a qfKey for this controller (for standalone forms)
  *
  * @return object
  * @access public
  */
 function __construct($path, $title, $mode = null, $imageUpload = false, $addSequence = false, $ignoreKey = false, $attachUpload = false)
 {
     // by definition a single page is modal :). We use the form name as the scope for this controller
     parent::__construct($title, true, $mode, $path, $addSequence, $ignoreKey);
     $this->_stateMachine =& new CRM_Core_StateMachine($this);
     $params = array($path => null);
     $this->_stateMachine->addSequentialPages($params, $mode);
     $this->addPages($this->_stateMachine, $mode);
     //changes for custom data type File
     $uploadNames = $this->get('uploadNames');
     $config =& CRM_Core_Config::singleton();
     if (is_array($uploadNames) && !empty($uploadNames)) {
         $uploadArray = $uploadNames;
         $this->addActions($config->customFileUploadDir, $uploadArray);
         $this->set('uploadNames', null);
     } else {
         // always allow a single upload file with same name
         if ($attachUpload) {
             require_once 'CRM/Core/BAO/File.php';
             $this->addActions($config->uploadDir, CRM_Core_BAO_File::uploadNames());
         } else {
             if ($imageUpload) {
                 $this->addActions($config->imageUploadDir, array('uploadFile'));
             } else {
                 $this->addActions();
             }
         }
     }
 }
開發者ID:ksecor,項目名稱:civicrm,代碼行數:41,代碼來源:Simple.php

示例7: __construct

 /**
  * Class constructor.
  *
  * @param null $title
  * @param bool|int $action
  * @param bool $modal
  *
  * @throws \Exception
  */
 public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE)
 {
     parent::__construct($title, $modal, NULL, FALSE, TRUE);
     // New:            civicrm/mailing/send?reset=1
     // Re-use:         civicrm/mailing/send?reset=1&mid=%%mid%%
     // Continue:       civicrm/mailing/send?reset=1&mid=%%mid%%&continue=true
     $mid = CRM_Utils_Request::retrieve('mid', 'Positive');
     $continue = CRM_Utils_Request::retrieve('continue', 'String');
     if (!$mid) {
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/a/', NULL, TRUE, '/mailing/new'));
     }
     if ($mid && $continue) {
         //CRM-15979 - check if abtest exist for mailing then redirect accordingly
         $abtest = CRM_Mailing_BAO_MailingAB::getABTest($mid);
         if (!empty($abtest) && !empty($abtest->id)) {
             $redirect = CRM_Utils_System::url('civicrm/a/', NULL, TRUE, '/abtest/' . $abtest->id);
         } else {
             $redirect = CRM_Utils_System::url('civicrm/a/', NULL, TRUE, '/mailing/' . $mid);
         }
         CRM_Utils_System::redirect($redirect);
     }
     if ($mid && !$continue) {
         $clone = civicrm_api3('Mailing', 'clone', array('id' => $mid));
         CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/a/', NULL, TRUE, '/mailing/' . $clone['id']));
     }
 }
開發者ID:nielosz,項目名稱:civicrm-core,代碼行數:35,代碼來源:Send.php

示例8: __construct

 /**
  * Class constructor.
  *
  * @param string $title
  * @param bool|int $action
  * @param bool $modal
  */
 public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE)
 {
     parent::__construct($title, $modal);
     $this->_stateMachine = new CRM_Contribute_StateMachine_ContributionPage($this, $action);
     // Create and instantiate the pages.
     $this->addPages($this->_stateMachine, $action);
     $this->addActions();
 }
開發者ID:nielosz,項目名稱:civicrm-core,代碼行數:15,代碼來源:ContributionPage.php

示例9: __construct

 /**
  * Class constructor.
  *
  * @param string $title
  * @param bool $modal
  * @param int|mixed|null $action
  */
 public function __construct($title = NULL, $modal = TRUE, $action = CRM_Core_Action::NONE)
 {
     parent::__construct($title, $modal);
     $this->_stateMachine = new CRM_Contact_StateMachine_Search($this, $action);
     // create and instantiate the pages
     $this->addPages($this->_stateMachine, $action);
     // add all the actions
     $this->addActions();
 }
開發者ID:nielosz,項目名稱:civicrm-core,代碼行數:16,代碼來源:Search.php

示例10: array

 /**
  * class constructor
  */
 function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE)
 {
     parent::__construct($title, $modal);
     $this->_stateMachine = new CRM_Activity_Import_StateMachine($this, $action);
     // create and instantiate the pages
     $this->addPages($this->_stateMachine, $action);
     // add all the actions
     $config = CRM_Core_Config::singleton();
     $this->addActions($config->uploadDir, array('uploadFile'));
 }
開發者ID:peteainsworth,項目名稱:civicrm-4.2.9-drupal,代碼行數:13,代碼來源:Controller.php

示例11:

 /**
  * class constructor
  */
 function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE)
 {
     parent::__construct($title, $modal);
     $this->_stateMachine = new CRM_Member_StateMachine_Search($this, $action);
     // create and instantiate the pages
     $this->addPages($this->_stateMachine, $action);
     // add all the actions
     $config = CRM_Core_Config::singleton();
     $this->addActions();
 }
開發者ID:prashantgajare,項目名稱:civicrm-core,代碼行數:13,代碼來源:Search.php

示例12:

 /**
  * class constructor
  */
 function __construct($title = null, $modal = true, $action = CRM_Core_Action::NONE)
 {
     require_once 'CRM/Contact/StateMachine/Search.php';
     parent::__construct($title, $modal);
     $this->_stateMachine =& new CRM_Contact_StateMachine_Search($this, $action);
     // create and instantiate the pages
     $this->addPages($this->_stateMachine, $action);
     // add all the actions
     $this->addActions();
 }
開發者ID:ksecor,項目名稱:civicrm,代碼行數:13,代碼來源:Search.php

示例13:

 /**
  * class constructor
  */
 function __construct($title = null, $action = CRM_Core_Action::NONE, $modal = true)
 {
     require_once 'CRM/Campaign/StateMachine/Search.php';
     parent::__construct($title, $modal);
     $this->_stateMachine = new CRM_Campaign_StateMachine_Search($this, $action);
     // create and instantiate the pages
     $this->addPages($this->_stateMachine, $action);
     // add all the actions
     $config = CRM_Core_Config::singleton();
     $this->addActions();
 }
開發者ID:hampelm,項目名稱:Ginsberg-CiviDemo,代碼行數:14,代碼來源:Search.php

示例14:

 /**
  * class constructor
  */
 function __construct($title = null, $action = CRM_Core_Action::NONE, $modal = true)
 {
     parent::__construct($title, $modal);
     require_once 'CRM/Upgrade/StateMachine.php';
     $this->_stateMachine = new CRM_Upgrade_StateMachine($this, $this->getPages(), $action);
     // create and instantiate the pages
     $this->addPages($this->_stateMachine, $action);
     // add all the actions
     $config = CRM_Core_Config::singleton();
     $this->addActions();
 }
開發者ID:hampelm,項目名稱:Ginsberg-CiviDemo,代碼行數:14,代碼來源:Controller.php

示例15: __construct

 /**
  * Class constructor.
  *
  * @param string $title
  * @param bool|int $action
  * @param bool $modal
  */
 public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE)
 {
     parent::__construct($title, $modal);
     // lets get around the time limit issue if possible, CRM-2113
     if (!ini_get('safe_mode')) {
         set_time_limit(0);
     }
     $this->_stateMachine = new CRM_Import_StateMachine($this, $action);
     // create and instantiate the pages
     $this->addPages($this->_stateMachine, $action);
     // add all the actions
     $config = CRM_Core_Config::singleton();
     $this->addActions($config->uploadDir, array('uploadFile'));
 }
開發者ID:FundingWorks,項目名稱:civicrm-core,代碼行數:21,代碼來源:Controller.php


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