if (array_key_exists($msgToken, $this->tokenNames)) {
$activeTokens[] = $msgToken;
}
- else {
- $altToken = preg_replace('/_\d+_/', '_N_', $msgToken);
- if (array_key_exists($altToken, $this->tokenNames)) {
- $activeTokens[] = $msgToken;
- }
- }
}
return array_unique($activeTokens);
}
*/
protected function getCustomFieldTokens(): array {
if (!isset($this->customFieldTokens)) {
- $this->customFieldTokens = \CRM_Utils_Token::getCustomFieldTokens(ucfirst($this->getEntityName()));
+ $this->customFieldTokens = [];
+ foreach (CRM_Core_BAO_CustomField::getFields(ucfirst($this->getEntityName())) as $id => $info) {
+ $this->customFieldTokens['custom_' . $id] = $info['label'] . ' :: ' . $info['groupTitle'];
+ }
}
return $this->customFieldTokens;
}