function wf_crm_contact_label in Webform CiviCRM Integration 7.5
Same name and namespace in other branches
- 7.4 includes/utils.inc \wf_crm_contact_label()
Parameters
integer $n:
array $data Form data:
string $html Controls how html should be treated. Options are::
- 'escape': (default) Escape html characters
- 'wrap': Escape html characters and wrap in a span
- 'plain': Do not escape (use when passing into an FAPI options list which does its own escaping)
Return value
string
14 calls to wf_crm_contact_label()
- webform_civicrm_preprocess_webform_results_submissions in ./
webform_civicrm.module - Implements hook_preprocess_HOOK(). Add CiviCRM names to webform submission results table.
- wf_crm_admin_component::alterForm in includes/
wf_crm_admin_component.inc - Alter back-end webform component edit forms. Called by hook_form_alter() whenever editing a webform component.
- wf_crm_admin_component::preprocessComponentsForm in includes/
wf_crm_admin_component.inc - Add CiviCRM info and theming to webform components form.
- wf_crm_admin_form::addFieldset in includes/
wf_crm_admin_form.inc - Create a fieldset around an entity if it doesn't already exist
- wf_crm_admin_form::buildContactTab in includes/
wf_crm_admin_form.inc - Build fields for a contact
File
- includes/
utils.inc, line 1564 - Webform CiviCRM module's common utility functions.
Code
function wf_crm_contact_label($n, $data = [], $html = 'escape') {
$label = trim(wf_crm_aval($data, "contact:{$n}:contact:1:webform_label", ''));
if (!$label) {
$label = t('Contact !num', [
'!num' => $n,
]);
}
if ($html != 'plain') {
$label = check_plain($label);
}
if ($html == 'wrap') {
$label = '<span class="contact-label number-' . $n . '">' . $label . '</span>';
}
return $label;
}