You are here

public function CRMFeedsActivityProcessor::configForm in CRM Core 8.3

Same name and namespace in other branches
  1. 8 modules/crm_core_activity/legacy/CRMFeedsActivityProcessor.inc \CRMFeedsActivityProcessor::configForm()
  2. 8.2 modules/crm_core_activity/legacy/CRMFeedsActivityProcessor.inc \CRMFeedsActivityProcessor::configForm()
  3. 7 modules/crm_core_activity/includes/CRMFeedsActivityProcessor.inc \CRMFeedsActivityProcessor::configForm()

Override parent::configForm().

File

modules/crm_core_activity/legacy/CRMFeedsActivityProcessor.inc, line 153
Class definition of CRMFeedsActivityProcessor. @TODO: Remove Feeds integration

Class

CRMFeedsActivityProcessor
Creates activities from feed items.

Code

public function configForm(&$form_state) {
  $types = $this
    ->getActivitytypeNames();
  $form = parent::configForm($form_state);
  $form['activity_type'] = [
    '#type' => 'select',
    '#title' => t('Activity type'),
    '#description' => t('Select the type of activities to be created.'),
    '#options' => $types,
    '#default_value' => $this->config['activity_type'],
  ];
  $author = user_load($this->config['author']);
  $form['author'] = [
    '#type' => 'textfield',
    '#title' => t('Author'),
    '#description' => t('Select the author of the activities 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([
    FEEDS_EXPIRE_NEVER,
    3600,
    10800,
    21600,
    43200,
    86400,
    259200,
    604800,
    2592000,
    2592000 * 3,
    2592000 * 6,
    31536000,
  ], 'feeds_format_expire');
  $form['expire'] = [
    '#type' => 'select',
    '#title' => t('Expire activities'),
    '#options' => $period,
    '#description' => t("Select after how much time activities should be deleted. The activity's published date will be used for determining the activity's age, see Mapping settings."),
    '#default_value' => $this->config['expire'],
  ];
  $form['update_existing']['#options'] = [
    FEEDS_SKIP_EXISTING => 'Do not update existing activities',
    FEEDS_REPLACE_EXISTING => 'Replace existing activities',
    FEEDS_UPDATE_EXISTING => 'Update existing activities (slower than replacing them)',
  ];
  return $form;
}