本文整理汇总了PHP中CRM_Mailing_BAO_Mailing::getGroupNames方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Mailing_BAO_Mailing::getGroupNames方法的具体用法?PHP CRM_Mailing_BAO_Mailing::getGroupNames怎么用?PHP CRM_Mailing_BAO_Mailing::getGroupNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Mailing_BAO_Mailing
的用法示例。
在下文中一共展示了CRM_Mailing_BAO_Mailing::getGroupNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTokenData
/**
*
* getTokenData receives a token from an email
* and returns the appropriate data for the token
*
*/
private function getTokenData(&$token_a, $html = false, &$contact, &$verp, &$urls, $event_queue_id)
{
$type = $token_a['type'];
$token = $token_a['token'];
$data = $token;
$escapeSmarty = defined('CIVICRM_MAIL_SMARTY') ? true : false;
if ($type == 'embedded_url') {
$embed_data = array();
foreach ($token as $t) {
$embed_data[] = $this->getTokenData($t, $html = false, $contact, $verp, $urls, $event_queue_id);
}
$numSlices = count($embed_data);
$url = '';
for ($i = 0; $i < $numSlices; $i++) {
$url .= "{$token_a['embed_parts'][$i]}{$embed_data[$i]}";
}
if (isset($token_a['embed_parts'][$numSlices])) {
$url .= $token_a['embed_parts'][$numSlices];
}
// add trailing quote since we've gobbled it up in a previous regex
// function getPatterns, line 431
if (preg_match('/^href[ ]*=[ ]*\'/', $url)) {
$url .= "'";
} else {
if (preg_match('/^href[ ]*=[ ]*\\"/', $url)) {
$url .= '"';
}
}
$data = $url;
} else {
if ($type == 'url') {
if ($this->url_tracking) {
$data = CRM_Mailing_BAO_TrackableURL::getTrackerURL($token, $this->id, $event_queue_id);
} else {
$data = $token;
}
} else {
if ($type == 'contact') {
$data = CRM_Utils_Token::getContactTokenReplacement($token, $contact, false, false, $escapeSmarty);
} else {
if ($type == 'action') {
$data = CRM_Utils_Token::getActionTokenReplacement($token, $verp, $urls, $html);
} else {
if ($type == 'domain') {
require_once 'CRM/Core/BAO/Domain.php';
$domain =& CRM_Core_BAO_Domain::getDomain();
$data = CRM_Utils_Token::getDomainTokenReplacement($token, $domain, $html);
} else {
if ($type == 'mailing') {
require_once 'CRM/Mailing/BAO/Mailing.php';
$mailing = new CRM_Mailing_BAO_Mailing();
$mailing->find(true);
if ($token == 'name') {
$data = $mailing->name;
} else {
if ($token == 'group') {
$groups = $mailing->getGroupNames();
$data = implode(', ', $groups);
}
}
} else {
$data = CRM_Utils_Array::value("{$type}.{$token}", $contact);
}
}
}
}
}
}
return $data;
}