public static function wf_crm_admin_help::custom in Webform CiviCRM Integration 7.5
Same name and namespace in other branches
- 7.4 includes/wf_crm_admin_help.inc \wf_crm_admin_help::custom()
Get help for a custom field
1 call to wf_crm_admin_help::custom()
- wf_crm_admin_help in includes/
wf_crm_admin_help.inc - Ajax page callback
File
- includes/
wf_crm_admin_help.inc, line 491 - Admin form inline-help.
Class
- wf_crm_admin_help
- Class wf_crm_admin_help Adding a static function to this class with the same name as a field will magically add pop-up help for that field to the admin form.
Code
public static function custom($param) {
list(, $id) = explode('_', $param);
if (!is_numeric($id)) {
return;
}
civicrm_initialize();
module_load_include('inc', 'webform_civicrm', 'includes/utils');
$info = wf_civicrm_api('custom_field', 'getsingle', [
'id' => $id,
]);
if (!empty($info['help_pre'])) {
print '<p>' . $info['help_pre'] . '</p>';
}
if (!empty($info['help_post'])) {
print '<p>' . $info['help_post'] . '</p>';
}
}