本文整理匯總了PHP中CRM_Core_SelectValues::mailingComponents方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_SelectValues::mailingComponents方法的具體用法?PHP CRM_Core_SelectValues::mailingComponents怎麽用?PHP CRM_Core_SelectValues::mailingComponents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Core_SelectValues
的用法示例。
在下文中一共展示了CRM_Core_SelectValues::mailingComponents方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: buildQuickForm
/**
* Function to build the form
*
* @return None
* @access public
*/
function buildQuickForm()
{
$this->applyFilter('__ALL__', 'trim');
$this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'name'), true);
$this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Mailing_DAO_Component', $this->_id));
$this->add('select', 'component_type', ts('Component Type'), CRM_Core_SelectValues::mailingComponents());
$this->add('text', 'subject', ts('Subject'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'subject'), true);
$this->add('textarea', 'body_text', ts('Body in text format'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'body_text'), true);
$this->add('textarea', 'body_html', ts('Body in html format'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'body_html'), true);
$this->add('checkbox', 'is_default', ts('Default?'));
$this->add('checkbox', 'is_active', ts('Enabled?'));
$this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => true), array('type' => 'cancel', 'name' => ts('Cancel'))));
}
示例2: buildQuickForm
/**
* Build the form object.
*/
public function buildQuickForm()
{
$this->applyFilter(array('name', 'subject', 'body_html'), 'trim');
$this->add('text', 'name', ts('Name'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'name'), TRUE);
$this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array('CRM_Mailing_DAO_Component', $this->_id));
$this->add('select', 'component_type', ts('Component Type'), CRM_Core_SelectValues::mailingComponents());
$this->add('text', 'subject', ts('Subject'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'subject'), TRUE);
$this->add('textarea', 'body_text', ts('Body - TEXT Format'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'body_text'), TRUE);
$this->add('textarea', 'body_html', ts('Body - HTML Format'), CRM_Core_DAO::getAttribute('CRM_Mailing_DAO_Component', 'body_html'));
$this->addYesNo('is_default', ts('Default?'));
$this->addYesNo('is_active', ts('Enabled?'));
$this->addFormRule(array('CRM_Mailing_Form_Component', 'dataRule'));
$this->addButtons(array(array('type' => 'next', 'name' => ts('Save'), 'isDefault' => TRUE), array('type' => 'cancel', 'name' => ts('Cancel'))));
}