function _wf_crm_set_message in Webform CiviCRM Integration 7.3
Displays the admin-defined message with "not you?" link to known contacts
Parameters
$message: Raw message with tokens
$contact: CiviCRM contact array
1 call to _wf_crm_set_message()
- _wf_crm_frontend_form_alter in ./
webform_civicrm_forms.inc - Alter front-end of webforms: Called by hook_form_alter() when rendering a civicrm-enabled webform Add custom prefix. Display messages. Block users who should not have access. Set webform default values.
File
- ./
webform_civicrm_forms.inc, line 1643
Code
function _wf_crm_set_message($message, $contact) {
$message = wf_crm_replace_tokens($message, $contact);
preg_match_all('#\\{([^}]+)\\}#', $message, $matches);
if (!empty($matches[0])) {
$q = $_GET;
unset($q['q'], $q['cs'], $q['cid'], $q['cid1']);
if (empty($_GET['cid']) && empty($_GET['cid1'])) {
$q['cid1'] = 0;
}
foreach ($matches[0] as $pos => $match) {
$link = l($matches[1][$pos], $_GET['q'], array(
'query' => $q,
'alias' => TRUE,
));
$message = str_replace($match, $link, $message);
}
}
drupal_set_message($message);
}