You are here

function mailchimp_mailchimp_merge_keys in Mailchimp 6.2

Same name and namespace in other branches
  1. 5.2 mailchimp.module \mailchimp_mailchimp_merge_keys()
  2. 5 mailchimp.module \mailchimp_mailchimp_merge_keys()
  3. 6 mailchimp.module \mailchimp_mailchimp_merge_keys()

Implementation of hook_mailchimp_merge_keys

File

./mailchimp.module, line 829
Mailchimp module.

Code

function mailchimp_mailchimp_merge_keys() {
  $out = array(
    '' => '<none>',
  );
  $user_fields = array(
    'name' => t('Username'),
    'mail' => t('Email Address'),
    'uid' => t('User ID'),
    'signature' => t("User's Signature"),
    'created' => t("User's Creation Date"),
    'access' => t("User's Last Access Date"),
  );
  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']);
        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(array(
      'user',
      'order',
    ));
    if (is_array($tokens['user'])) {
      foreach ($tokens['user'] as $token => $name) {
        $out['token_' . $token] = t('Token: !field', array(
          '!field' => $name,
        ));
      }
    }
  }
  return $out;
}