本文整理汇总了PHP中CRM_Core_SelectValues::greeting方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_SelectValues::greeting方法的具体用法?PHP CRM_Core_SelectValues::greeting怎么用?PHP CRM_Core_SelectValues::greeting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_SelectValues
的用法示例。
在下文中一共展示了CRM_Core_SelectValues::greeting方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildQuickForm
/**
* This function provides the HTML form elements that are specific to the Individual Contact Type
*
* @access public
* @return None
*/
function buildQuickForm(&$form)
{
$form->applyFilter('__ALL__', 'trim');
// prefix
$form->addElement('select', 'prefix_id', ts('Prefix'), array('' => ts('- prefix -')) + CRM_Core_PseudoConstant::individualPrefix());
$attributes = CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Individual');
// first_name
$form->addElement('text', 'first_name', ts('First Name'), $attributes['first_name']);
//middle_name
$form->addElement('text', 'middle_name', ts('Middle Name'), $attributes['middle_name']);
// last_name
$form->addElement('text', 'last_name', ts('Last Name'), $attributes['last_name']);
// suffix
$form->addElement('select', 'suffix_id', ts('Suffix'), array('' => ts('- suffix -')) + CRM_Core_PseudoConstant::individualSuffix());
// nick_name
$form->addElement('text', 'nick_name', ts('Nick Name'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'nick_name'));
// greeting type
$form->addElement('select', 'greeting_type', ts('Greeting'), CRM_Core_SelectValues::greeting());
// job title
$form->addElement('text', 'job_title', ts('Job title'), $attributes['job_title']);
// radio button for gender
$genderOptions = array();
$gender = CRM_Core_PseudoConstant::gender();
foreach ($gender as $key => $var) {
$genderOptions[$key] = HTML_QuickForm::createElement('radio', null, ts('Gender'), $var, $key);
}
$form->addGroup($genderOptions, 'gender_id', ts('Gender'));
$form->addElement('checkbox', 'is_deceased', null, ts('Contact is deceased'));
$form->addElement('date', 'birth_date', ts('Date of birth'), CRM_Core_SelectValues::date('birth'));
$form->addRule('birth_date', ts('Select a valid date.'), 'qfDate');
$form->addElement('text', 'home_URL', ts('Website'), CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact', 'home_URL'));
$form->addRule('home_URL', ts('Enter a valid Website.'), 'url');
$config =& CRM_Core_Config::singleton();
CRM_Core_ShowHideBlocks::links($this, 'demographics', '', '');
}