本文整理汇总了PHP中CRM_Core_Controller::_template方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Controller::_template方法的具体用法?PHP CRM_Core_Controller::_template怎么用?PHP CRM_Core_Controller::_template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Controller
的用法示例。
在下文中一共展示了CRM_Core_Controller::_template方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* All CRM single or multi page pages should inherit from this class.
*
* @param string title descriptive title of the controller
* @param boolean whether controller is modal
* @param string scope name of session if we want unique scope, used only by Controller_Simple
* @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)
*
* @access public
*
* @return void
*
*/
function __construct($title = NULL, $modal = TRUE, $mode = NULL, $scope = NULL, $addSequence = FALSE, $ignoreKey = FALSE)
{
// this has to true for multiple tab session fix
$addSequence = TRUE;
// let the constructor initialize this, should happen only once
if (!isset(self::$_template)) {
self::$_template = CRM_Core_Smarty::singleton();
self::$_session = CRM_Core_Session::singleton();
}
// lets try to get it from the session and/or the request vars
// we do this early on in case there is a fatal error in retrieving the
// key and/or session
$this->_entryURL = CRM_Utils_Request::retrieve('entryURL', 'String', $this);
// add a unique validable key to the name
$name = CRM_Utils_System::getClassName($this);
if ($name == 'CRM_Core_Controller_Simple' && !empty($scope)) {
// use form name if we have, since its a lot better and
// definitely different for different forms
$name = $scope;
}
$name = $name . '_' . $this->key($name, $addSequence, $ignoreKey);
$this->_title = $title;
if ($scope) {
$this->_scope = $scope;
} else {
$this->_scope = CRM_Utils_System::getClassName($this);
}
$this->_scope = $this->_scope . '_' . $this->_key;
// only use the civicrm cache if we have a valid key
// else we clash with other users CRM-7059
if (!empty($this->_key)) {
CRM_Core_Session::registerAndRetrieveSessionObjects(array("_{$name}_container", array('CiviCRM', $this->_scope)));
}
$this->HTML_QuickForm_Controller($name, $modal);
$snippet = CRM_Utils_Array::value('snippet', $_REQUEST);
if ($snippet) {
if ($snippet == 3) {
$this->_print = CRM_Core_Smarty::PRINT_PDF;
} elseif ($snippet == 4) {
// this is used to embed fragments of a form
$this->_print = CRM_Core_Smarty::PRINT_NOFORM;
self::$_template->assign('suppressForm', TRUE);
$this->_generateQFKey = FALSE;
} elseif ($snippet == 5) {
// this is used for popups and inlined ajax forms
// also used for the various tabs via TabHeader
$this->_print = CRM_Core_Smarty::PRINT_NOFORM;
} elseif ($snippet == 6) {
$this->_print = CRM_Core_Smarty::PRINT_NOFORM;
$this->_QFResponseType = 'json';
} else {
$this->_print = CRM_Core_Smarty::PRINT_SNIPPET;
}
}
// if the request has a reset value, initialize the controller session
if (CRM_Utils_Array::value('reset', $_GET)) {
$this->reset();
// in this case we'll also cache the url as a hidden form variable, this allows us to
// redirect in case the session has disappeared on us
$this->_entryURL = CRM_Utils_System::makeURL(NULL, TRUE, FALSE, NULL, TRUE);
$this->set('entryURL', $this->_entryURL);
}
// set the key in the session
// do this at the end so we have initialized the object
// and created the scope etc
$this->set('qfKey', $this->_key);
// also retrieve and store destination in session
$this->_destination = CRM_Utils_Request::retrieve('civicrmDestination', 'String', $this, FALSE, NULL, $_REQUEST);
}
示例2: array
/**
* All CRM single or multi page pages should inherit from this class.
*
* @param string title descriptive title of the controller
* @param boolean whether controller is modal
* @param string scope name of session if we want unique scope, used only by Controller_Simple
* @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)
*
* @access public
*
* @return void
*
*/
function __construct($title = null, $modal = true, $mode = null, $scope = null, $addSequence = false, $ignoreKey = false)
{
// this has to true for multiple tab session fix
$addSequence = true;
// add a unique validable key to the name
$name = CRM_Utils_System::getClassName($this);
$name = $name . '_' . $this->key($name, $addSequence, $ignoreKey);
$this->_title = $title;
if ($scope) {
$this->_scope = $scope;
} else {
$this->_scope = CRM_Utils_System::getClassName($this);
}
$this->_scope = $this->_scope . '_' . $this->_key;
// only use the civicrm cache if we have a valid key
// else we clash with other users CRM-7059
if (!empty($this->_key)) {
require_once 'CRM/Core/BAO/Cache.php';
CRM_Core_Session::registerAndRetrieveSessionObjects(array("_{$name}_container", array('CiviCRM', $this->_scope)));
}
$this->HTML_QuickForm_Controller($name, $modal);
// let the constructor initialize this, should happen only once
if (!isset(self::$_template)) {
self::$_template = CRM_Core_Smarty::singleton();
self::$_session = CRM_Core_Session::singleton();
}
$snippet = CRM_Utils_Array::value('snippet', $_REQUEST);
//$snippet = CRM_Utils_Request::retrieve( 'snippet', 'Integer', $this, false, null, $_REQUEST );
if ($snippet) {
if ($snippet == 3) {
$this->_print = CRM_Core_Smarty::PRINT_PDF;
} else {
if ($snippet == 4) {
$this->_print = CRM_Core_Smarty::PRINT_NOFORM;
self::$_template->assign('suppressForm', true);
} else {
if ($snippet == 5) {
$this->_print = CRM_Core_Smarty::PRINT_NOFORM;
} else {
$this->_print = CRM_Core_Smarty::PRINT_SNIPPET;
}
}
}
}
// if the request has a reset value, initialize the controller session
if (CRM_Utils_Array::value('reset', $_GET)) {
$this->reset();
}
// set the key in the session
// do this at the end so we have initialized the object
// and created the scope etc
$this->set('qfKey', $this->_key);
require_once 'CRM/Utils/Request.php';
// also retrieve and store destination in session
$this->_destination = CRM_Utils_Request::retrieve('destination', 'String', $this, false, null, $_REQUEST);
}