function _webform_display_civicrm_contact in Webform CiviCRM Integration 7.3
Same name and namespace in other branches
- 7.5 includes/contact_component.inc \_webform_display_civicrm_contact()
- 7.4 includes/contact_component.inc \_webform_display_civicrm_contact()
Implements _webform_display_component().
File
- ./
contact_component.inc, line 425
Code
function _webform_display_civicrm_contact($component, $value, $format = 'html') {
$display = empty($value[0]) ? '' : wf_crm_display_name($value[0]);
if ($format == 'html' && $display && user_access('access CiviCRM')) {
$display = l($display, 'civicrm/contact/view', array(
'alias' => TRUE,
'query' => array(
'reset' => 1,
'cid' => $value[0],
),
));
}
return array(
'#title' => $component['name'],
'#weight' => $component['weight'],
'#theme' => 'display_civicrm_contact',
'#theme_wrappers' => $format == 'html' ? array(
'webform_element',
) : array(
'webform_element_text',
),
'#field_prefix' => '',
'#field_suffix' => '',
'#format' => $format,
'#value' => $display,
'#translatable' => array(
'title',
),
);
}