本文整理匯總了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', '', '');
}