You are here

public function CRMFeedsContactProcessor::configForm in CRM Core 7

Same name and namespace in other branches
  1. 8.3 modules/crm_core_contact/legacy/CRMFeedsContactProcessor.inc \CRMFeedsContactProcessor::configForm()
  2. 8 modules/crm_core_contact/legacy/CRMFeedsContactProcessor.inc \CRMFeedsContactProcessor::configForm()
  3. 8.2 modules/crm_core_contact/legacy/CRMFeedsContactProcessor.inc \CRMFeedsContactProcessor::configForm()

Override parent::configForm().

File

modules/crm_core_contact/includes/CRMFeedsContactProcessor.inc, line 130
Class definition of CRMFeedsContactProcessor.

Class

CRMFeedsContactProcessor
Creates contacts from feed items.

Code

public function configForm(&$form_state) {
  $types = crm_core_contact_type_get_name();
  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;
}