function constant_contact_install in Constant Contact 6.3
Same name and namespace in other branches
- 5 constant_contact.install \constant_contact_install()
- 6 constant_contact.install \constant_contact_install()
- 6.2 constant_contact.install \constant_contact_install()
- 7.3 constant_contact.install \constant_contact_install()
Installs the variables we need for the module
File
- ./
constant_contact.install, line 49
Code
function constant_contact_install() {
// list of all extra fields the API supports
$cc_extra_fields = array(
'First Name',
'Middle Name',
'Last Name',
'Job Title',
'Company Name',
'Home Phone',
'Work Phone',
'Addr1',
'Addr2',
'Addr3',
'City',
'State Code',
'State Name',
'Country Code',
'Country Name',
'Postal Code',
'Sub Postal Code',
'Note',
'CustomField1',
'CustomField2',
'CustomField3',
'CustomField4',
'CustomField5',
'CustomField6',
'CustomField7',
'CustomField8',
'CustomField9',
'CustomField10',
'CustomField11',
'CustomField12',
'CustomField13',
'CustomField14',
'CustomField15',
);
// build the mappings
$fields = array();
foreach ($cc_extra_fields as $field) {
$fields[] = str_replace(' ', '', $field) . ":profile_" . str_replace(' ', '_', strtolower($field));
}
$mappings = implode(', ', $fields);
// set default values
variable_set('cc_extra_fields', $cc_extra_fields);
variable_set('cc_extra_field_mappings', $mappings);
// so custom modules that hook into this module will work with a weight of 100 or more
db_query("UPDATE {system} SET weight = 99 WHERE name = 'constant_contact'");
}