You are here

function constant_contact_build_field_mappings in Constant Contact 6.3

Same name and namespace in other branches
  1. 7.3 constant_contact.module \constant_contact_build_field_mappings()

Format field mappings into array

1 call to constant_contact_build_field_mappings()
constant_contact_user in ./constant_contact.module
This method adds extra functionality to the user methods Create, Update, Delete

File

./constant_contact.module, line 1198

Code

function constant_contact_build_field_mappings() {
  if (isset($GLOBALS['cc_extra_field_mappings'])) {
    return $GLOBALS['cc_extra_field_mappings'];
  }
  $mappings = variable_get('cc_extra_field_mappings', array());
  $field_mappings = explode(',', $mappings);
  $GLOBALS['cc_extra_field_mappings'] = array();
  if ($field_mappings) {
    foreach ($field_mappings as $mapping) {
      $bits = explode(':', $mapping);
      if (is_array($bits) && isset($bits[0], $bits[1])) {
        $GLOBALS['cc_extra_field_mappings'][trim($bits[0])] = trim($bits[1]);
      }
    }
  }
  return $GLOBALS['cc_extra_field_mappings'];
}