public function CRMFeedsContactProcessor::configForm in CRM Core 8.2
Same name and namespace in other branches
- 8.3 modules/crm_core_contact/legacy/CRMFeedsContactProcessor.inc \CRMFeedsContactProcessor::configForm()
- 8 modules/crm_core_contact/legacy/CRMFeedsContactProcessor.inc \CRMFeedsContactProcessor::configForm()
- 7 modules/crm_core_contact/includes/CRMFeedsContactProcessor.inc \CRMFeedsContactProcessor::configForm()
Override parent::configForm().
File
- modules/
crm_core_contact/ legacy/ CRMFeedsContactProcessor.inc, line 132 - Class definition of CRMFeedsContactProcessor.
Class
- CRMFeedsContactProcessor
- Creates contacts from feed items.
Code
public function configForm(&$form_state) {
$types = ContactType::getNames();
array_walk($types, 'check_plain');
$form = parent::configForm($form_state);
$form['contact_type'] = array(
'#type' => 'select',
'#title' => t('Contact type'),
'#description' => t('Select the type of contacts to be created.'),
'#options' => $types,
'#default_value' => $this->config['contact_type'],
);
$author = user_load($this->config['author']);
$form['author'] = array(
'#type' => 'textfield',
'#title' => t('Author'),
'#description' => t('Select the author of the contacts to be created - leave empty to assign "anonymous".'),
'#autocomplete_path' => 'user/autocomplete',
'#default_value' => empty($author->name) ? 'anonymous' : check_plain($author->name),
);
$period = drupal_map_assoc(array(
FEEDS_EXPIRE_NEVER,
3600,
10800,
21600,
43200,
86400,
259200,
604800,
2592000,
2592000 * 3,
2592000 * 6,
31536000,
), 'feeds_format_expire');
$form['expire'] = array(
'#type' => 'select',
'#title' => t('Expire contacts'),
'#options' => $period,
'#description' => t('Select after how much time contacts should be deleted. The contact\'s published date will be used for determining the contact\'s age, see Mapping settings.'),
'#default_value' => $this->config['expire'],
);
$form['update_existing']['#options'] = array(
FEEDS_SKIP_EXISTING => 'Do not update existing contacts',
FEEDS_REPLACE_EXISTING => 'Replace existing contacts',
FEEDS_UPDATE_EXISTING => 'Update existing contacts (slower than replacing them)',
);
return $form;
}