本文整理汇总了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'))));
}