本文整理汇总了PHP中CRM_Utils_Hook::buildForm方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Utils_Hook::buildForm方法的具体用法?PHP CRM_Utils_Hook::buildForm怎么用?PHP CRM_Utils_Hook::buildForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Utils_Hook
的用法示例。
在下文中一共展示了CRM_Utils_Hook::buildForm方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildForm
/**
* Core function that builds the form. We redefine this function
* here and expect all CRM forms to build their form in the function
* buildQuickForm.
*
*/
function buildForm()
{
$this->_formBuilt = true;
$this->preProcess();
$this->assign('translatePermission', CRM_Core_Permission::check('translate CiviCRM'));
if ($this->controller->_key && $this->controller->_print != CRM_Core_Smarty::PRINT_NOFORM) {
$this->addElement('hidden', 'qfKey', $this->controller->_key);
$this->assign('qfKey', $this->controller->_key);
}
require_once 'CRM/Utils/Hook.php';
$this->buildQuickForm();
$defaults =& $this->setDefaultValues();
unset($defaults['qfKey']);
if (!empty($defaults)) {
$this->setDefaults($defaults);
}
// call the form hook
// also call the hook function so any modules can set thier own custom defaults
// the user can do both the form and set default values with this hook
CRM_Utils_Hook::buildForm(get_class($this), $this);
$this->addRules();
}
示例2: buildForm
/**
* Core function that builds the form. We redefine this function
* here and expect all CRM forms to build their form in the function
* buildQuickForm.
*/
public function buildForm()
{
$this->_formBuilt = TRUE;
$this->preProcess();
CRM_Utils_Hook::preProcess(get_class($this), $this);
$this->assign('translatePermission', CRM_Core_Permission::check('translate CiviCRM'));
if ($this->controller->_key && $this->controller->_generateQFKey) {
$this->addElement('hidden', 'qfKey', $this->controller->_key);
$this->assign('qfKey', $this->controller->_key);
}
// _generateQFKey suppresses the qfKey generation on form snippets that
// are part of other forms, hence we use that to avoid adding entryURL
if ($this->controller->_generateQFKey && $this->controller->_entryURL) {
$this->addElement('hidden', 'entryURL', $this->controller->_entryURL);
}
$this->buildQuickForm();
$defaults = $this->setDefaultValues();
unset($defaults['qfKey']);
if (!empty($defaults)) {
$this->setDefaults($defaults);
}
// call the form hook
// also call the hook function so any modules can set their own custom defaults
// the user can do both the form and set default values with this hook
CRM_Utils_Hook::buildForm(get_class($this), $this);
$this->addRules();
//Set html data-attribute to enable warning user of unsaved changes
if ($this->unsavedChangesWarn === TRUE || !isset($this->unsavedChangesWarn) && ($this->_action & CRM_Core_Action::ADD || $this->_action & CRM_Core_Action::UPDATE)) {
$this->setAttribute('data-warn-changes', 'true');
}
}
示例3: buildForm
/**
* Core function that builds the form. We redefine this function
* here and expect all CRM forms to build their form in the function
* buildQuickForm.
*
*/
function buildForm()
{
$this->_formBuilt = TRUE;
$this->preProcess();
$this->assign('translatePermission', CRM_Core_Permission::check('translate CiviCRM'));
if ($this->controller->_key && $this->controller->_generateQFKey) {
$this->addElement('hidden', 'qfKey', $this->controller->_key);
$this->assign('qfKey', $this->controller->_key);
}
// _generateQFKey suppresses the qfKey generation on form snippets that
// are part of other forms, hence we use that to avoid adding entryURL
if ($this->controller->_generateQFKey && $this->controller->_entryURL) {
$this->addElement('hidden', 'entryURL', $this->controller->_entryURL);
}
$this->buildQuickForm();
$defaults = $this->setDefaultValues();
unset($defaults['qfKey']);
if (!empty($defaults)) {
$this->setDefaults($defaults);
}
// call the form hook
// also call the hook function so any modules can set thier own custom defaults
// the user can do both the form and set default values with this hook
CRM_Utils_Hook::buildForm(get_class($this), $this);
$this->addRules();
}