function constant_contact_install in Constant Contact 7.3
Same name and namespace in other branches
- 5 constant_contact.install \constant_contact_install()
- 6.3 constant_contact.install \constant_contact_install()
- 6 constant_contact.install \constant_contact_install()
- 6.2 constant_contact.install \constant_contact_install()
Implements hook_install().
File
- ./
constant_contact.install, line 46
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) . ":field_" . str_replace(' ', '_', drupal_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'");
}