本文整理匯總了PHP中CRM_PCP_BAO_PCP::buildPCPForm方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_PCP_BAO_PCP::buildPCPForm方法的具體用法?PHP CRM_PCP_BAO_PCP::buildPCPForm怎麽用?PHP CRM_PCP_BAO_PCP::buildPCPForm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_PCP_BAO_PCP
的用法示例。
在下文中一共展示了CRM_PCP_BAO_PCP::buildPCPForm方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: buildQuickForm
/**
* Build the form object.
*
* @return void
*/
public function buildQuickForm()
{
CRM_PCP_BAO_PCP::buildPCPForm($this);
$this->addElement('checkbox', 'pcp_active', ts('Enable Personal Campaign Pages? (for this event)'), NULL, array('onclick' => "return showHideByValue('pcp_active',true,'pcpFields','table-row','radio',false);"));
$this->add('select', 'target_entity_type', ts('Campaign Type'), array('' => ts('- select -'), 'event' => ts('Event'), 'contribute' => ts('Contribution')), NULL, array('onchange' => "return showHideByValue('target_entity_type','contribute','pcpDetailFields','block','select',false);"));
$this->add('select', 'target_entity_id', ts('Online Contribution Page'), array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::contributionPage());
parent::buildQuickForm();
// If at least one PCP has been created, don't allow changing the target
$pcpBlock = new CRM_PCP_DAO_PCPBlock();
$pcpBlock->entity_table = 'civicrm_event';
$pcpBlock->entity_id = $this->_id;
$pcpBlock->find(TRUE);
if (!empty($pcpBlock->id) && CRM_PCP_BAO_PCP::getPcpBlockInUse($pcpBlock->id)) {
foreach (array('target_entity_type', 'target_entity_id') as $element_name) {
$element = $this->getElement($element_name);
$element->freeze();
}
}
$this->addFormRule(array('CRM_PCP_Form_Event', 'formRule'), $this);
}
示例2: buildQuickForm
/**
* Function to build the form
*
* @return void
* @access public
*/
public function buildQuickForm()
{
CRM_PCP_BAO_PCP::buildPCPForm($this);
$this->addElement('checkbox', 'pcp_active', ts('Enable Personal Campaign Pages? (for this contribution page)'), NULL, array('onclick' => "return showHideByValue('pcp_active',true,'pcpFields','table-row','radio',false);"));
parent::buildQuickForm();
$this->addFormRule(array('CRM_PCP_Form_Contribute', 'formRule'), $this);
}