You are here

function wf_crm_format_contact in Webform CiviCRM Integration 7.4

Same name and namespace in other branches
  1. 7.5 includes/contact_component.inc \wf_crm_format_contact()
  2. 7.3 contact_component.inc \wf_crm_format_contact()

Display a contact based on chosen fields

Parameters

array $contact:

array $display_fields:

bool $escape:

Return value

bool|string

2 calls to wf_crm_format_contact()
wf_crm_contact_access in includes/contact_component.inc
Load contact name if user has permission. Else return FALSE.
wf_crm_contact_search in includes/contact_component.inc
Returns a list of contacts based on component settings.

File

includes/contact_component.inc, line 810

Code

function wf_crm_format_contact($contact, $display_fields, $escape = TRUE) {
  if (!$contact) {
    return FALSE;
  }
  $display = array();
  foreach ($display_fields as $field) {
    if ($field && !empty($contact[$field])) {
      $display[] = $escape ? check_plain($contact[$field]) : $contact[$field];
    }
  }
  return implode(' :: ', $display);
}