You are here

public function FeedsCommentProcessor::configForm in Feeds Comment Processor 7

Same name and namespace in other branches
  1. 6 FeedsCommentProcessor.inc \FeedsCommentProcessor::configForm()

File

./FeedsCommentProcessor.inc, line 166
Contains FeedsCommentProcessor.

Class

FeedsCommentProcessor
Creates comments from feed items.

Code

public function configForm(&$form_state) {
  $form = parent::configForm($form_state);
  $form['input_format']['#access'] = FALSE;
  $form['bundle']['#title'] = t('Comment type');
  $author = user_load($this->config['author']);
  $form['author'] = array(
    '#type' => 'textfield',
    '#title' => t('Author'),
    '#description' => t('Select the author of the comments to be created - leave empty to assign "anonymous".'),
    '#autocomplete_path' => 'user/autocomplete',
    '#default_value' => empty($author->name) ? 'anonymous' : check_plain($author->name),
  );
  $form['authorize'] = array(
    '#type' => 'checkbox',
    '#title' => t('Authorize'),
    '#description' => t('Check that the author has permission to create and publish comments.'),
    '#default_value' => $this->config['authorize'],
  );
  $period = drupal_map_assoc(array(
    FEEDS_EXPIRE_NEVER,
    3600,
    10800,
    21600,
    43200,
    86400,
    259200,
    604800,
    604800 * 4,
    604800 * 12,
    604800 * 24,
    31536000,
  ), 'feeds_format_expire');
  $form['expire'] = array(
    '#type' => 'select',
    '#title' => t('Expire comments'),
    '#options' => $period,
    '#description' => t("Select after how much time comments should be deleted. The comment's published date will be used for determining the comment's age, see Mapping settings."),
    '#default_value' => $this->config['expire'],
  );
  return $form;
}