function wf_crm_contact_fields in Webform CiviCRM Integration 7.5
Same name and namespace in other branches
- 7.3 contact_component.inc \wf_crm_contact_fields()
- 7.4 includes/contact_component.inc \wf_crm_contact_fields()
Find exposed field groups for a contact
Parameters
$node: Node object
$con: Contact #
Return value
array
2 calls to wf_crm_contact_fields()
- _webform_edit_civicrm_contact in includes/
contact_component.inc - Implements _webform_edit_component().
- _webform_render_civicrm_contact in includes/
contact_component.inc - Implements _webform_render_component().
File
- includes/
contact_component.inc, line 831
Code
function wf_crm_contact_fields($node, $con) {
$ret = [];
$sets = wf_crm_get_fields('sets');
$sets['name'] = [
'label' => t('Name'),
];
foreach ($node->webform['components'] as $f) {
if ($pieces = wf_crm_explode_key($f['form_key'])) {
list(, $c, $ent, , $table, $field) = $pieces;
if ($ent == 'contact' && $c == $con && isset($sets[$table])) {
// Separate name from other contact fields
if ($table == 'contact' && strpos($field, 'name')) {
$table = 'name';
}
if ($field != 'existing') {
$ret[$table] = $sets[$table]['label'];
}
}
}
}
return $ret;
}