function mailchimp_mailchimp_merge_keys in Mailchimp 5
Same name and namespace in other branches
- 5.2 mailchimp.module \mailchimp_mailchimp_merge_keys()
- 6.2 mailchimp.module \mailchimp_mailchimp_merge_keys()
- 6 mailchimp.module \mailchimp_mailchimp_merge_keys()
Implementation of hook_mailchimp_merge_keys
File
- ./
mailchimp.module, line 579
Code
function mailchimp_mailchimp_merge_keys() {
$out = array(
0 => '<none>',
);
$user_fields = array(
'name' => t('Username'),
'mail' => t('Email Address'),
'uid' => t('User ID'),
'signature' => t("User's Signature"),
);
foreach ($user_fields as $key => $field) {
$out[$key] = t('User: !field', array(
'!field' => $field,
));
}
if (function_exists('_profile_get_fields')) {
$categories = profile_categories();
if (!empty($categories)) {
foreach ($categories as $category) {
$result = _profile_get_fields($category['name'], $register);
while ($field = db_fetch_object($result)) {
$out[$field->name] = t('Profile: !cat - !field', array(
'!cat' => $field->category,
'!field' => $field->title,
));
}
}
}
}
if (function_exists('token_get_list')) {
$tokens = token_get_list('user');
foreach ($tokens['user'] as $token => $name) {
$out['token_' . $token] = t('Token: !field', array(
'!field' => $name,
));
}
}
return $out;
}