当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Utils_Hook::buildForm方法代码示例

本文整理汇总了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();
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:28,代码来源:Form.php

示例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');
     }
 }
开发者ID:hoegrammer,项目名称:civicrm-core,代码行数:36,代码来源:Form.php

示例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();
 }
开发者ID:hguru,项目名称:224Civi,代码行数:32,代码来源:Form.php


注:本文中的CRM_Utils_Hook::buildForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。